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 linkarrow-up-right, 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:

  1. 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.service
  1. Place the following bash script `check-and-run-snapdb.sh` nearby the binary.

circle-info

Reason : the dumpdb feature may crash, fortunately, at restart of the process the dump will start where it left off

circle-exclamation
  1. Put the check-and-run-snapdb.sh in the cron to rerun every 5 minutes via crontab -e

triangle-exclamation
  1. Time to time check the logs:

  1. What will you see in the logs when snapdb creation have been finished:

circle-info

Note, this process will take around 2 days

  1. Comment the crontab entry from the 3rd step via crontab -e

  1. Move your old DB and name it like backup, and make a :

  1. Start your harmony process again:

  1. 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.

  2. If everything good - remove old DB from the server, check the step 7:

triangle-exclamation

Last updated

Was this helpful?