github.com/annchain/OG@v0.0.9/scripts/deploy/README.md (about)

     1  # Deploy Script
     2  Deploy scripts help deploy binaries to multiple hosts instantly, by leveraing P2P content distribution.
     3  
     4  ## Prerequisites
     5  sudo apt-get install sshpass
     6  
     7  install pssh and then pkill pnuke will all be there
     8  
     9  ## Actions
    10  # Add ssh keys 
    11  so that you don't need password to login to the hosts
    12  ```
    13  python3 batch_sshcopyid.py
    14  ```
    15  
    16  # Broadcast files
    17  You need to modifiy parameters in broadcast_file.py first.
    18  ```
    19  python3 broadcast_file.py
    20  ```
    21  
    22  # Batch commands examples
    23  ```
    24  # do a global echo
    25  pssh --user admin --par 20 -i --hosts data/hosts echo "xxx"
    26  
    27  # rsync files to the target hosts
    28  prsync -av --user admin --hosts data/hosts -a /ws/go/src/github.com/latifrons/gofd/release/ /home/admin/gofd
    29  
    30  # start a p2p client to receive files 
    31  pssh --user admin --par 20 -i --hosts data/hosts "cd /home/admin/gofd; ./agent.sh"
    32  
    33  # check process status
    34  pssh --user admin --par 20 -i --hosts data/hosts "ps aux | grep gofd"
    35  
    36  # kill processes
    37  pnuke --user admin --par 20 --hosts data/hosts gofd
    38  ```
    39  
    40  ## start og using a configuration server
    41  ```
    42  # private IP
    43  ./sync/og -c http://172.28.152.31:30030/og_config -n run
    44  # public IP
    45  ./sync/og -c http://47.101.139.203:30030/og_config -n run
    46  ```
    47  
    48  ## batch start og
    49  ```
    50  pssh --user admin --par 20 --hosts data/hosts "chmod +x sync/og && rm -rf data/log && (nohup ./sync/og -c http://172.28.152.31:30030/og_config -l data/log -n run >og.log 2>&1 </dev/null &)"
    51  ```
    52  
    53  ## batch stop og
    54  ```
    55  pnuke --user admin --par 20 --hosts data/hosts og
    56  ```
    57  
    58  ## check alive
    59  ```
    60  pssh --user admin --par 20 -i --hosts data/hosts "ps aux | grep sync/og | wc -l "
    61  ```
    62  
    63  ## remove all running data (start from beginning)
    64  ```
    65  pssh --user admin --par 20 --hosts data/hosts "rm -rf data/log data/datadir og.log"
    66  ```