<div dir="ltr"><div><div>Hi Michael,<br></div>There is no info in the pg_logs, nothing in /var/log/cluster/corosync.log, do you have to specify the logging somewhere, sorry I'm out of ideas<br></div>Thanks<br> </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 12:20 PM, Michael Schwartzkopff <span dir="ltr"><<a href="mailto:ms@sys4.de" target="_blank">ms@sys4.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Mittwoch, 11. März 2015, 12:14:02 schrieb Wynand Jansen van Vuuren:<br>
<div><div class="h5">> Hi all,<br>
> I need some advice and help please, I'm pretty new to HA and what I have is<br>
> 2 nodes, with 2 network interfaces, ETH0 and ETH1<br>
> cl1_lb1 IP is 172.28.200.166<br>
> cl2_lb1 IP is 172.28.200.168<br>
> Running on ETH0<br>
><br>
> The heartbeart is setup on 172.16.0.1 and 172.16.0.3 and running on ETH1,<br>
> my pubic VIP for the 2 nodes is 172.28.200.159 and my VIP for replication<br>
> is 172.26.0.5<br>
><br>
> When I test pgsql with ocf-tester (I have modified the pgsql file with the<br>
> paths etc), I get the following<br>
><br>
> cl1_lb1:~ # cd /usr/lib/ocf/resource.d/heartbeat/<br>
> cl1_lb1:/usr/lib/ocf/resource.d/heartbeat # ocf-tester -v -n resourcename<br>
> pgsql<br>
> Beginning tests for pgsql...<br>
> Testing permissions with uid nobody<br>
> Testing: meta-data<br>
> Testing: meta-data<br>
> <?xml version="1.0"?><br>
> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"><br>
> <resource-agent name="pgsql"><br>
> <version>1.0</version><br>
><br>
> <longdesc lang="en"><br>
> Resource script for PostgreSQL. It manages a PostgreSQL as an HA resource.<br>
> </longdesc><br>
> <shortdesc lang="en">Manages a PostgreSQL database instance</shortdesc><br>
><br>
> <parameters><br>
> <parameter name="pgctl" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to pg_ctl command.<br>
> </longdesc><br>
> <shortdesc lang="en">pgctl</shortdesc><br>
> <content type="string" default="/opt/app/PostgreSQL/9.3/bin/pg_ctl" /><br>
> </parameter><br>
><br>
> <parameter name="start_opt" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Start options (-o start_opt in pg_ctl). "-i -p 5432" for example.<br>
> </longdesc><br>
> <shortdesc lang="en">start_opt</shortdesc><br>
> <content type="string" default="" /><br>
><br>
> </parameter><br>
> <parameter name="ctl_opt" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Additional pg_ctl options (-w, -W etc..).<br>
> </longdesc><br>
> <shortdesc lang="en">ctl_opt</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="psql" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to psql command.<br>
> </longdesc><br>
> <shortdesc lang="en">psql</shortdesc><br>
> <content type="string" default="/opt/app/PostgreSQL/9.3/bin/psql" /><br>
> </parameter><br>
><br>
> <parameter name="pgdata" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to PostgreSQL data directory.<br>
> </longdesc><br>
> <shortdesc lang="en">pgdata</shortdesc><br>
> <content type="string" default="/opt/app/pgdata/9.3" /><br>
> </parameter><br>
><br>
> <parameter name="pgdba" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> User that owns PostgreSQL.<br>
> </longdesc><br>
> <shortdesc lang="en">pgdba</shortdesc><br>
> <content type="string" default="postgres" /><br>
> </parameter><br>
><br>
> <parameter name="pghost" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Hostname/IP address where PostgreSQL is listening<br>
> </longdesc><br>
> <shortdesc lang="en">pghost</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="pgport" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Port where PostgreSQL is listening<br>
> </longdesc><br>
> <shortdesc lang="en">pgport</shortdesc><br>
> <content type="integer" default="5432" /><br>
> </parameter><br>
><br>
> <parameter name="pglibs" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Custom location of the Postgres libraries. If not set, the standard location<br>
> will be used.<br>
> </longdesc><br>
> <shortdesc lang="en">pglibs</shortdesc><br>
> <content type="string" default="/opt/app/PostgreSQL/9.3/lib" /><br>
> </parameter><br>
><br>
> <parameter name="monitor_user" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> PostgreSQL user that pgsql RA will user for monitor operations. If it's not<br>
> set<br>
> pgdba user will be used.<br>
> </longdesc><br>
> <shortdesc lang="en">monitor_user</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="monitor_password" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Password for monitor user.<br>
> </longdesc><br>
> <shortdesc lang="en">monitor_password</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="monitor_sql" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> SQL script that will be used for monitor operations.<br>
> </longdesc><br>
> <shortdesc lang="en">monitor_sql</shortdesc><br>
> <content type="string" default="select now();" /><br>
> </parameter><br>
><br>
> <parameter name="config" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to the PostgreSQL configuration file for the instance.<br>
> </longdesc><br>
> <shortdesc lang="en">Configuration file</shortdesc><br>
> <content type="string" default="/opt/app/pgdata/9.3/postgresql.conf" /><br>
> </parameter><br>
><br>
> <parameter name="pgdb" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Database that will be used for monitoring.<br>
> </longdesc><br>
> <shortdesc lang="en">pgdb</shortdesc><br>
> <content type="string" default="template1" /><br>
> </parameter><br>
><br>
> <parameter name="logfile" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to PostgreSQL server log output file.<br>
> </longdesc><br>
> <shortdesc lang="en">logfile</shortdesc><br>
> <content type="string" default="/dev/null" /><br>
> </parameter><br>
><br>
> <parameter name="socketdir" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Unix socket directory for PostgreSQL.<br>
><br>
> If you use PostgreSQL 9.3 or higher and define unix_socket_directories in<br>
> the postgresql.conf, then you must set socketdir to determine which<br>
> directory is used for psql command.<br>
> </longdesc><br>
> <shortdesc lang="en">socketdir</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="stop_escalate" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Number of shutdown retries (using -m fast) before resorting to -m immediate<br>
> </longdesc><br>
> <shortdesc lang="en">stop escalation</shortdesc><br>
> <content type="integer" default="30" /><br>
> </parameter><br>
><br>
> <parameter name="rep_mode" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Replication mode may be set to "async" or "sync" or "slave".<br>
> They require PostgreSQL 9.1 or later.<br>
> Once set, "async" and "sync" require node_list, master_ip, and<br>
> restore_command parameters,as well as configuring PostgreSQL<br>
> for replication (in postgresql.conf and pg_hba.conf).<br>
><br>
> "slave" means that RA only makes recovery.conf before starting<br>
> to connect to primary which is running somewhere.<br>
> It dosen't need master/slave setting.<br>
> It requires master_ip restore_command parameters.<br>
> </longdesc><br>
> <shortdesc lang="en">rep_mode</shortdesc><br>
> <content type="string" default="none" /><br>
> </parameter><br>
><br>
> <parameter name="node_list" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> All node names. Please separate each node name with a space.<br>
> This is required for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">node list</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="restore_command" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> restore_command for recovery.conf.<br>
> This is required for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">restore_command</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="archive_cleanup_command" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> archive_cleanup_command for recovery.conf.<br>
> This is used for replication and is optional.<br>
> </longdesc><br>
> <shortdesc lang="en">archive_cleanup_command</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="recovery_end_command" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> recovery_end_command for recovery.conf.<br>
> This is used for replication and is optional.<br>
> </longdesc><br>
> <shortdesc lang="en">recovery_end_command</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="master_ip" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Master's floating IP address to be connected from hot standby.<br>
> This parameter is used for "primary_conninfo" in recovery.conf.<br>
> This is required for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">master ip</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="repuser" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> User used to connect to the master server.<br>
> This parameter is used for "primary_conninfo" in recovery.conf.<br>
> This is required for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">repuser</shortdesc><br>
> <content type="string" default="postgres" /><br>
> </parameter><br>
><br>
> <parameter name="primary_conninfo_opt" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> primary_conninfo options of recovery.conf except host, port, user and<br>
> application_name.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">primary_conninfo_opt</shortdesc><br>
> <content type="string" default="" /><br>
> </parameter><br>
><br>
> <parameter name="restart_on_promote" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> If this is true, RA deletes recovery.conf and restarts PostgreSQL<br>
> on promote to keep Timeline ID. It probably makes fail-over slower.<br>
> It's recommended to set on-fail of promote up as fence.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">restart_on_promote</shortdesc><br>
> <content type="boolean" default="false" /><br>
> </parameter><br>
><br>
> <parameter name="tmpdir" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Path to temporary directory.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">tmpdir</shortdesc><br>
> <content type="string" default="/var/lib/pgsql/tmp" /><br>
> </parameter><br>
><br>
> <parameter name="xlog_check_count" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Number of checks of xlog on monitor before promote.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">xlog check count</shortdesc><br>
> <content type="integer" default="" /><br>
> </parameter><br>
><br>
> <parameter name="crm_attr_timeout" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> The timeout of crm_attribute forever update command.<br>
> Default value is 5 seconds.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">The timeout of crm_attribute forever update<br>
> command.</shortdesc><br>
> <content type="integer" default="5" /><br>
> </parameter><br>
><br>
> <parameter name="stop_escalate_in_slave" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> Number of shutdown retries (using -m fast) before resorting to -m immediate<br>
> in slave state.<br>
> This is optional for replication.<br>
> </longdesc><br>
> <shortdesc lang="en">stop escalation_in_slave</shortdesc><br>
> <content type="integer" default="30" /><br>
> </parameter><br>
><br>
> <parameter name="check_wal_receiver" unique="0" required="0"><br>
> <longdesc lang="en"><br>
> If this is true, RA checks wal_receiver process on monitor<br>
> and notifies its status using "(resource name)-receiver-status" attribute.<br>
> It's useful for checking whether PostgreSQL (hot standby) connects to<br>
> primary.<br>
> The attribute shows status as "normal" or "ERROR".<br>
> </longdesc><br>
> <shortdesc lang="en">check_wal_receiver</shortdesc><br>
> <content type="boolean" default="false" /><br>
> </parameter><br>
> </parameters><br>
><br>
> <actions><br>
> <action name="start" timeout="120" /><br>
> <action name="stop" timeout="120" /><br>
> <action name="status" timeout="60" /><br>
> <action name="monitor" depth="0" timeout="30" interval="30"/><br>
> <action name="monitor" depth="0" timeout="30" interval="29" role="Master" /><br>
> <action name="promote" timeout="120" /><br>
> <action name="demote" timeout="120" /><br>
> <action name="notify" timeout="90" /><br>
> <action name="meta-data" timeout="5" /><br>
> <action name="validate-all" timeout="5" /><br>
> <action name="methods" timeout="5" /><br>
> </actions><br>
> </resource-agent><br>
> Testing: validate-all<br>
> Checking current state<br>
> Testing: stop<br>
> INFO: waiting for server to shut down..... done server stopped<br>
> INFO: PostgreSQL is down<br>
> Testing: monitor<br>
> INFO: PostgreSQL is down<br>
> Testing: monitor<br>
> ocf-exit-reason:Setup problem: couldn't find command:<br>
> /opt/app/PostgreSQL/9.3/bin/pg_ctl<br>
> Testing: start<br>
> INFO: server starting<br>
> INFO: PostgreSQL start command sent.<br>
> INFO: PostgreSQL is down<br>
> DEBUG: PostgreSQL still hasn't started yet. Waiting...<br>
> INFO: PostgreSQL is started.<br>
> Testing: monitor<br>
> Testing: monitor<br>
> INFO: Don't check /opt/app/pgdata/9.3 during probe<br>
> Testing: notify<br>
> Checking for demote action<br>
> ocf-exit-reason:Not in a replication mode.<br>
> Checking for promote action<br>
> ocf-exit-reason:Not in a replication mode.<br>
> Testing: demotion of started resource<br>
> ocf-exit-reason:Not in a replication mode.<br>
> * rc=6: Demoting a start resource should not fail<br>
> Testing: promote<br>
> ocf-exit-reason:Not in a replication mode.<br>
> * rc=6: Promote failed<br>
> Testing: demote<br>
> ocf-exit-reason:Not in a replication mode.<br>
> * rc=6: Demote failed<br>
> Aborting tests<br>
> cl1_lb1:/usr/lib/ocf/resource.d/heartbeat # su - postgres<br>
> postgres@cl1_lb1:~> pg_ctl -D /opt/app/pgdata/9.3 status<br>
> pg_ctl: server is running (PID: 21575)<br>
> /opt/app/PostgreSQL/9.3/bin/postgres "-D" "/opt/app/pgdata/9.3" "-c"<br>
> "config_file=/opt/app/pgdata/9.3/postgresql.conf"<br>
><br>
> Postgres seem to be running ok on both nodes and the streaming is taking<br>
> place<br>
><br>
> postgres@cl1_lb1:~> exit<br>
> logout<br>
> cl1_lb1:/usr/lib/ocf/resource.d/heartbeat # crm_mon -1 -Af<br>
> Last updated: Wed Mar 11 12:05:17 2015<br>
> Last change: Wed Mar 11 12:03:10 2015 by root via crm_attribute on cl1_lb1<br>
> Stack: classic openais (with plugin)<br>
> Current DC: cl1_lb1 - partition with quorum<br>
> Version: 1.1.9-2db99f1<br>
> 2 Nodes configured, 2 expected votes<br>
> 4 Resources configured.<br>
><br>
><br>
> Online: [ cl1_lb1 cl2_lb1 ]<br>
><br>
> Master/Slave Set: msPostgresql [pgsql]<br>
> pgsql:0 (ocf::heartbeat:pgsql): Slave cl1_lb1 FAILED<br>
> Stopped: [ pgsql:1 ]<br>
><br>
> Node Attributes:<br>
> * Node cl1_lb1:<br>
> + master-pgsql : -INFINITY<br>
> + pgsql-data-status : LATEST<br>
> + pgsql-status : STOP<br>
> * Node cl2_lb1:<br>
> + master-pgsql : 100<br>
> + pgsql-data-status : STREAMING|SYNC<br>
> + pgsql-status : STOP<br>
><br>
> Migration summary:<br>
> * Node cl1_lb1:<br>
> pgsql:0: migration-threshold=1 fail-count=1 last-failure='Wed Mar 11<br>
> 12:04:42 2015'<br>
> * Node cl2_lb1:<br>
> pgsql:0: migration-threshold=1 fail-count=1000000 last-failure='Wed Mar<br>
> 11 12:01:40 2015'<br>
><br>
> Failed actions:<br>
> pgsql_monitor_3000 (node=cl1_lb1, call=132, rc=1, status=complete):<br>
> unknown error<br>
> pgsql_start_0 (node=cl2_lb1, call=90, rc=1, status=complete): unknown<br>
> error<br>
> cl1_lb1:/usr/lib/ocf/resource.d/heartbeat # crm configure show<br>
> node cl1_lb1 \<br>
> attributes pgsql-data-status="LATEST"<br>
> node cl2_lb1 \<br>
> attributes pgsql-data-status="STREAMING|SYNC"<br>
> primitive pgsql ocf:heartbeat:pgsql \<br>
> params pgctl="/opt/app/PostgreSQL/9.3/bin/pg_ctl"<br>
> psql="/opt/app/PostgreSQL/9.3/bin/psql"<br>
> config="/opt/app/pgdata/9.3/postgresql.conf" pgdba="postgres"<br>
> pgdata="/opt/app/pgdata/9.3/" start_opt="-p 5432" rep_mode="sync"<br>
> node_list="cl1_lb1 cl2_lb1" restore_command="cp /pgtablespace/archive/%f<br>
> %p" primary_conninfo_opt="keepalives_idle=60 keepalives_interval=5<br>
> keepalives_count=5" master_ip="172.16.0.5" restart_on_promote="true"<br>
> logfile="/var/log/OCF.log" \<br>
> op start interval="0s" timeout="60s" on-fail="restart" \<br>
> op monitor interval="4s" timeout="60s" on-fail="restart" \<br>
> op monitor interval="3s" role="Master" timeout="60s" on-fail="restart" \<br>
> op promote interval="0s" timeout="60s" on-fail="restart" \<br>
> op demote interval="0s" timeout="60s" on-fail="stop" \<br>
> op stop interval="0s" timeout="60s" on-fail="block" \<br>
> op notify interval="0s" timeout="60s"<br>
> primitive vip-master ocf:heartbeat:IPaddr2 \<br>
> params ip="172.28.200.159" nic="eth0" cidr_netmask="24" \<br>
> op start interval="0s" timeout="60s" on-fail="stop" \<br>
> op monitor interval="10s" timeout="60s" on-fail="restart" \<br>
> op stop interval="0s" timeout="60s" on-fail="block"<br>
> primitive vip-rep ocf:heartbeat:IPaddr2 \<br>
> params ip="172.16.0.5" nic="eth1" cidr_netmask="24" \<br>
> meta migration-threshold="0" \<br>
> op start interval="0s" timeout="60s" on-fail="restart" \<br>
> op monitor interval="10s" timeout="60s" on-fail="restart" \<br>
> op stop interval="0s" timeout="60s" on-fail="block"<br>
> group master-group vip-master vip-rep<br>
> ms msPostgresql pgsql \<br>
> meta master-max="1" master-node-max="1" clone-max="2"<br>
> clone-node-max="1" notify="true"<br>
> colocation rsc_colocation-1 inf: master-group msPostgresql:Master<br>
> order rsc_order-1 0: msPostgresql:promote master-group:start<br>
> symmetrical=false<br>
> order rsc_order-2 0: msPostgresql:demote master-group:stop symmetrical=false<br>
> property $id="cib-bootstrap-options" \<br>
> dc-version="1.1.9-2db99f1" \<br>
> cluster-infrastructure="classic openais (with plugin)" \<br>
> expected-quorum-votes="2" \<br>
> no-quorum-policy="ignore" \<br>
> stonith-enabled="false" \<br>
> crmd-transition-delay="0s" \<br>
> last-lrm-refresh="1426067955"<br>
> rsc_defaults $id="rsc-options" \<br>
> resource-stickiness="INFINITY" \<br>
> migration-threshold="1"<br>
> cl1_lb1:/usr/lib/ocf/resource.d/heartbeat #<br>
><br>
> It seems that pgsql is not playing nicely with my Postgres install, any<br>
> hints tips what to look for please??<br>
> Thanks<br>
<br>
<br>
</div></div>Look into the logs. The pgsql agent writes errors to the logs.<br>
<br>
Search in your logs on cl2_lb1 around 12:01:40 2015.<br>
<br>
<br>
Mit freundlichen Grüßen,<br>
<br>
Michael Schwartzkopff<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
[*] sys4 AG<br>
<br>
<a href="http://sys4.de" target="_blank">http://sys4.de</a>, <a href="tel:%2B49%20%2889%29%2030%2090%2046%2064" value="+498930904664">+49 (89) 30 90 46 64</a>, <a href="tel:%2B49%20%28162%29%20165%200044" value="+491621650044">+49 (162) 165 0044</a><br>
Franziskanerstraße 15, 81669 München<br>
<br>
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263<br>
Vorstand: Patrick Ben Koetter, Marc Schiffbauer<br>
Aufsichtsratsvorsitzender: Florian Kirstein</font></span><br>_______________________________________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
<a href="http://clusterlabs.org/mailman/listinfo/users" target="_blank">http://clusterlabs.org/mailman/listinfo/users</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>
<br></blockquote></div><br></div>