Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

start redis with supervisor

When start redis with supervisor, the redis process is running, but in supervisor it shows backoff.

vagrant@jinming:~$ sudo supervisorctl -c /etc/conf/supervisor/supervisord.conf
redis                            BACKOFF   Exited too quickly (process log may have details)

in supervisor log, it shows below:

2015-06-09 07:09:28,407 CRIT Supervisor running as root (no user in config file)
2015-06-09 07:09:28,407 WARN Included extra file "/etc/conf/supervisor/conf.d/redis_local.conf" during parsing
2015-06-09 07:09:28,407 INFO RPC interface 'supervisor' initialized
2015-06-09 07:09:28,407 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-06-09 07:09:28,407 INFO supervisord started with pid 23191
2015-06-09 07:09:29,410 INFO spawned: 'redis' with pid 23332
2015-06-09 07:09:29,416 INFO exited: redis (exit status 0; not expected)
2015-06-09 07:09:30,418 INFO spawned: 'redis' with pid 23334
2015-06-09 07:09:30,425 INFO exited: redis (exit status 0; not expected)
2015-06-09 07:09:32,429 INFO spawned: 'redis' with pid 23336  
2015-06-09 07:09:32,434 INFO exited: redis (exit status 0; not expected)
2015-06-09 07:09:36,067 INFO spawned: 'redis' with pid 23342
2015-06-09 07:09:36,072 INFO exited: redis (exit status 0; not expected)
2015-06-09 07:09:37,073 INFO gave up: redis entered FATAL state, too many start retries too quickly
2015-06-09 07:11:04,079 CRIT Supervisor running as root (no user in config file)
2015-06-09 07:11:04,079 WARN Included extra file "/etc/conf/supervisor/conf.d/redis_local.conf" during parsing
2015-06-09 07:11:04,080 INFO RPC interface 'supervisor' initialized
2015-06-09 07:11:04,080 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2015-06-09 07:11:04,080 INFO supervisord started with pid 23191
2015-06-09 07:11:05,083 INFO spawned: 'redis' with pid 23486
2015-06-09 07:11:05,089 INFO exited: redis (exit status 0; not expected)

anyone can help me, thanks.

like image 858
zimmer Avatar asked Jun 09 '15 07:06

zimmer


People also ask

How do I automatically start Redis?

Enable Redis to Start at Boot If all of your tests worked, and you would like to start Redis automatically when your server boots, you can enable the systemd service. To do so, type: sudo systemctl enable redis.

How do I configure Redis?

You can obtain a list of all the supported configuration parameters by typing CONFIG GET * in an open redis-cli prompt. All the supported parameters have the same meaning of the equivalent configuration parameter used in the redis.


1 Answers

When using Supervisord to manage server programs like databases that often spawn or daemonize, look for a flag in the startup command or in the config file. There is an exception with databases like MySQL where recommended practice is to use a proxy to start mysqld_safe and let it manage the sub processes.

In redis.conf for newer versions (i.e. 3.x) the default is to disable daemon but it may have been edited by your package. Also be sure you didn't install with an upstart script that will respawn.

Redis config file section

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize no

Example Supervisor configs

  • https://gist.github.com/ehazlett/1817619
  • https://github.com/calvdee/docker-redis/blob/master/supervisord.conf
like image 159
Mike S. Avatar answered Nov 03 '22 08:11

Mike S.