|
| 1 | +# System services & migration |
| 2 | + |
| 3 | +## Services |
| 4 | + |
| 5 | +### terrad |
| 6 | + |
| 7 | +```bash |
| 8 | +sudo cp -i terrad.service /etc/systemd/system/ |
| 9 | +``` |
| 10 | + |
| 11 | +Modify the service file by replacing `$USER` with the correct user. |
| 12 | + |
| 13 | +```bash |
| 14 | +sudo vi /etc/systemd/system/terrad.service |
| 15 | +sudo systemctl daemon-reload |
| 16 | +sudo systemctl start terrad.service |
| 17 | +``` |
| 18 | + |
| 19 | +### Price Server |
| 20 | + |
| 21 | +```bash |
| 22 | +cp -i price-server-start.sh ~/oracle-feeder/price-server/ |
| 23 | +sudo cp -i price-server.service /etc/systemd/system/ |
| 24 | +``` |
| 25 | + |
| 26 | +Modify the service file by replacing `$USER` with the correct user. |
| 27 | + |
| 28 | +```bash |
| 29 | +sudo vi /etc/systemd/system/price-server.service |
| 30 | +sudo systemctl daemon-reload |
| 31 | +sudo systemctl start price-server.service |
| 32 | +``` |
| 33 | + |
| 34 | +### Oracle Feeder |
| 35 | + |
| 36 | +```bash |
| 37 | +cp -i feeder-start.sh ~/oracle-feeder/feeder/ |
| 38 | +sudo cp -i feeder.service /etc/system/system/ |
| 39 | +``` |
| 40 | + |
| 41 | +Modify the service file by replacing `$USER` with the correct user. |
| 42 | + |
| 43 | +IMPORTANT: Adjust the environment variables. |
| 44 | + |
| 45 | +```bash |
| 46 | +sudo vi /etc/systemd/system/feeder.service |
| 47 | +sudo systemctl daemon-reload |
| 48 | +sudo systemctl start feeder.service |
| 49 | +``` |
| 50 | + |
| 51 | +## Migration |
| 52 | + |
| 53 | +### Preparation at the new server |
| 54 | + |
| 55 | +> This section describes the scenario where the data directory resides on an externally mounted volume. |
| 56 | +
|
| 57 | +Copy the configuration files over: |
| 58 | + |
| 59 | +```bash |
| 60 | +scp ~/.terra/config/priv_validator_key.json terra2.aurastake.com:.terra/config/ |
| 61 | +scp ~/.terra/config/config.toml terra2.aurastake.com:.terra/config/ |
| 62 | +scp ~/.terra/config/app.toml terra2.aurastake.com:.terra/config/ |
| 63 | +scp ~/.terra/config/addrbook.json terra2.aurastake.com:.terra/config/ |
| 64 | +scp ~/oracle-feeder/price-server/config/default.js terra2.aurastake.com:oracle-feeder/price-server/config/ |
| 65 | +scp ~/oracle-feeder/feeder/voter.json terra2.aurastake.com:oracle-feeder/feeder/ |
| 66 | +``` |
| 67 | + |
| 68 | +Make the mount directory. |
| 69 | + |
| 70 | +```bash |
| 71 | +sudo mkdir /mnt/bombay10a |
| 72 | +``` |
| 73 | + |
| 74 | +### Deprovisioning at the old server |
| 75 | + |
| 76 | +Check that no other services are accessing the mounted folder. |
| 77 | + |
| 78 | +```bash |
| 79 | +lsof | grep /mnt/columbusa |
| 80 | +``` |
| 81 | + |
| 82 | +```bash |
| 83 | +sudo systemctl stop terrad.service |
| 84 | +sudo umount /mnt/columbusa |
| 85 | +``` |
| 86 | + |
| 87 | +### Dashboard |
| 88 | + |
| 89 | +Then unmount the volume from the old server, and mount the volume onto the new server. |
| 90 | + |
| 91 | +### Activation at the new server |
| 92 | + |
| 93 | +```bash |
| 94 | +sudo mount -o discard,defaults,noatime /dev/disk/by-id/scsi-columbusa /mnt/columbusa |
| 95 | +sudo chown -R ${TERRA_USER}:${TERRA_USER} /mnt/columbusa |
| 96 | +sudo systemctl start terrad.service |
| 97 | +``` |
| 98 | + |
| 99 | +After confirming that the service is running, update the _fstab_ file at **both** servers. |
| 100 | + |
| 101 | +```bash |
| 102 | +echo '/dev/disk/by-id/scsi-columbusa /mnt/columbusa ext4 defaults,noatime,nofail,discard 0 0' | sudo tee -a /etc/fstab |
| 103 | +``` |
0 commit comments