PostgreSQL 9.2 及多主機 Replication 複製機制設定
PostgreSQL 9.2 及多主機同步複製機制設定 PostgreSQL install 9.2(CentOS 6.x) CentOS 6.X 版本的 postgresql 是 8.4 版,很多機制還沒有很完備。如果只是一般的使用是足夠,但如需要使用 replication 的功能,建議安裝 9.0 以上版本,比較不會有使用上面的限制。且 9.0 以上版本有很多機制可以選擇(例如:Slony-I Replication),但我選擇內建簡單設定的版本來完成我簡單備份的目的。 如果需要有複製的機制,建議更新到最新版本的 postgresql ,最新穩定版為 postgresql 9.2 版本 如果之前有預設的 postgresql 請先備份、關閉及移除,避免錯亂。在 centos 的 yum remove or rpm remove 機制並不會將 data 目錄移除,但仍建議如果有資料記得用 pg_dump_all 備份出來再做後續的變更。 [root@power pgsql]# /etc/init.d/postgresql stop Stopping postgresql service: [ OK ] [root@power pgsql]# chkconfig postgresql off 9.2版的安裝,參考官方網站 http://www.postgresql.org/download/linux/redhat/ # 安裝 yum repo , 及軟體啟動 DB [root@powerful ~]# rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm [root@powerful ~]# yum install -y postgresql92-server postgresql92-contrib [root@powerful ~]# service postgresql-9.2 initdb [root@powerful ~]# chkconfig postgresql-9.2 on # 9.2 版預設路徑 [roo...