Search code examples
beanstalkd

Start sending data to a different beanstalkd server


I have 2 servers with installed beanstalkd.

  • First server have ip 10.1.0.61
  • Second server have ip 10.1.0.62

Now I want to send job data to worker

  1. I created the job on the first server(61)
  2. The worker is running only on the second server(62)

To start beanstalkd on the first(61) server i run the command:

beanstalkd -l 10.1.0.62 -p 11300

On the second server(62) i run the command to start beanstalkd server with command:

beanstalkd -l 0.0.0.0 -p 11300

I get the error:

beanstalkd: net.c:125 in make_server_socket: bind(): Cannot assign requested address beanstalkd: main.c:64 in main: make_server_socket()

What am I doing wrong? I don't get it...


Solution

  • On the first server, with IP 10.1.0.61, you are trying to listen on an IP address that the server does not own.

    On the second server, you are listening on all the local IP addresses (0.0.0.0) that are available.

    If you know where the worker is running, when you send the job to Beanstalkd, you can arrange for your code to connect to the appropriate Beanstalkd daemon. How that is done depends on your client library.