標籤:postgresql營運實戰精講之“postgresql源碼安裝”
一、
wget https://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.gz
二、安裝:
#安裝依賴包
yuminstall -y perl-ExtUtils-Embed readline-devel zlib-devel pam-devellibxml2-devel libxslt-devel openldap-devel python-devel gcc-c++ openssl-devel cmake -y
tarzxvf postgresql-9.2.4.tar.gz
cd postgresql-9.2.4
./configure--prefix=/usr/local/pgsql9.2.4 --with-perl --with-python
make
makeinstall
三、安裝後的配置
ln-s /usr/local/pgsql9.2.4 /usr/local/pgsql
vim/etc/profile
#addby xuekun 2016-5-11
exportPATH=/usr/local/pgsql/bin:$PATH
exportLD_LIBRARY_PATH=/usr/local/pgsql/lib:$LD_LIBRARY_PATH
source/etc/profile
#建立資料簇
export PGDATA=/home/osdba/pgdata
[[email protected]lhostosdba]# useradd osdba
[[email protected]]# su osdba
[[email protected]~]$ initdb
#安裝contrib目錄下的工具(root使用者下安裝)
cd/home/maidong/postgresql-9.2.4
cdcontrib/
make
makeinstall
#啟動和停止資料庫(osdba使用者下)
[[email protected]]$ pg_ctl start -D $PGDATA
[[email protected]]$ pg_ctl stop -D $PGDATA
本文出自 “北京開源人Linux營運實戰” 部落格,請務必保留此出處http://bdkyr.blog.51cto.com/7961566/1772684
PostgreSQL營運實戰精講之“postgresql源碼安裝”