按照本指南执行 PostgreSQL 自动故障转移:
https://dalibo.github.io/PAF/Quick_Start-CentOS-7.html
在这一步:
pcs -f cluster1.xml stonith create fence_vm_srv1 fence_virsh pcmk_host_check="static-list" pcmk_host_list="srv1" ipaddr="192.168.122.1" login="<username>" port="srv1-c7" action="off" identity_file="/root/.ssh/id_rsa"
pcs -f cluster1.xml stonith create fence_vm_srv2 fence_virsh pcmk_host_check="static-list" pcmk_host_list="srv2" ipaddr="192.168.122.1" login="<username>" port="srv2-c7" action="off" identity_file="/root/.ssh/id_rsa"
pcs -f cluster1.xml stonith create fence_vm_srv3 fence_virsh pcmk_host_check="static-list" pcmk_host_list="srv3" ipaddr="192.168.122.1" login="<username>" port="srv3-c7" action="off" identity_file="/root/.ssh/id_rsa"
pcs -f cluster1.xml constraint location fence_vm_srv1 avoids srv1=INFINITY
pcs -f cluster1.xml constraint location fence_vm_srv2 avoids srv2=INFINITY
pcs -f cluster1.xml constraint location fence_vm_srv3 avoids srv3=INFINITY
我编辑的内容:
pcs -f cluster1.xml stonith create fence_vm_node1 fence_virsh pcmk_host_check="static-list" pcmk_host_list="node1" ipaddr="192.168.33.1" login="root" port="5432" action="off" identity_file="/root/.ssh/id_rsa"
pcs -f cluster1.xml stonith create fence_vm_node2 fence_virsh pcmk_host_check="static-list" pcmk_host_list="node2" ipaddr="192.168.33.1" login="root" port="5432" action="off" identity_file="/root/.ssh/id_rsa"
pcs -f cluster1.xml constraint location fence_vm_node1 avoids node1=INFINITY
pcs -f cluster1.xml constraint location fence_vm_node2 avoids node2=INFINITY
出现错误:
[root@node1 ~]# pcs -f cluster1.xml stonith create fence_vm_node1 fence_virsh pcmk_host_check="static-list" pcmk_host_list="node1" ipaddr="192.168.33.1" login="root" port="5432" action="off" identity_file="/root/.ssh/id_rsa"
Error: Agent 'fence_virsh' not found, use --force to override
[root@node1 ~]# pcs -f cluster1.xml stonith create fence_vm_node2 fence_virsh pcmk_host_check="static-list" pcmk_host_list="node2" ipaddr="192.168.33.1" login="root" port="5432" action="off" identity_file="/root/.ssh/id_rsa"
Error: Agent 'fence_virsh' not found, use --force to override
[root@node1 ~]# pcs -f cluster1.xml constraint location fence_vm_node1 avoids node1=INFINITY
Error: Resource 'fence_vm_node1' does not exist
[root@node1 ~]# pcs -f cluster1.xml constraint location fence_vm_node2 avoids node2=INFINITY
Error: Resource 'fence_vm_node2' does not exist
没有这个 IP: 192.168.33.1
,但存在192.168.33.111
。
我认为port
PostgreSQL 的端口,将其更改为5432
. 也许不是那个意思。那么正确的含义是什么?
哪里错了?
你安装
fence-agents
包了吗?那将为您提供抱怨不存在的fence_virsh
二进制文件。pcs