Run shell script on server startup to run multiple servers (CentOs 7)

923 Views Asked by At

Hi its my first attempt at running init scripts.

I'm using chkconfig for running a script file located in /etc/init.d/serverstartup. I've setup 2345 on level & 016 off and added # chkconfig: 2345 99 01 to script.

My script starts 3 node servers but i get ERRORbind EADDRINUSE While i reboot my server & if i kill a server for restart, more and more instances start running.

What am i doing wrong ?

1

There are 1 best solutions below

8
On

The error code "ERRORbind EADDRINUSE" means that the port on which you are trying to start your server is already used by another application.

Changing your node server port to another unused port will solve the problem.