Re: Timeout occurred when calling bind

Skip to first unread message

Edward J. Sabol

May 10, 2018, 2:45:26 PM5/10/18
On May 9, 2018, at 8:16 PM, Bashar Al Masri <> wrote:
> First of all i searched the this group , and nothing worked with me !
> I installed gearmand 1.1.18 on my centos7.

FWIW, I use gearmand 1.1.18 on CentOS 7.4 all the time (and before that on CentOS 7.2 and 7.3) without problems.

You didn't say how you installed it. Did you compile from source or did you install an rpm with yum?

I compiled from source downloaded from

> and here is my conf file

Sorry, where did you put this conf file? The only conf file I use with gearmand is a supervisord conf file, and the syntax doesn't look anything like this.

I also don't specify the "--listen" option or use mysql. I really doubt you need to specify "--listen". May I suggest starting with the basics first and seeing if that works? Remove the conf file and just start it like this:

% /path/to/gearmand &

> --listen
> --queue-type=mysql
> --mysql-host localhost
> --mysql-port 3306
> --mysql-user mysql_user
> --mysql-password password
> --mysql-db db_name
> --mysql-table gearman_queue
> --log-file=/output/gearmand.log
> --daemon

I don't know if it matters or not, but I note that some of the options in your "conf file" have equal signs ("=") after them and some do not. Perhaps you need to be consistent and replace the equal signs with spaces?

> nothing in /output/gearmand.log

Are you sure the user executing gearmand has the permissions to write to /output/gearmand.log?

> Problems start when i add gearmand to supervisor :

My supervisord conf file for gearmand (which should be located at /etc/supervisor/conf.d/gearmand.conf) looks something like this:

user = gearman
priority = 100
command = /sbin/gearmand --port 4730 --verbose INFO -l /var/log/gearmand.log
redirect_stderr = true
stdout_logfile = /var/log/gearmand-supervisor.log
stdout_logfile_maxbytes = 10MB
stdout_logfile_backups = 5
startsecs = 5
autorestart = true

I don't recommend running gearmand as root, so I specify "user = gearman".
# useradd -r -g supervisor gearman

Make sure /var/log/gearmand.log and /var/log/gearmand-supervisor.log are created first and both are owned by the gearman user.
# touch /var/log/gearmand.log /var/log/gearmand-supervisor.log && chown gearman:root /var/log/gearmand.log /var/log/gearmand-supervisor.log

You do NOT want supervisord to start gearmand with --daemon. Supervisord takes care of that for you. That's probably part of the problem you are seeing!

The log file you sent shows that bind is failing because the port is already in use. I don't know what that could be from. A previous attempt perhaps that's still running?

What does the output of "lsof -i :4730" say?

How about trying a different port? /path/to/gearmand --port 47300

If that doesn't work, try rebooting.

Also, CentOS 7.x uses firewalld by default, so make sure you know how to configure that properly or disable it.

Hoping this helps,

Алексей Пастухов

May 11, 2018, 2:32:29 AM5/11/18

On 10 May 2018 at 02:16, Bashar Al Masri <> wrote:
supervisor keep restarting the service, and i can see in the "" , and once i looked to the "/output/gearman_start.log" i found tons of 

Timeout occurred when calling bind() for -> libgearman-server/

Ps: i tried --listen , same problem 

But the strange thing :

nc -z localhost 4730
Connection to localhost 4730 port [tcp/gearman] succeeded!

nc succeeds if you have a running gearmand instance. (or some other daemon listening on 4730)
Timeout occurs because the 4730 is in occupied already.
Reply all
Reply to author
0 new messages