最新版postgresql+pgboucer安装

Posted Yuan.Net

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了最新版postgresql+pgboucer安装相关的知识,希望对你有一定的参考价值。

安装postgresql:

wget https://pgbouncer.github.io/downloads/files/1.7.2/pgbouncer-1.7.2.tar.gz
wget http://get.enterprisedb.com/postgresql/postgresql-9.5.1-1-linux-x64.run
wget https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz

tar zxvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=/alidata/local/libevent
make
make install
cd ..

tar zxvf pgbouncer-1.7.2.tar.gz
cd pgbouncer-1.7.2
./configure --prefix=/alidata/local/pgbouncer/ --with-libevent=/alidata/local/libevent/
make 
make install
cd ..

chmod 777 postgresql-9.5.1-1-linux-x64.run
./postgresql-9.5.1-1-linux-x64.run

sudo chown -R postgres.postgres /alidata/pgsql
sudo chown -R postgres.postgres /alidata/local/pgbouncer
su - postgres
cp .bash_profile /alidata/pgsql
cp .bashrc  /alidata/pgsql
su - postgres

export PGHOME=/alidata/pgsql
export PATH=$PGHOME/bin:$PATH
export PGDATA=$PGHOME/data
export LD_LIBRARY_PATH=$PGHOME/lib
export LD_LIBRARY_PATH=/usr/local/libevent/lib:$LD_LIBRARY_PATH

[ -z "`cat /alidata/pgsql/data/pg_hba.conf | grep ‘fs.file-max‘`" ] && cat >> /alidata/pgsql/data/pg_hba.conf << EOF
host  all   all   192.170.206.0/24   md5
EOF

su postgres
./pg_ctl -D /alidata/pgsql/data/ reload

#chkconfig --list postgresql-9.0  
#chkconfig --list postgresql-9.0  
#netstat -ano | grep 5432 

#echo "SU_WHEEL_ONLY yes" >> /etc/login.defs
#more /opt/PostgreSQL/9.0/data/pg_log/startup.log 
#rm -rf /alidata/pgsql
#rm -rf postgres-reg.ini 

#检查服务状态:

service --status-all
service --status-all | grep ntpd
service --status-all | less
service httpd status

#列出所有服务启动级别:
chkconfig --list
#列出服务和他们对应的端口:
netstat -tulpn

chkconfig –list 
#查看服务命令

#chkconfig --add postgresql
#vim /alidata/pgsql/9.5/data/postgresql.conf       (监听更改为*)

#listen_addresses = *
#/usr/local/pgbouncer/bin/pgbouncer -d /usr/local/pgbouncer/conf/pgbouncer.ini
#/alidata/local/pgbouncer/bin/pgbouncer -d /alidata/local/pgbouncer/conf/pgbouncer.ini

 

安装pgbouncer

下载地址:http://pgfoundry.org/frs/download.php/2987/pgbouncer-1.4.1.tgz

安装

tar -zxvf pgbouncer-1.7.2.tgz

cd pgbouncer-1.7.2

./configure --prefix=/usr/local/pg_bouncer

make

make install

以上是关于最新版postgresql+pgboucer安装的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu PostgreSQL安装和配置

Ubuntu PostgreSQL安装和配置

ubuntu 安装 postgresql 和 postgis

Windows8专业版可以安装PostgreSQL数据库吗?

2022最新网易云音乐代挂源码[含教程]自动刷歌签到

Git如何从远程拉取最新代码,并与本地代