Docker run commands for 2 nodes, 2 drives (Exos), on the same Synology DS220+, DSM 7.x, 18GB RAM, using network host mode, and databases moved to USB flash drive:
Startup scripts in task scheduler (triggered, root, boot-up):
sysctl -w net.core.rmem_max=2500000
sysctl -w net.core.wmem_max=2500000
sysctl -w net.ipv4.tcp_fastopen=3
Pre-Setup - only one time:
sudo su
echo "net.core.rmem_max=2500000" >> /etc/sysctl.conf
sysctl -w net.core.rmem_max=2500000
echo "net.core.wmem_max=2500000" >> /etc/sysctl.conf
sysctl -w net.core.wmem_max=2500000
echo "net.ipv4.tcp_fastopen=3" >> /etc/sysctl.conf
sysctl -w net.ipv4.tcp_fastopen=3
Setup - only one time before you start the node, to setup the directories and etc.
sudo su
docker pull storjlabs/storagenode:latest
docker run --rm -e SETUP="true" \
--mount type=bind,source="/volume1/Storj1/Identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/volume1/Storj1/",destination=/app/config \
--name storagenode1 storjlabs/storagenode:latest
docker run --rm -e SETUP="true" \
--mount type=bind,source="/volume2/Storj2/Identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/volume2/Storj2/",destination=/app/config \
--name storagenode2 storjlabs/storagenode:latest
Node 1:
sudo su
docker run -d --restart unless-stopped \
--stop-timeout 300 \
--network host \
-e WALLET="xxx" \
-e EMAIL="xxx" \
-e ADDRESS="xxx:28961" \
-e STORAGE="xxTB" \
--mount type=bind,source="/volume1/Storj1/Identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/volume1/Storj1/",destination=/app/config \
--mount type=bind,source="/volumeUSB1/usbshare/storjdbs1/",destination=/app/dbs \
--log-driver json-file \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name storagenode1 storjlabs/storagenode:latest \
--server.address=":28961" \
--console.address=":14011" \
--server.private-address="127.0.0.1:14021" \
--debug.addr=":6001" \
--storage2.database-dir=dbs \
--log.level=info \
--log.custom-level=piecestore=FATAL,collector=WARN \
--pieces.enable-lazy-filewalker=false \
--storage2.piece-scan-on-startup=false
Node 2:
sudo su
docker run -d --restart unless-stopped \
--stop-timeout 300 \
--network host \
-e WALLET="xxx" \
-e EMAIL="xxx" \
-e ADDRESS="xxx:28962" \
-e STORAGE="xxTB" \
--mount type=bind,source="/volume2/Storj2/Identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/volume2/Storj2/",destination=/app/config \
--mount type=bind,source="/volumeUSB1/usbshare/storjdbs2/",destination=/app/dbs \
--log-driver json-file \
--log-opt max-size=10m \
--log-opt max-file=3 \
--name storagenode2 storjlabs/storagenode:latest \
--server.address=":28962" \
--console.address=":14012" \
--server.private-address="127.0.0.1:14022" \
--debug.addr=":6002" \
--storage2.database-dir=dbs \
--log.level=info \
--log.custom-level=piecestore=FATAL,collector=WARN \
--pieces.enable-lazy-filewalker=false \
--storage2.piece-scan-on-startup=false
Log files:
sudo su
docker logs storagenode1 2>&1
docker logs storagenode2 2>&1
docker logs watchtower 2>&1
docker logs storagenode1 2>&1 | grep "retain"
docker logs storagenode1 2>&1 | grep "pieces:trash"
# SL satellite:
docker logs storagenode1 2>&1 | grep "1wFTAgs9DP5RSnCqKV1eLf6N9wtk4EAtmN5DpSxcs8EjT69tGE"
# AP1 satellite:
docker logs storagenode1 2>&1 | grep "121RTSDpyNZVcEU84Ticf2L1ntiuUimbWgfATz21tuvgk3vzoA6"
# US1 satellite:
docker logs storagenode1 2>&1 | grep "12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S"
# EU1 satellite:
docker logs storagenode1 2>&1 | grep "12L9ZFwhzVpuEKMUNUqkaTLGzwY9G24tbiigLiXpmZWKwmcNDDs"
Path to logs:
# Path to log files:
sudo su
docker ps -a #get instance-id, the beggining of container-id
ls -l #get dirs and files details
# Synology:
sudo su
cd /volume1/@docker/containers/
/<containerID>/<containerID>-json.log
# Ubuntu:
sudo su
cd /var/lib/docker/containers/
/<containerID>/<containerID>-json.log
Help manuals:
sudo su
docker exec -it storagenode1 ./storagenode setup --help
docker logs --help
If databases are moved to USB:
# This startup script works on Synology (triggered, root, boot-up):
mount -o remount,noatime "/volumeUSB1/usbshare"
Graceful Exit:
sudo su
# NODE 1:
docker exec -it storagenode1 /app/storagenode exit-satellite --config-dir /app/config --identity-dir /app/identity --server.private-address 127.0.0.1:14021
docker exec -it storagenode1 /app/storagenode exit-status --config-dir /app/config --identity-dir /app/identity --server.private-address 127.0.0.1:14021
# NODE 2:
docker exec -it storagenode2 /app/storagenode exit-satellite --config-dir /app/config --identity-dir /app/identity --server.private-address 127.0.0.1:14022
docker exec -it storagenode2 /app/storagenode exit-status --config-dir /app/config --identity-dir /app/identity --server.private-address 127.0.0.1:14022
Forget satellites:
sudo su
# Forget untrusted or exited satellites:
docker exec -it storagenode1 /app/storagenode forget-satellite \
--force \
12rfG3sh9NCWiX3ivPjq2HtdLmbqCrvHVEzJubnzFzosMuawymB \
12tRQrMTWUWwzwGh18i7Fqs67kmdhH9t6aToeiwbo5mfS2rUmo \
--config-dir /app/config \
--identity-dir /app/identity \
--server.private-address 127.0.0.1:14021
docker exec -it storagenode2 /app/storagenode forget-satellite \
--force \
12rfG3sh9NCWiX3ivPjq2HtdLmbqCrvHVEzJubnzFzosMuawymB \
12tRQrMTWUWwzwGh18i7Fqs67kmdhH9t6aToeiwbo5mfS2rUmo \
--config-dir /app/config \
--identity-dir /app/identity \
--server.private-address 127.0.0.1:14022
# check status:
docker exec -it storagenode1 /app/storagenode forget-satellite-status \
--config-dir /app/config \
--identity-dir /app/identity \
--server.private-address 127.0.0.1:14021
docker exec -it storagenode2 /app/storagenode forget-satellite-status \
--config-dir /app/config \
--identity-dir /app/identity \
--server.private-address 127.0.0.1:14022
# after Success status, wait 2 minutes and restart the node:
docker stop -t 300 storagenode1
docker restart -t 300 storagenode1
docker stop -t 300 storagenode2
docker restart -t 300 storagenode2
If you change parameters in config.yaml, you only need to restart the node.
If you change parameters in run command, you have to recreate the container:
sudo su
docker stop -t 300 storagenode1
docker rm storagenode1
docker run...
docker stop -t 300 storagenode2
docker rm storagenode2
docker run...