<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">&lt;<a href="mailto:matsuo.tak@gmail.com" target="_blank">matsuo.tak@gmail.com</a>&gt;</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 &lt;<a href="mailto:eloy.coto@gmail.com">eloy.coto@gmail.com</a>&gt;:<br>
&gt; Hi,<br>
&gt;<br>
<div><div class="h5">&gt; I have issues with this config, for example when master is running corosync<br>
&gt; service use pg_ctl. But in the slave pg_ctl doesn&#39;t start and replication<br>
&gt; doesn&#39;t work.<br>
&gt;<br>
&gt; This is my data:<br>
&gt;<br>
&gt;<br>
&gt; Online: [ master slave ]<br>
&gt; OFFLINE: [ ]<br>
&gt;<br>
&gt; Full list of resources:<br>
&gt;<br>
&gt; ClusterIP (ocf::heartbeat:IPaddr2): Started master<br>
&gt; KAMAILIO        (lsb:kamailio): Started master<br>
&gt;  Master/Slave Set: msPostgresql [pgsql]<br>
&gt;      Masters: [ master ]<br>
&gt;      Stopped: [ pgsql:1 ]<br>
&gt;<br>
&gt; Node Attributes:<br>
&gt; * Node master:<br>
&gt;     + maintenance                       : off<br>
&gt;     + master-pgsql                      : 1000<br>
&gt;     + pgsql-data-status                 : LATEST<br>
&gt;     + pgsql-master-baseline             : 0000000019000080<br>
&gt;     + pgsql-status                      : PRI<br>
&gt; * Node slave:<br>
&gt;     + pgsql-data-status                 : DISCONNECT<br>
&gt;     + pgsql-status                      : HS:sync<br>
&gt;<br>
&gt;<br>
&gt; In my crm configure show is this:<br>
&gt; node master \<br>
&gt; attributes maintenance=&quot;off&quot; pgsql-data-status=&quot;LATEST&quot;<br>
&gt; node slave \<br>
&gt; attributes pgsql-data-status=&quot;DISCONNECT&quot;<br>
&gt; primitive ClusterIP ocf:heartbeat:IPaddr2 \<br>
&gt; params ip=&quot;10.1.1.1&quot; cidr_netmask=&quot;24&quot; \<br>
&gt; op monitor interval=&quot;15s&quot; \<br>
&gt; op start timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;stop&quot; \<br>
&gt; op monitor timeout=&quot;60s&quot; interval=&quot;10s&quot; on-fail=&quot;restart&quot; \<br>
&gt; op stop timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;block&quot;<br>
&gt; primitive KAMAILIO lsb:kamailio \<br>
&gt; op monitor interval=&quot;10s&quot; \<br>
&gt; op start interval=&quot;0&quot; timeout=&quot;120s&quot; \<br>
&gt; op stop interval=&quot;0&quot; timeout=&quot;120s&quot; \<br>
&gt; meta target-role=&quot;Started&quot;<br>
&gt; primitive pgsql ocf:heartbeat:pgsql \<br>
&gt; params pgctl=&quot;/usr/pgsql-9.2/bin/pg_ctl&quot; psql=&quot;/usr/pgsql-9.2/bin/psql&quot;<br>
&gt; pgdata=&quot;/var/lib/pgsql/9.2/data/&quot; rep_mode=&quot;sync&quot; node_list=&quot;master slave&quot;<br>
&gt; restore_command=&quot;cp /var/lib/pgsql/9.2/pg_archive/%f %p&quot;<br>
&gt; primary_conninfo_opt=&quot;keepalives_idle=60 keepalives_interval=5<br>
&gt; keepalives_count=5&quot; master_ip=&quot;10.1.1.1&quot; restart_on_promote=&quot;true&quot; \<br>
&gt; op start timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;restart&quot; \<br>
&gt; op monitor timeout=&quot;60s&quot; interval=&quot;4s&quot; on-fail=&quot;restart&quot; \<br>
&gt; op monitor timeout=&quot;60s&quot; interval=&quot;3s&quot; on-fail=&quot;restart&quot; role=&quot;Master&quot; \<br>
&gt; op promote timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;restart&quot; \<br>
&gt; op demote timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;stop&quot; \<br>
&gt; op stop timeout=&quot;60s&quot; interval=&quot;0s&quot; on-fail=&quot;block&quot; \<br>
&gt; op notify timeout=&quot;60s&quot; interval=&quot;0s&quot;<br>
&gt; ms msPostgresql pgsql \<br>
&gt; meta master-max=&quot;1&quot; master-node-max=&quot;1&quot; clone-max=&quot;2&quot; clone-node-max=&quot;1&quot;<br>
&gt; notify=&quot;true&quot; target-role=&quot;Started&quot;<br>
&gt; location cli-prefer-KAMAILIO KAMAILIO \<br>
&gt; rule $id=&quot;cli-prefer-rule-KAMAILIO&quot; inf: #uname eq master<br>
&gt; location cli-prefer-pgsql msPostgresql \<br>
&gt; rule $id=&quot;cli-prefer-rule-pgsql&quot; inf: #uname eq master<br>
&gt; location cli-standby-ClusterIP ClusterIP \<br>
&gt; rule $id=&quot;cli-standby-rule-ClusterIP&quot; -inf: #uname eq slave<br>
<br>
</div></div>This location is invalid.<br>
It means that ClusterIP can&#39;t run on slave.<br>
<div class="im"><br>
&gt; colocation colocation-1 inf: ClusterIP msPostgresql KAMAILIO<br>
<br>
</div>PostgreSQL needs KAMAILIO to start ?<br>
It means that Pacemaker can&#39;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>
&gt; order order-1 inf: ClusterIP msPostgresql KAMAILIO<br>
&gt; property $id=&quot;cib-bootstrap-options&quot; \<br>
&gt; dc-version=&quot;1.1.8-7.el6-394e906&quot; \<br>
&gt; cluster-infrastructure=&quot;classic openais (with plugin)&quot; \<br>
&gt; expected-quorum-votes=&quot;2&quot; \<br>
&gt; stonith-enabled=&quot;false&quot;<br>
&gt;<br>
&gt; Any idea why doesn&#39;t start on the second slave?<br>
&gt;<br>
&gt; More info:<br>
&gt;<br>
&gt; Master:<br>
&gt;<br>
&gt; root@master ~]# netstat -putan | grep 5432 | grep LISTEN<br>
&gt; tcp        0      0 <a href="http://0.0.0.0:5432" target="_blank">0.0.0.0:5432</a>                0.0.0.0:*<br>
&gt; LISTEN      3241/postgres<br>
&gt; tcp        0      0 :::5432                     :::*<br>
&gt; LISTEN      3241/postgres<br>
&gt; [root@master ~]# ps axu | grep postgres<br>
&gt; postgres  3241  0.0  0.0  97072  7692 ?        S    11:41   0:00<br>
&gt; /usr/pgsql-9.2/bin/postgres -D /var/lib/pgsql/9.2/data -c<br>
&gt; config_file=/var/lib/pgsql/9.2/data//postgresql.conf<br>
&gt; postgres  3293  0.0  0.0  97072  1556 ?        Ss   11:41   0:00 postgres:<br>
&gt; checkpointer process<br>
&gt; postgres  3294  0.0  0.0  97072  1600 ?        Ss   11:41   0:00 postgres:<br>
&gt; writer process<br>
&gt; postgres  3295  0.0  0.0  97072  1516 ?        Ss   11:41   0:00 postgres:<br>
&gt; wal writer process<br>
&gt; postgres  3296  0.0  0.0  97920  2760 ?        Ss   11:41   0:00 postgres:<br>
&gt; autovacuum launcher process<br>
&gt; postgres  3297  0.0  0.0  82712  1500 ?        Ss   11:41   0:00 postgres:<br>
&gt; archiver process   failed on 000000010000000000000001<br>
&gt; postgres  3298  0.0  0.0  82872  1568 ?        Ss   11:41   0:00 postgres:<br>
&gt; stats collector process<br>
&gt; root     10901  0.0  0.0 103232   852 pts/0    S+   11:44   0:00 grep<br>
&gt; postgres<br>
&gt;<br>
&gt;<br>
&gt; On slave:<br>
&gt;<br>
&gt; [root@slave ~]# ps axu | grep postgre<br>
&gt; root      3332  0.0  0.0 103232   856 pts/0    S+   11:45   0:00 grep<br>
&gt; postgre<br>
&gt; [root@slave ~]# netstat -putan | grep 5432<br>
&gt; [root@slave ~]#<br>
&gt;<br>
&gt;<br>
&gt; If I make pg_ctl /var/lib/pgsql/9.2/data/ start work ok<br>
&gt;<br>
&gt; Any idea?<br>
&gt;<br>
&gt;<br>
&gt; 2013/9/11 Takatoshi MATSUO &lt;<a href="mailto:matsuo.tak@gmail.com">matsuo.tak@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi Eloy<br>
&gt;&gt;<br>
&gt;&gt; Please see <a href="http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster" target="_blank">http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster</a> .<br>
&gt;&gt; In the document, it uses virtual IP to receive connection,<br>
&gt;&gt; so it doesn&#39;t need to change recovery.conf.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Takatoshi MATSUO<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2013/9/11 Eloy Coto Pereiro &lt;<a href="mailto:eloy.coto@gmail.com">eloy.coto@gmail.com</a>&gt;:<br>
&gt;&gt; &gt; Hi,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In Postgresql if you use wal replication<br>
&gt;&gt; &gt; &lt;<a href="http://wiki.postgresql.org/wiki/Streaming_Replication" target="_blank">http://wiki.postgresql.org/wiki/Streaming_Replication</a>&gt; when the master<br>
&gt;&gt; &gt; servers fails need to change the recovery.conf on the slave server.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; In this case any tool, when the master is down, execute a command and<br>
&gt;&gt; &gt; get<br>
&gt;&gt; &gt; this info?<br>
&gt;&gt; &gt; Is this the right tool for postgresql&#39;s replication?<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; 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>