PostgreSQL安裝日誌

來源:互聯網
上載者:User

標籤:

第一步:安裝pg基本軟體

註:在安裝pg之前,建議先建立好postgres賬戶,然後用此賬戶安裝pg軟體

1: ./configure –prefix=…(指向你想安裝的目錄)

2:make  & sudo make

3:建立pg資料存貯目錄

    mkdir ~/data

4:初始化pg

   initdb ~/data

第二步:安裝pg串連池pgbouncer

安裝libevent&c-areq,pgbouncer所需要的庫

1:安裝libevent

wget https://github.com/downloads/libevent/libevent/libevent-2.0.22-stable

tar -zxvf libevent-2.0.22-stable.tar.gz

cd libevent-2.0.22-stable

./configure && make && make install

//所有用的動態庫進系統緩衝

echo "/usr/local/lib" >> /etc/ld.so.conf

ldconfig

2:安裝c-areq

wget http://c-ares.haxx.se/download/c-ares-1.10.0.tar.gz

tar -zxvf c-ares-1.10.0.tar.gz

cd c-ares-1.10.0

./configure && make && make install

ldconfig

3:安裝pgbouncer

git clone git://git.postgresql.org/git/pgbouncer.git

cd pgbouncer

git submodule init

git submodule update

./autogen.sh

./configure --prefix=/home/postgres/pgbouncer --with-libevent=/usr/local/lib --with-cares=/usr/local/lib

make && make install

配置pgbouncer

mkdir -p ~/pgbouncer/etc

vim config.ini

[databases]testdb= host=127.0.0.1 port=5432  pool_size=50 dbname=testdb[pgbouncer]pool_mode = transactionlisten_port = 6543listen_addr = 0.0.0.0auth_type = md5auth_file = /home/postgres/pgbouncer/etc/users.txtlogfile = /home/postgres/pgbouncer/log/pgbouncer.logpidfile = /home/postgres/pgbouncer/pgbouncer.pidunix_socket_dir = /home/postgres/pgbouncer/etcadmin_users = pgadminstats_users = pgstatserver_reset_query = DISCARD ALLserver_check_query = select 1server_check_delay = 30max_client_conn = 50000default_pool_size = 20reserve_pool_size = 5dns_max_ttl = 15ignore_startup_parameters = extra_float_digits

vim users.txt

postgres使用者密碼為postgres

"postgres" "md53175bce1d3201d16594cebf9d7eb3f9d""pgadmin"  "pgadmin""pgstat"   "md510a90e7529bc649302c9bfabefd51b93"

第三步:安裝本地告訴緩衝pgfincore(請自行去網上下載)

下載好檔案後,解壓

make&&make install 即可

 

至此,pg服務安裝完成,而且還有一個相當好的效能哦!

PostgreSQL安裝日誌

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.