View Issue Details

IDProjectCategoryView StatusLast Update
0000091pgpool-HABugpublic2014-01-28 13:50
ReportermaxiperezAssigned To 
PriorityhighSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Platformx86_64OSLinux 2.6.32-431.3.1.el6.x86_6OS VersionCentOS 6.5
Product Version 
Target VersionFixed in Version 
Summary0000091: Can't use pgpool-ha with CentoOS 6.5 ccs/pacemaker (Error: Unable to parse xml for: pgpool)
DescriptionI have a new Cluster with Postgres 9 and SR working nicely.

Last updated: Fri Jan 10 01:13:11 2014
Last change: Fri Jan 10 01:13:04 2014 via crm_attribute on pg01
Stack: cman
Current DC: pg01 - partition with quorum
Version: 1.1.10-14.el6_5.1-368c726
2 Nodes configured
4 Resources configured

Online: [ pg01 pg02 ]

Full list of resources:

Master/Slave Set: mxdb-msPostgresql [mxdb-motor]
     Masters: [ pg01 ]
     Slaves: [ pg02 ]
Resource Group: mxdb-group
     mxdb-vip-master (ocf::heartbeat:IPaddr2): Started pg01
     mxdb-vip-rep (ocf::heartbeat:IPaddr2): Started pg01

Node Attributes:
* Node pg01:
    + master-mxdb-motor : 1000
    + mxdb-motor-data-status : LATEST
    + mxdb-motor-master-baseline : 000000000B022DD8
    + mxdb-motor-status : PRI
* Node pg02:
    + master-mxdb-motor : 100
    + mxdb-motor-data-status : STREAMING|SYNC
    + mxdb-motor-status : HS:sync

Migration summary:
* Node pg01:
* Node pg02:

When I want to use pgpool-ha RA it keeps saying there is an XML parse error inside python:

[root@pg01 pgpool-ha-2.1]# ./ --with-pgsql=/usr/pgsql-9.3 --with-pgpool=/usr
PGSQL_DIR: /usr/pgsql-9.3
OCF_DIR: /usr/lib/ocf/resource.d/heartbeat
Makefile generated
[root@pg01 pgpool-ha-2.1]# make ; make install
sed -e 's#@_PGSQL_DIR_@#/usr/pgsql-9.3#g' < | \
        sed -e 's#@_PGPOOL_DIR_@#/usr#g' | \
        sed -e 's#@_OCF_DIR_@#/usr/lib/ocf/resource.d/heartbeat#g' > pgpool
/usr/bin/install -c -m 755 pgpool /usr/lib/ocf/resource.d/heartbeat
[root@pg01 pgpool-ha-2.1]#
[root@pg01 pgpool-ha-2.1]# ls -la /usr/lib/ocf/resource.d/heartbeat/pgpool
-rwxr-xr-x. 1 root root 11923 Jan 10 01:07 /usr/lib/ocf/resource.d/heartbeat/pgpool

[root@pg01 pgpool-ha-2.1]# pcs resource describe pgpool
Resource options for: ocf:heartbeat:pgpool
Error: Unable to parse xml for: pgpool

But other RA are parsed OK:

[root@pg01 pgpool-ha-2.1]# pcs resource describe Squid
Resource options for: ocf:heartbeat:Squid
  squid_exe (required): This is a required parameter. This parameter specifies squid's executable file.
  squid_conf (required): This is a required parameter. This parameter specifies a configuration file for a squid instance managed by this RA.
  squid_pidfile (required): This is a required parameter. This parameter specifies a process id file for a squid instance managed by this RA.
  squid_port (required): This is a required parameter. This parameter specifies a port number for a squid instance managed by this RA. If plural ports are used, you
                         must specifiy the only one of them.
  squid_stop_timeout: On stop, a squid shutdown is invoked first. If the resource doesn't stop within this timeout, we resort to stopping processes by sending signals
                      and finally KILLing them.
  debug_mode: This is an optional parameter. This RA runs in debug mode when this parameter includes 'x' or 'v'. If 'x' is included, both of STDOUT and STDERR redirect
              to the logfile specified by "debug_log", and then the builtin shell option 'x' is turned on. It is similar about 'v'.
  debug_log: This is an optional and omittable parameter. This parameter specifies a destination file for debug logs and works only if this RA run in debug mode. Refer
             to "debug_mode" about debug mode. If no value is given but it's requied, it's made by the following rules: "/var/log/" as a directory part, the basename of
             the configuration file given by "syslog_ng_conf" as a basename part, ".log" as a suffix.
[root@pg01 pgpool-ha-2.1]#

[root@pg01 ~]# pcs resource create mxdb-pgpool pgpool \
> pgpoolconf="/bases/mx/pgpool-II-93/pgpool.conf" \
> pcpconf="/bases/mx/pgpool-II-93/pcp.conf" \
> hbaconf="/bases/mx/pgpool-II-93/pool_hba.conf" \
> logfile="/bases/mx/log/pgpool.log" \
> checkmethod="pcp" \
> checkstring="10 localhost 40015 postgres postgres" \
> options="" \
> pgpooluser="postgres" \
> op monitor interval="60s" \
> op start interval="0" timeout="60" \
> op stop interval="0" timeout="60"
Traceback (most recent call last):
  File "/usr/sbin/pcs", line 129, in <module>
  File "/usr/sbin/pcs", line 108, in main
  File "/usr/lib/python2.6/site-packages/pcs/", line 71, in resource_cmd
    resource_create(res_id, res_type, ra_values, op_values, meta_values, clone_opts)
  File "/usr/lib/python2.6/site-packages/pcs/", line 330, in resource_create
    bad_opts = utils.validInstanceAttributes(ra_id, params , get_full_ra_type(ra_type, True))
  File "/usr/lib/python2.6/site-packages/pcs/", line 1003, in validInstanceAttributes
    root = ET.fromstring(metadata)
  File "/usr/lib64/python2.6/xml/etree/", line 963, in XML
  File "/usr/lib64/python2.6/xml/etree/", line 1245, in feed
    self._parser.Parse(data, 0)
xml.parsers.expat.ExpatError: junk after document element: line 110, column 0

I can’t see what is going on wrong…..maybe this is not supported with CMAN+pcs?

[root@pg01 ~]# rpm -qa | grep ccs
[root@pg01 ~]# rpm -qa | grep pace
[root@pg01 ~]# rpm -qa | grep cman

[root@pg01 pgpool-ha-2.1]# cat

export OCF_ROOT=/usr/lib/ocf

export OCF_RESKEY_pgpoolconf="/bases/mx/pgpool-II-93/pgpool.conf"
export OCF_RESKEY_pcpconf="/bases/mx/pgpool-II-93/pcp.conf"
export OCF_RESKEY_hbaconf="/bases/mx/pgpool-II-93/pool_hba.conf"
export OCF_RESKEY_logfile=""
export OCF_RESKEY_options="-D"
export OCF_RESKEY_pgpooluser="postgres"
# export OCF_RESKEY_checkmethod="pid"
# export OCF_RESKEY_checkstring=""
export OCF_RESKEY_checkmethod="pcp"
export OCF_RESKEY_checkstring="10 localhost 40015 postgres postgres"
#export OCF_RESKEY_checkmethod="psql"
#export OCF_RESKEY_checkstring="-h localhost -U postgres -p 5432 -c \\'SELECT 1\\'"

sh pgpool $*

[root@pg01 pgpool-ha-2.1]# ./ meta-data
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="pgpool">
<longdesc lang="en">
This is an OCF Resource Agent for pgpool-II.
<shortdesc lang="en">OCF Resource Agent for pgpool-II</shortdesc>
  <parameter name="pgpoolconf" unique="0" required="0">
   <longdesc lang="en">
Path to pgpool.conf of pgpool.
   <shortdesc lang="en">pgpool.conf path</shortdesc>
   <content type="string" default="/usr/etc/pgpool.conf" />
  <parameter name="pcpconf" unique="0" required="0">
   <longdesc lang="en">
Path to pcp.conf of pgpool.
   <shortdesc lang="en">pcp.conf path</shortdesc>
   <content type="string" default="" />
  <parameter name="hbaconf" unique="0" required="0">
   <longdesc lang="en">
Path to pool_hba.conf of pgpool.
   <shortdesc lang="en">pool_hba.conf path</shortdesc>
   <content type="string" default="" />
  <parameter name="logfile" unique="0" required="0">
   <longdesc lang="en">
pgpool log file for stdout and stderr redirection;
or a program for log collecting by a pipeline.
"| logger -t pgpool -p"
   <shortdesc lang="en">pgpool logfile</shortdesc>
   <content type="string" default="" />
  <parameter name="options" unique="0" required="0">
   <longdesc lang="en">
pgpool command line options (except configuration file options).
   <shortdesc lang="en">pgpool command line options</shortdesc>
   <content type="string" default="" />
  <parameter name="pgpooluser" unique="0" required="0">
   <longdesc lang="en">
pgpool run as this user.
   <shortdesc lang="en">pgpool user</shortdesc>
   <content type="string" default="postgres" />
  <parameter name="checkmethod" unique="0" required="0">
   <longdesc lang="en">
monitoring method type.
"pid" process existence check only.
"pcp" check by pcp_node_count command.
"psql" check by psql command.
   <shortdesc lang="en">monitoring method type</shortdesc>
   <content type="string" default="pid" />
  <parameter name="checkstring" unique="0" required="0">
   <longdesc lang="en">
parameter for monitoring method.
when checkmetod="pid", this means pidfile path.
  (e.g.) "/var/run/pgpool/"
when checkmetod="pcp", this means a parameter string for pcp_node_count.
  (e.g.) "10 localhost 9898 postgres pass"
when checkmetod="psql", this means a parameter string for psql.
  (e.g.) "-U postgres -h localhost -l -p 9999"
   <shortdesc lang="en">a parameter for monitoring method</shortdesc>
   <content type="string" default="" />
  <parameter name="pgpoolcmd" unique="0" required="0">
   <longdesc lang="en">
pgpool command.
   <shortdesc lang="en"></shortdesc>
   <content type="string" default="/usr/bin/pgpool" />
  <parameter name="psqlcmd" unique="0" required="0">
   <longdesc lang="en">
psql command.
   <shortdesc lang="en">psql command</shortdesc>
   <content type="string" default="/usr/pgsql-9.3/bin/psql" />
  <parameter name="pcpnccmd" unique="0" required="0">
   <longdesc lang="en">
pcp_node_count command.
   <shortdesc lang="en">pcp_node_count command</shortdesc>
   <content type="string" default="/usr/bin/pcp_node_count" />
  <action name="start" timeout="20" />
  <action name="stop" timeout="20" />
  <action name="monitor" depth="0" timeout="20" interval="10" />
  <action name="reload" timeout="20" />
  <action name="meta-data" timeout="5" />
  <action name="validate-all" timeout="5" />
DEBUG: test_res: meta-data returned 0
[root@pg01 pgpool-ha-2.1]#

TagsNo tags attached.



2014-01-11 23:43

reporter   ~0000383

Same error with pgpool-ha-2.0. BTW, pgpool-ha-1.3 works well:

[root@pg02 src]# pcs resource describe pgpool
Resource options for: ocf:heartbeat:pgpool
  pgpoolconf: Path to pgpool.conf
  pcpconf: Path to pcp.conf. pgpool-II only.
  hbaconf: Path to pool_hba.conf. requires pgpool > 3.2 only.
  logfile: Path to output logfile . logfile contains debuglog. if this entry is empty , log output is depends on pgpool.
  pidfile: Path to
  options: additional options of pgpool-II start command. (e.g. -d)
  pgpooluser: pgpool-II user. (e.g. "postgres"(default), "pgpool" or "root")


2014-01-23 00:32

reporter   ~0000386

I have the same problem with pgpool-HA v2.1


2014-01-28 12:07

developer   ~0000389

I fix it.
Thanks your detailed analysis.;a=commit;h=a41add614b72e0a286c3e47efa09686c6806c8b3

Issue History

Date Modified Username Field Change
2014-01-11 09:15 maxiperez New Issue
2014-01-11 23:43 maxiperez Note Added: 0000383
2014-01-23 00:32 asgaroth Note Added: 0000386
2014-01-28 12:07 harukat Note Added: 0000389
2014-01-28 13:50 nagata Status new => closed
2014-01-28 13:50 nagata Resolution open => fixed