5. [Advanced] - how to create snapDB on your server
If you running validator and an extra node together, you can use extra node to create a snanDB snaphot - smaller DB(120GB+) with only validator info - neither old state nor old transaction history.
SnapDB snapshots be the core team
Please note, you can still find the snapDB from the core team by the link, but if your own you are welcome to proceed.
Requirements
an extra Harmony node
time -> snapDB creation is taking around 2 days
extra space:
current DB around 200->500 GB
snapDB will be around 120+ GB
Creating a snapDB snapshot
You need to do the following to get the fresh snapDB:
Stop currently running harmony service/container/any other way how you run Harmony node, e.g. systemd service:
sudo systemctl stop harmony.service
# we don't want some server reboot to start normal harmony service
sudo systemctl disable harmony.servicePlace the following bash script `check-and-run-snapdb.sh` nearby the binary.
Note: KakashiDB batch writhing and account lines will produce you 90GB of logs without providing you any extra information => so let's just ignore these lines.
Put the check-and-run-snapdb.sh in the cron to rerun every 5 minutes via
crontab -e
Note: by default SHELL in crontab is set to /bin/sh and all relative path like ~/ wouldn't work here, use full path
Time to time check the logs:
What will you see in the logs when snapdb creation have been finished:
Comment the crontab entry from the 3rd step via
crontab -e
Move your old DB and name it like backup, and make a :
Start your harmony process again:
Wait till the node is synced with the latest HEAD block, it will take some small amount of time around 5-15 minutes - node needs to fetch 2+ day blocks.
If everything good - remove old DB from the server, check the step 7:
Note: running rm -rf is dangerous, please double check what are you about to delete!
Last updated
Was this helpful?