D
D
Djadka Maxho2017-03-03 12:16:24
PHP
Djadka Maxho, 2017-03-03 12:16:24

How to configure Gearman on MySQL so that it constantly picks up tasks from the queue?

Hello. Installed version Gearman 1.1.3. Configured Daemon start on the path /etc/init/gearman-job-server.conf

exec start-stop-daemon --start --chuid gearman --exec /usr/sbin/gearmand -- --log-file=/var/log/gearman-job-server/gearman.log \
        --queue-type=MySQL --mysql-host=localhost --mysql-port=3306 \
        --mysql-user=user --mysql-password=password \
        --mysql-db=test --mysql-table=gearman_queue

Created a table in the database. Added tasks there, restarted the daemon, launched the worker
$worker= new GearmanWorker();
$worker->addServer("localhost",4730);

$worker->addFunction("test", function(GearmanJob $job) {
   //do something
});
, the tasks were completed in the table, the data was rubbed, everything is ok. BUT if I add tasks to the list in the table, they are no longer taken from the table, I launch the task directly, everything is ok. If I restart the daemon, then the tasks are picked up again. What am I doing wrong? How to set up the daemon in such a way that it checks the queue table?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexzzzzzzzz, 2017-03-10
@Alexzzzzzzzz

You need a
circus process manager - https://circus.readthedocs.io/en/latest
supervisor- supervisord.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question