简体   繁体   English

Nginx服务关闭时Pacemake无法故障转移

[英]Pacemake not failover when nginx service down

I have setup HA-Cluster for nginx. 我已经为nginx设置了HA-Cluster。 So when nginx or node fail, then it will failover to second node. 因此,当nginx或节点发生故障时,它将故障转移到第二个节点。

pcs status Cluster name: push_noti_cluster Stack: corosync Current DC: push2 (version 1.1.18-11.el7_5.3-2b07d5c5a9) - partition with quorum Last updated: Tue Jul 31 11:29:16 2018 Last change: Tue Jul 31 09:20:05 2018 by root via cibadmin on push1 pcs状态群集名称:push_noti_cluster堆栈:corosync当前DC:push2(版本1.1.18-11.el7_5.3-2b07d5c5a9)-具有仲裁的分区上次更新时间:2018年7月31日星期二11:29:16最后更改:09年7月31日星期二:20:05 2018通过root通过cibadmin在push1上

2 nodes configured 3 resources configured 配置2个节点配置3个资源

Online: [ push1 push2 ] 在线:[push1 push2]

Full list of resources: 完整资源清单:

virtual_ip (ocf::heartbeat:IPaddr2): Started push1 Clone Set: Nginx-clone [Nginx] Started: [ push1 push2 ] virtual_ip(ocf :: heartbeat:IPaddr2):已启动push1克隆集:Nginx-clone [Nginx]已启动:[push1 push2]

Daemon Status: corosync: active/enabled pacemaker: active/enabled pcsd: active/enabled You have new mail in /var/spool/mail/root [root@server1 ~]# 守护程序状态:corosync:启用/启用的起搏器:启用/启用的pcsd:启用/启用您在/ var / spool / mail / root中有新邮件[root @ server1〜]#

Failover work fine when we stop cluster service using pcs cluster stop on either of these nodes or rebooting the servers. 当我们在这些节点上使用pcs cluster stop停止集群服务或重新启动服务器时,故障转移工作正常。

What we want to achieve is to perform the resource failover when nginx on host node01 stop running and both the resources virtual_ip/webserver should failover to second host node02. 我们要实现的目标是在主机node01上的nginx停止运行并且两个资源virtual_ip / webserver应该都故障切换到第二个主机node02时执行资源故障切换。

Is it possible to do a service level failover? 是否可以进行服务级别的故障转移? Ie when one of resource fails in one node (node01), all the configured resources (here virtual_ip/webserver) should failover to other node (node02). 即,当一个节点(node01)中的一种资源发生故障时,所有已配置的资源(此处为virtual_ip / webserver)都应故障转移到另一节点(node02)。

From what you write, I see there is not configured that "active" node must be that node where present active nginx(any needed service). 从您写的内容来看,我没有配置“活动”节点必须是存在活动nginx(任何所需服务)的那个节点。

Try to check your configuration with examples from this site. 尝试使用此站点中的示例检查配置。 https://wiki.clusterlabs.org/wiki/Example_configurations#Failover_IP_.2B_One_service https://wiki.clusterlabs.org/wiki/Example_configurations#Failover_IP_.2B_One_service

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM