YanChii / ansible-role-postgres-ha

Create postgresql HA auto-failover cluster using pcs, pacemaker and PAF
Apache License 2.0
33 stars 22 forks source link

Gui and UDPU support #8

Closed frank3427 closed 6 years ago

frank3427 commented 7 years ago

Jan,

what do you think about adding support to enable GUI and option Unccast (UDPU) vs mutilcast (UDP).

frank

YanChii commented 7 years ago

Hi @frank3427, Honestly I've never done any of these things. If you tell me how can it be done (e.g. what commands need to be run or what to put into config files), I can add it. Alternatively, pull requests are also welcome ;). Thanks for your interest. Jan

frank3427 commented 6 years ago

did some playing around and on CentOS 6 if execute the following before enabling the cluster the following;

the cluster starts up in unicast mode vs multicast

frank3427 commented 6 years ago

to enable the GUI vi /etc/sysconfig/pcsd

change PCSD_DISABLE_GUI=true to PCSD_DISABLE_GUI=false

service pcsd restart you should now be able to get to the GUI vi https://(host or dns):2224 you will also need to open iptables top new port iptables -I INPUT -p tcp --dport 2224 -m state --state NEW,ESTABLISHED -j ACCEPT

this only needs to be done on one host to manage the cluster vi the GUI

YanChii commented 6 years ago

Hi @frank3427 Thank you for the inputs, I'll add the enable_gui and enable_multicast options. It would be useful however to know how to enable multicast also on centos 7. If you don't know, I'll have to figure it out (consumes time, delays the result).

frank3427 commented 6 years ago

look at a few doc's ; here is an example for centos 7 pcs cluster setup --name demo node1-A node2-A \ --transport udp \ --addr0 10.70.0.0

both host must be on the same subnet, the --addr0 is the network address of the hosts. that means if the hosts ip addresses are 172.20.5.10/04 and 172.20.5.50/24 the network address to be used in --addr0 is 172.20.5.0

frank3427 commented 6 years ago

this example defines the a few more option, like mcast address and the mcast port for the cluster .

pcs cluster setup --name demo-MDS-1-2 \ rh7z-mds1.lfs.intl rh7z-mds2.lfs.intl \ --transport udp \ --rrpmode passive \ --token 20000 \ --addr0 10.70.0.0 \ --mcast0 239.255.1.1 --mcastport0 49152 \

The multicast addresses default to 239.255.1.1 for ring0 and 255.239.2.1 for ring1. The default multicast port is 5405 for both multicast rings.

YanChii commented 6 years ago

Hi @frank3427 I've pushed new features into the multicast branch. You can test it. If it works also for you, I'll integrate them. See new config parameters here https://github.com/YanChii/ansible-role-postgres-ha/blob/multicast/defaults/main.yml#L41 Jan