优先考虑 gearman 作业服务器?

发布于 2024-08-24 13:05:30 字数 312 浏览 1 评论 0原文

我有两台机器运行相同的工人。一台机器应该是“主”机器,因为它非常强大,而另一台机器应该作为主机器出现故障或崩溃时的备份。当主机启动并运行时,只要有可用的工作人员,所有作业都应默认在主机上进行。

从我的测试中,我注意到 gearmanD 随机选择一台机器来发送作业。有什么办法可以优先考虑向其发送作业的机器吗?

示例:

主机器运行同一工作线程的 8 个实例 备份机器运行 1 个实例

执行以下操作: 使用主机,直到没有更多可用的工作人员来填满作业队列,然后继续使用备用机器。

有什么方法可以实现这一点吗?

谢谢大家!

I have 2 machines running same workers. One machine shoud be "primary" as it is very powerful, and the other machine should server as a backup for when primary machine goes down or crashes. When primary machine is up and running, all jobs should default to the primary machine for as long as there are available workers.

From my tests, I've noticed that gearmanD randomly picks a machine to send the job to. Is there any way at all to prioritize the machines to send jobs to?

Example:

Primary machine running 8 instasnces of the same worker
Backup machine running 1 instance

Do:
Use primary machine until it no more available workers are there to fullfill the job queue, then continue onto backup machine.

Any way of accomplishing this?

Thanks everyone!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苦行僧 2024-08-31 13:05:30

我认为当前的 API 不可能实现这一点。不过,您可以运行 2 个 gearmand,每个工作服务器上运行一个,并将它们都设置在客户端(功能强大的机器的第一个)中。这样,至少我所知道的客户端 API 的当前版本将首先使用第一个 gearmand 及其工作人员,如果该设备不可用,它将切换到第二个,后者具有功能较弱的机器工作人员。 。

I don't think this is possible with the current API. You could run 2 gearmand's though, one on each of your worker servers and set them both in the client, the powerful machine's first. This way, at least current versions of the client APIs I'm aware of, will first use the first gearmand and its workers and if that isn't available, it will switch to the second, which has the less powerful machine's workers...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文