This page covers common configuration steps for Gearman deployments.
| File | Purpose | Location |
|---|---|---|
/etc/default/gearman-job-server |
Service configuration | Debian/Ubuntu |
/etc/sysconfig/gearmand |
Service configuration | RHEL/CentOS |
Edit /etc/default/gearman-job-server:
# Start gearman
START=yes
# Listen address and port
GEARMAN_OPTS="-L 0.0.0.0 -p 4730"
# Run as user
USER=gearman
# Log file
LOGFILE=/var/log/gearman-job-server.log
# Log level (LOG_DEBUG, LOG_INFO, LOG_WARN, LOG_ERROR)
LOGLEVEL=LOG_INFO
| Option | Description |
|---|---|
-p PORT |
Listen port (default: 4730) |
-L ADDR |
Listen address |
-u USER |
Run as user |
-l FILE |
Log file |
-d |
Run as daemon |
-t THREADS |
Number of worker threads |
-q QUEUE |
Queue name for persistent queues |
gearmand -L 0.0.0.0 -p 4730 -t 10 -l /var/log/gearmand.log
Restart Gearman after configuration changes:
sudo systemctl restart gearman-job-server
sudo systemctl restart gearmand
# Check service status
sudo systemctl status gearman-job-server
# Check version
gearmand --version
# Test connection
echo "version" | nc localhost 4730
# Start a simple worker (echo service)
gearman -w -f reverse -- wc
# Submit a job
gearman -f reverse "hello world"