blockchainhyperledgerhyperledger-besu

When disconnects from ssh, my Hyperledger Besu nodes stop working


I have an Ubuntu server running with a Hyperledger Besu node working, but if I disconnect from the server, my best nodes stop working, and I have to start all nodes again.

How can I do to my Besu nodes keep running always? even if I got disconnected from ssh


Solution

  • Enable Bezu Nodes as services.

    Example:

    1. Create service /vol/hbesu/node2/besu-node2.service:

      [Unit]
       Description=Besu client
       DefaultDependencies=no
       After=syslog.target network.target
       [Service]
       User=admin-besu
       Group=admin-besu
       Type=simple
       ExecStart=/usr/local/besu-21.1.0-RC1/bin/besu --data-path=/vol/hbesu/node2/data --bootnodes=enode://ae70183
       KillMode=process
       KillSignal=SIGINT
       TimeoutStopSec=90
       Restart=on-failure
       RestartSec=5s
       [Install]
       WantedBy=multi-user.target
      

    sudo cp /vol/hbesu/node2/besu-node2.service /usr/lib/systemd/system/

    1. Start service:

      sudo systemctl daemon-reload

      sudo systemctl enable besu-node2.service

      sudo systemctl start besu-node2.service

      sudo systemctl status -l besu-node2.service