0

Follow this guide to do PostgreSQL Automatic Failover:

https://dalibo.github.io/PAF/Quick_Start-CentOS-7.html

At this step:

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

What I edited:

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

Got error:

[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

There is not this IP: 192.168.33.1, but exist 192.168.33.111.

I think the port means PostgreSQL's port, changed it to 5432. Maybe not that meaning. So what's the right meaning?

Where was wrong?

1

Did you install the fence-agents package? That would provide you with the fence_virsh binary that pcs is complaining isn't there.

1
  • After I install it again yum install -y fence-agents-virsh, it seems good. Strange. Thank you. Jul 28 '17 at 1:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.