Address already in use error with cluster

When the script on the master is executed, normally it will first execute ‘./node-1.4.21.1-linux-amd64’, then execute ./node-1.4.21.1-linux-amd64 --core=1 --parent-process=xxx in sequence.

But what I am facing now is that when he executes ./node-1.4.21.1-linux-amd64, all processes are started directly, resulting in the subsequent execution of ./node-1.4.21.1-linux-amd64–core=1 --parent-process=xxx. The error panic: start: listen tcp4 127.0.0.1:40000: bind: address already in use.

I made sure my master node didn’t have anything running before, I even restarted the server.

When I execute ~/ceremonyclient/node/node-1.4.21.1-linux-amd64
on the master node, it will start all the cores of the current server.
oot@ecs-49577087-001:~# netstat -ap | grep 40001
tcp 0 0 localhost:40001 0.0.0.0:* LISTEN 3430/node-1.4.21.1-
root@ecs-49577087-001:~# netstat -ap | grep 40002
tcp 0 0 localhost:40002 0.0.0.0:* LISTEN 3406/node-1.4.21.1-
root@ecs-49577087-001:~# netstat -ap | grep 40003
tcp 0 0 localhost:40003 0.0.0.0:* LISTEN 3416/node-1.4.21.1-
root@ecs-49577087-001:~# netstat -ap | grep 40022
tcp 0 0 localhost:40022 0.0.0.0:* LISTEN 3577/node-1.4.21.1-

engine:
dataWorkerMultiaddrs: [
/ip4/192.168.0.4/tcp/40000,
/ip4/192.168.0.4/tcp/40001,
/ip4/192.168.0.4/tcp/40002,
/ip4/192.168.0.104/tcp/40003,
/ip4/192.168.0.104/tcp/40004,
/ip4/192.168.0.104/tcp/40005,
/ip4/192.168.0.104/tcp/40006
]
difficulty: 0

This is my config.yml, The slave node can start normally

Have you tried starting the slave workers first, then the master workers, then /node-1.4.21.1-linux-amd64? I ran into a similar but different issue if I tried to start the main process first. Starting the workers first allowed it to run.

you need to run pkill node-* or stop any services you are using.

The error message means you have another process listening on the port, so your previous attempts are being “reset” and need to be cleared before you start it again.

I will try it, thank you, but I remember it seems to report an error no parent process or similar error

As I said in the text, I have rebooted the server before starting the master node, and checked that there is no ‘node’ process, but when I execute the first step ‘~/ceremonyclient/node/node-1.4.21.1-linux-amd64’, it will start all the core working nodes

If I run --core1 on the master node first, I get an error message: ‘panic: parent process pid not specified’

this means your config is not properly formatted.

If your .engine.dataWorkerMultiaddrs field is an empty array it will throw that error if you don’t specify a --parent-process along with a --core.

Recheck your config.yml and make sure it’s properly formatted.

1 Like