gearman failover

转载 2013年12月05日 22:11:20

From gearman's main page, they mention running with multiple job servers so if a job server dies, the clients can pick up a new job server. Given the statement and diagram below, it seems that the job servers do not communicate with each other.

Our question is what happens to those jobs that are queued in the job server that died? What is the best practice to have high-availability for these servers to make sure jobs aren't interrupted in a failure?

You are able to run multiple job servers and have the clients and workers connect to the first available job server they are configured with. This way if one job server dies, clients and workers automatically fail over to another job server. You probably don't want to run too many job servers, but having two or three is a good idea for redundancy.

enter image description here


share|improve this question
add comment

As far as I know there is no proper way to handle this at the moment, but as long as you run both job servers with permanent queues (using MySQL or another datastore - just don't use the same actual queue for both servers), you can simply restart the job server and it'll load its queue from the database. This will allow all the queued tasks to be submitted to available workers, even after the server has died.

There is however no automagical way of doing this when a job server goes down, so if both the job server and the datastore goes down (a server running both locally goes down) will leave the tasks in limbo until it gets back online.

The permanent queue is only read on startup (and inserted / deleted from as tasks are submitted and completed).

I'm not sure about the complexity required to add such functionality to gearmand and whether it's actually wanted, but simple "task added, task handed out, task completed"-notifications between servers shouldn't been too complicated to handle.


gearman 文档

  • 2010年01月04日 13:01
  • 1.72MB
  • 下载

gearman安装包 rpm

  • 2014年08月20日 10:29
  • 10.09MB
  • 下载

通过Keepalived实现Redis Failover自动故障切换功能

详细可参考 设计思路: redis 主和 redis从  正常同步; redis主keepalived 启动,执行...
  • qingrx
  • qingrx
  • 2013年06月21日 16:44
  • 4008


  • 2017年11月17日 11:07
  • 159KB
  • 下载


  • 2011年05月27日 00:37
  • 27KB
  • 下载

failover 故障检测、报警、自动切换 程序 用于对web server (Nginx) 监测与故障处理

 前言前几天,群里有人说用shell程序实现failover,所以今天自己写一个shell程序 failover,fault  detection and  swi...

java-gearman-service jar

  • 2016年07月12日 11:16
  • 188KB
  • 下载


  • 2013年02月25日 16:52
  • 29KB
  • 下载

The Failover Transport(失败故障转移传输)

失败故障转移传输层会重新连接的任何其他已经配置好的传输之上的可用逻辑节点。 故障转移配置语法,可以指定任意数量的复合的URI。故障转移运输随机选择复合URI之一,并尝试连接的建立。如果没有成功,或者...
  • varyall
  • varyall
  • 2015年11月07日 16:58
  • 804

4G LTE Failover

  • 2017年08月18日 18:54
  • 470KB
  • 下载
您举报文章:gearman failover