1

I have 50 VMs and I installed geth on every VM. Now I need to run geth on each VM by doing ssh on each VM. So, I am facing one problem with this when I start a geth node on VM by ssh it starts at that time but, when I come out of ssh it stops. How should I keep the geth process running on VM continously even if I come out of ssh from that VM?

  • What OS are you running on your VMs? screen may be your best bet here – TC8 Jan 29 '18 at 10:01
  • I have Ubuntu-16.04 running on each VM. @TC8 – Vijesh Jan 29 '18 at 10:09
0

I run our private nodes on Ubuntu VMs through screen - this provides an environment which can run on after you close the SSH connection. You could also use it to run multiple geth instances on the same VM, if you felt like it (just create multiple datadirs and use unique ports for each instance)

See the manual here for full info, but some high level features I'd mention are as follows:

  • You can configure a custom /etc/screenrc file to preload geth, log files etc in individual tabs within screen nice and easily. You can then copy this file to each VM and run screen in a terminal; once geth is running correctly press ctrl + a, d to detach from the session and it'll continue running in the background
  • include autodetach on in your screenrc file to ensure that the process carries on even if your SSH connection cuts out unexpectedly
  • see here for some custom screenrc formatting to make your tabs prettier - and easier to manage
0

Use docker container with dynamic ports you can use docker compose similar to something like this setup and then docker-compose up --scale node=200 without having to manually configure each instance

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.