1创建数据库账户
Userdel postgres
Useradd postgres
2修改postgres 密码
echo 'GTdbs_postgres' |passwd postgres
3安装 数据库
postgresql93-9.3.5-1PGDG.rhel6.x86_64.rpm
postgresql93-contrib-9.3.5-1PGDG.rhel6.x86_64.rpm
postgresql93-libs-9.3.5-1PGDG.rhel6.x86_64.rpm
postgresql93-server-9.3.5-1PGDG.rhel6.x86_64.rpm
4安装 httpd
yum install -y php php-psql httpd php-mbstring
5建立数据目录 log目录
[root@AY14070116183406951aZ mnt]# mkdir -p /mnt/pgdb/data
[root@AY14070116183406951aZ mnt]# mkdir -p /mnt/pgpool/log
6授权
[root@AY14070116183406951aZ mnt]# chown -R postgres.postgres /mnt/pgdb/
[root@AY14070116183406951aZ mnt]# chown -R postgres.postgres /mnt/pgpool/
6初始化数据库
Su – postgres
vim .bash_profile
PGDATA=/mnt/pgdb/data
Initdb /mnt/pgdb/data
Pgctl start
Psql
\password
GTdbs_postgresql
#Createuser pgpool GTdbs_pool
7安装pgpool
安装php php-psql httpd php-mbstring
yum install -y php php-psql httpd php-mbstring
配置 ssh 对等协议
ssh-keygen
ssh-copy-id
安装pgpoo
./install.sh
[root@pgdb2 installer-pg93-3.3.3]# ./install.sh
check for installation ...OK.
=================================================================
Copyright (c) 2003-2014 PgPool Global Development Group
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permission
notice appear in supporting documentation, and that the name of the
author not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission. The author makes no representations about the
suitability of this software for any purpose. It is provided "as
is" without express or implied warranty.
=================================================================
[input] Do you accept the end user software license agreement? (yes/no):
yes
=================================================================
Configuration
=================================================================
----------------------------------------------------------------------
Configuring Host, User, SSH ...
----------------------------------------------------------------------
* Node information
Two-node cluster (node 0 and node 1) is assumed.
[input] Specify node 0's hostname or IP address : 192.168.1.223
[input] Specify node 1's hostname or IP address : 192.168.1.232
Which node is this?
If this is node 0, a database cluster is created by initdb after installation.
Otherwise if this is node 1, the configurations on node 0 is reused.
登录网页 调整参数
http://ip/pgpoolAdmin/status.php
在第二台 主机 安装pgpool
可能遇到的问题
e1006 无法更新pgpool。conf 参考网址 http://www.pgpool.net/pgpool-web/contrib_docs/simple_sr_setting_3.1/index.html
chown apache /usr/local/etc/pgpool.conf
chmod 777 /var/log/pgpool/trigger
[root@pgdb1 pgpoolAdmin]# chown apache conf/pgmgt.conf.php
[root@pgdb1 pgpoolAdmin]# chmod 644 conf/pgmgt.conf.php
setenforce 0
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29778618/viewspace-1267795/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29778618/viewspace-1267795/