gearman is a good thingpython
gearman client --------------> gearman server <------------------------gearman workersql
clients are requesting to handler something, django
gearman server is delivering jobsbash
gearman workers get some jobs and finish.markdown
So different programming languages can work together.post
Now we need to plant gearman persistent queues on postgresql.this
So.spa
Nowpostgresql
bash sudo pip install gearman && sudo apt-get install gearman -y
sudo su - postgres # Then, psql # Then CREATE DATABASE gearman; CREATE USER gearman with password gearman_password_123; GRANT ALL PRIVILEGES ON DATABASE gearman to gearman;
On a server:
To get Postgresql working you need to use the -q Postgeres command line option.code
Below is a command line to get persistent queues working with Postgresql. This command line was run on Ubuntu 12.04 server, Postgresql version 9.1, and Gearman v 0.27.
gearmand -L 127.0.0.1 –libpq-conninfo 'hostaddr=127.0.0.1 port=5432 dbname=gearman user=gearman password=gearman_password_123' –libpq-table=gearmanqueue1 –verbose DEBUG -q Postgres
/var/log/gearman-job-server/gearman.log
for log if error or somehow./etc/default/gearman_job_server
and make sure it would look like this:export PGHOST=127.0.0.1 export PGPORT=5432 export PGUSER=gearman export PGPASSWORD=gearman_password_123 export PGDATABASE=gearman PARAMS="-q Postgres --libpq-table=gearmanqueue1 --verbose DEBUG"
bash sudo service gearman-job-server start
, gearman will auto-matically create a table 'gearmanqueue1' there.