<div dir="ltr">Hi, <div><br></div><div>Thanks for your help, I use the same example. In this case Kamailio need to start after postgresql. But this is not a problem I think, the replication work ok without corosync. I stop all process and start to work with corosync. </div>
<div><br></div><div>When I start corosync I see this log in my slave:</div><div><br></div><div><div>Sep 12 16:12:50 slave pgsql(pgsql)[26092]: INFO: Master does not exist.</div><div>Sep 12 16:12:50 slave pgsql(pgsql)[26092]: WARNING: My data is out-of-date. status=DISCONNECT</div>
<div><br></div></div><div>But all data is the same, and If I run the slave server with normal postgres the replication is ok. Any idea?</div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/9/12 Takatoshi MATSUO <span dir="ltr"><<a href="mailto:matsuo.tak@gmail.com" target="_blank">matsuo.tak@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Eloy<br>
<br>
<br>
2013/9/12 Eloy Coto Pereiro <<a href="mailto:eloy.coto@gmail.com">eloy.coto@gmail.com</a>>:<br>
> Hi,<br>
><br>
<div><div class="h5">> I have issues with this config, for example when master is running corosync<br>
> service use pg_ctl. But in the slave pg_ctl doesn't start and replication<br>
> doesn't work.<br>
><br>
> This is my data:<br>
><br>
><br>
> Online: [ master slave ]<br>
> OFFLINE: [ ]<br>
><br>
> Full list of resources:<br>
><br>
> ClusterIP (ocf::heartbeat:IPaddr2): Started master<br>
> KAMAILIO (lsb:kamailio): Started master<br>
> Master/Slave Set: msPostgresql [pgsql]<br>
> Masters: [ master ]<br>
> Stopped: [ pgsql:1 ]<br>
><br>
> Node Attributes:<br>
> * Node master:<br>
> + maintenance : off<br>
> + master-pgsql : 1000<br>
> + pgsql-data-status : LATEST<br>
> + pgsql-master-baseline : 0000000019000080<br>
> + pgsql-status : PRI<br>
> * Node slave:<br>
> + pgsql-data-status : DISCONNECT<br>
> + pgsql-status : HS:sync<br>
><br>
><br>
> In my crm configure show is this:<br>
> node master \<br>
> attributes maintenance="off" pgsql-data-status="LATEST"<br>
> node slave \<br>
> attributes pgsql-data-status="DISCONNECT"<br>
> primitive ClusterIP ocf:heartbeat:IPaddr2 \<br>
> params ip="10.1.1.1" cidr_netmask="24" \<br>
> op monitor interval="15s" \<br>
> op start timeout="60s" interval="0s" on-fail="stop" \<br>
> op monitor timeout="60s" interval="10s" on-fail="restart" \<br>
> op stop timeout="60s" interval="0s" on-fail="block"<br>
> primitive KAMAILIO lsb:kamailio \<br>
> op monitor interval="10s" \<br>
> op start interval="0" timeout="120s" \<br>
> op stop interval="0" timeout="120s" \<br>
> meta target-role="Started"<br>
> primitive pgsql ocf:heartbeat:pgsql \<br>
> params pgctl="/usr/pgsql-9.2/bin/pg_ctl" psql="/usr/pgsql-9.2/bin/psql"<br>
> pgdata="/var/lib/pgsql/9.2/data/" rep_mode="sync" node_list="master slave"<br>
> restore_command="cp /var/lib/pgsql/9.2/pg_archive/%f %p"<br>
> primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5<br>
> keepalives_count=5" master_ip="10.1.1.1" restart_on_promote="true" \<br>
> op start timeout="60s" interval="0s" on-fail="restart" \<br>
> op monitor timeout="60s" interval="4s" on-fail="restart" \<br>
> op monitor timeout="60s" interval="3s" on-fail="restart" role="Master" \<br>
> op promote timeout="60s" interval="0s" on-fail="restart" \<br>
> op demote timeout="60s" interval="0s" on-fail="stop" \<br>
> op stop timeout="60s" interval="0s" on-fail="block" \<br>
> op notify timeout="60s" interval="0s"<br>
> ms msPostgresql pgsql \<br>
> meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1"<br>
> notify="true" target-role="Started"<br>
> location cli-prefer-KAMAILIO KAMAILIO \<br>
> rule $id="cli-prefer-rule-KAMAILIO" inf: #uname eq master<br>
> location cli-prefer-pgsql msPostgresql \<br>
> rule $id="cli-prefer-rule-pgsql" inf: #uname eq master<br>
> location cli-standby-ClusterIP ClusterIP \<br>
> rule $id="cli-standby-rule-ClusterIP" -inf: #uname eq slave<br>
<br>
</div></div>This location is invalid.<br>
It means that ClusterIP can't run on slave.<br>
<div class="im"><br>
> colocation colocation-1 inf: ClusterIP msPostgresql KAMAILIO<br>
<br>
</div>PostgreSQL needs KAMAILIO to start ?<br>
It means that Pacemaker can't start PostgreSQL on slave.<br>
<br>
Sample setting is<br>
colocation rsc_colocation-1 inf: master-group msPostgresql:Master<br>
<br>
At the very beginning, you might want to customize sample settings.<br>
<a href="http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster#sample_settings_for_crm_command" target="_blank">http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster#sample_settings_for_crm_command</a><br>
<br>
And please see logs because pgsql RA outputs some useful logs.<br>
<div class="HOEnZb"><div class="h5"><br>
> order order-1 inf: ClusterIP msPostgresql KAMAILIO<br>
> property $id="cib-bootstrap-options" \<br>
> dc-version="1.1.8-7.el6-394e906" \<br>
> cluster-infrastructure="classic openais (with plugin)" \<br>
> expected-quorum-votes="2" \<br>
> stonith-enabled="false"<br>
><br>
> Any idea why doesn't start on the second slave?<br>
><br>
> More info:<br>
><br>
> Master:<br>
><br>
> root@master ~]# netstat -putan | grep 5432 | grep LISTEN<br>
> tcp 0 0 <a href="http://0.0.0.0:5432" target="_blank">0.0.0.0:5432</a> 0.0.0.0:*<br>
> LISTEN 3241/postgres<br>
> tcp 0 0 :::5432 :::*<br>
> LISTEN 3241/postgres<br>
> [root@master ~]# ps axu | grep postgres<br>
> postgres 3241 0.0 0.0 97072 7692 ? S 11:41 0:00<br>
> /usr/pgsql-9.2/bin/postgres -D /var/lib/pgsql/9.2/data -c<br>
> config_file=/var/lib/pgsql/9.2/data//postgresql.conf<br>
> postgres 3293 0.0 0.0 97072 1556 ? Ss 11:41 0:00 postgres:<br>
> checkpointer process<br>
> postgres 3294 0.0 0.0 97072 1600 ? Ss 11:41 0:00 postgres:<br>
> writer process<br>
> postgres 3295 0.0 0.0 97072 1516 ? Ss 11:41 0:00 postgres:<br>
> wal writer process<br>
> postgres 3296 0.0 0.0 97920 2760 ? Ss 11:41 0:00 postgres:<br>
> autovacuum launcher process<br>
> postgres 3297 0.0 0.0 82712 1500 ? Ss 11:41 0:00 postgres:<br>
> archiver process failed on 000000010000000000000001<br>
> postgres 3298 0.0 0.0 82872 1568 ? Ss 11:41 0:00 postgres:<br>
> stats collector process<br>
> root 10901 0.0 0.0 103232 852 pts/0 S+ 11:44 0:00 grep<br>
> postgres<br>
><br>
><br>
> On slave:<br>
><br>
> [root@slave ~]# ps axu | grep postgre<br>
> root 3332 0.0 0.0 103232 856 pts/0 S+ 11:45 0:00 grep<br>
> postgre<br>
> [root@slave ~]# netstat -putan | grep 5432<br>
> [root@slave ~]#<br>
><br>
><br>
> If I make pg_ctl /var/lib/pgsql/9.2/data/ start work ok<br>
><br>
> Any idea?<br>
><br>
><br>
> 2013/9/11 Takatoshi MATSUO <<a href="mailto:matsuo.tak@gmail.com">matsuo.tak@gmail.com</a>><br>
>><br>
>> Hi Eloy<br>
>><br>
>> Please see <a href="http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster" target="_blank">http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster</a> .<br>
>> In the document, it uses virtual IP to receive connection,<br>
>> so it doesn't need to change recovery.conf.<br>
>><br>
>> Thanks,<br>
>> Takatoshi MATSUO<br>
>><br>
>><br>
>> 2013/9/11 Eloy Coto Pereiro <<a href="mailto:eloy.coto@gmail.com">eloy.coto@gmail.com</a>>:<br>
>> > Hi,<br>
>> ><br>
>> > In Postgresql if you use wal replication<br>
>> > <<a href="http://wiki.postgresql.org/wiki/Streaming_Replication" target="_blank">http://wiki.postgresql.org/wiki/Streaming_Replication</a>> when the master<br>
>> > servers fails need to change the recovery.conf on the slave server.<br>
>> ><br>
>> > In this case any tool, when the master is down, execute a command and<br>
>> > get<br>
>> > this info?<br>
>> > Is this the right tool for postgresql's replication?<br>
>> ><br>
>> > Cheers<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
</div></div></blockquote></div><br></div>