0

I am trying to run a Geth node on an AWS EC2 instance. I am able to start it, and it runs fine for a while, but keeps crashing periodically and not leaving much in the log.

The EC2 instance is a T2.Medium, so it has 2 vCPUs and 4GB of RAM. Output of commands about instance:

ubuntu@ip-127-0-0-1:~$ uname -a
Linux ip-127-0-0-1 4.4.0-1062-aws #71-Ubuntu SMP Fri Jun 15 10:07:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ip-127-0-0-1:~$ cat /etc/issue
Ubuntu 16.04.4 LTS \n \l

I have allocated plenty of storage for the blockchain (500GB) and it is not close to full.

I have tried running Geth as a systemd service as mentioned here, as well as every other method listed. Some examples include:

geth --cache=1024 --rpc --rpcapi "eth,web3" 2> gethlog.txt

screen -dm bash -c 'geth --cache=1024 --rpc --rpcapi "eth,web3" 2> gethlog.txt'

nohup geth --cache=1024 --rpc --rpcapi "web3,eth" &

Again, the node starts and runs fine for a long time (I am able to exit the SSH session with the instance, reconnect, and I am able to attach to geth and even curl against the RPC) It seems like after running for a long period of time, geth shuts down. The only time I caught in the above-mentioned gethlog.txt, it was logging as if it received a shutdown command (Already shutting down, interrupt 9 more times for panic.)

I'm thinking something has to be wrong with my EC2 environment. I'm sure I'm missing something obvious, but I've been struggling with this for weeks!

rickjerrity
  • 101
  • 2

1 Answers1

0

Please try below command, its worked for me.

nohup geth --datadir="~/eth-node" --port 30305 --rpc --rpcapi "eth,web3" --nodiscover --targetgaslimit 800000000000 --verbosity 6 >& ./gethout.log &
Jitendra Kumar. Balla
  • 2,154
  • 1
  • 8
  • 15