[pgpool-general: 1873] Re: PgPoolAdmin Handy Tip

Nozomi Anzai anzai at sraoss.co.jp
Thu Jul 4 13:26:41 JST 2013


Hi,

> 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:

Thanks for your advice. I think this altering makes pgpoolAdmin more
helpful, too.
Would you mind if I commited this fix? If no, could you make the patch?

> 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
> _______________________________________________
> pgpool-general mailing list
> pgpool-general ¡÷ pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general


-- 
Nozomi Anzai
SRA OSS, Inc. Japan


More information about the pgpool-general mailing list