[pgpool-general: 1871] PgPoolAdmin Handy Tip

Andrew Bruce andrew.bruce at hslmobile.com
Wed Jul 3 17:47:09 JST 2013


Hi Folks,

I made some changes to my PgPoolAdmin setup that I thought I would share
with you (would be handy to have this as default!):

Problem: Running two PgPool servers in master/standby mode, there are
three IP addresses involved:
 - PgPool Server 1
 - PgPool Server 2
 - PgPool VIP address associated with whichever PgPool server is the
current master

I typically want to connect my web browser to the PgPoolAdmin interface
running on whichever server happens to be the master server, so I
connect to the VIP address.

The problem is that there is nothing to tell me which server I have
actually connected to.

The answer is to alter the PgPoolAdmin pages accordingly:

After installing PgPoolAdmin (and making sure it works!):
  Edit /var/www/html/pgpoolAdmin/config.php.
  Find the section (around line 240) that reads:

---%<---

      write($fp, '_PGPOOL2_LANG',               $params['lang']);
      write($fp, '_PGPOOL2_VERSION',            $params['version']);
 
      write($fp, '_PGPOOL2_CONFIG_FILE',
$params['pgpool_config_file']);

--->%---

  and insert a new line that so that the file now reads:

---%<---

      write($fp, '_PGPOOL2_LANG',               $params['lang']);
      write($fp, '_PGPOOL2_VERSION',            $params['version']);
 
      write($fp, '_PGPOOL2_HOST',               gethostname());
 
      write($fp, '_PGPOOL2_CONFIG_FILE',
$params['pgpool_config_file']);

--->%---

  Edit /var/www/html/pgpoolAdmin/templates/status.tpl and change:

---%<---

      <h2>pgpool-II Version</h2>
     {$smarty.const._PGPOOL2_VERSION}

--->%---

  To read:

---%<---

      <h2 align=center>{$smarty.const._PGPOOL2_HOST}</h2>
      pgpool-II Version: {$smarty.const._PGPOOL2_VERSION}

--->%---

  Finally, load the PgPoolAdmin web GUI into a browser, after logging
in, click on the 'pgpoolAdmin Setting' link, and simply click on
'Update'

The Result: When you go to the 'pgpool Status' page, the top line will
display the hostname of the server the GUI is running on. Very useful
(at least to me!).

I'm no php expert, so this may not be the most appropriate or best way
to do this, but it has the effect I'm looking for. Hopefully, some of
you will find this useful.

Regards,

Andy Bruce


More information about the pgpool-general mailing list