基於4個節點的corosync + pacemaker PG 資料庫 HA 配置
最近測試完成了一套4節點的PG 資料庫
實施策略本著省錢夠用的原則,採用了3拖一方案
3套主庫,一套從庫
從庫採用單機多例項模式為3套主庫提供hot standby 備庫,用以日常報表,查詢,不做業務支援。
歡迎各位同學提出寶貴意見。
PS : heartbeat 提供的pgsql 的啟動是不支援hot standby 切換的,我們在從庫的程式碼上了適當修改。
主要修改原則,在前面的文章裡已經做了說明了。
有需要的同學聯絡我。
下面是HA 的配置: 系統原則不變,遮蔽了部分敏感資訊。
實施策略本著省錢夠用的原則,採用了3拖一方案
3套主庫,一套從庫
從庫採用單機多例項模式為3套主庫提供hot standby 備庫,用以日常報表,查詢,不做業務支援。
歡迎各位同學提出寶貴意見。
PS : heartbeat 提供的pgsql 的啟動是不支援hot standby 切換的,我們在從庫的程式碼上了適當修改。
主要修改原則,在前面的文章裡已經做了說明了。
有需要的同學聯絡我。
下面是HA 的配置: 系統原則不變,遮蔽了部分敏感資訊。
node db1 node db2 node db3 node db4 primitive fence_x stonith:fence_ipmilan \ params ipaddr="10.10.x.x" login="USER" passwd="PASSWD" lanplus="true" action="reboot" pcmk_reboot_action="reboot" pcmk_host_list=" db1 db2 db3 db4 " pcmk_monitor_action="status" \ op monitor interval="30s" timeout="60s" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ meta. target-role="Started" primitive fence_y stonith:fence_ipmilan \ params ipaddr="10.10.y.y" login="USER" passwd="PASSWD" lanplus="true" action="reboot" pcmk_reboot_action="reboot" pcmk_host_list=" db1 db2 db3 db4 " pcmk_monitor_action="status" \ op monitor interval="30s" timeout="60s" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ meta. target-role="Started" primitive fence_s stonith:fence_ipmilan \ params ipaddr="10.10.s.s" login="USER" passwd="PASSWD" lanplus="true" action="reboot" pcmk_reboot_action="reboot" pcmk_host_list=" db1 db2 db3 db4 " pcmk_monitor_action="status" \ op monitor interval="30s" timeout="60s" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ meta. target-role="Started" primitive fence_214 stonith:fence_ipmilan \ params ipaddr="10.10.w.w" login="USER" passwd="PASSWD" lanplus="true" action="reboot" pcmk_reboot_action="reboot" pcmk_host_list=" db1 db2 db3 db4 " pcmk_monitor_action="status" \ op monitor interval="30s" timeout="60s" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ meta. target-role="Started" primitive ping ocf:pacemaker:ping \ params host_list=" 192.168.x.x 192.168.x.v 192.168.y.y 192.168.y.v 192.168.w.w 192.168.w.v 192.168.s.s 192.168.g.w" multiplier="100" \ op monitor interval="10s" timeout="60s" \ op start interval="0" timeout="60s" \ op stop interval="0" timeout="60s" primitive postgres_sdb2 ocf:heartbeat:pgsql \ params pgctl="/usr/local/pgsql/bin/pg_ctl" psql="/usr/local/pgsql/bin/psql" pgport="5433" start_opt="" pgdata="/usr/local/pgsql/data_db2" config="/usr/local/pgsql/data_db2/postgresql.conf" pgdba="postgres" pgdb="postgres" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ op monitor interval="10s" timeout="60s" fail-count="10000" \ meta. target-role="Started" primitive postgres_sdb1 ocf:heartbeat:pgsql \ params pgctl="/usr/local/pgsql/bin/pg_ctl" psql="/usr/local/pgsql/bin/psql" pgport="5432" start_opt="" pgdata="/usr/local/pgsql/data_db1" config="/usr/local/pgsql/data_db1/postgresql.conf" pgdba="postgres" pgdb="postgres" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ op monitor interval="10s" timeout="30s" fail-count="10000" \ meta. target-role="Started" is-managed="true" primitive postgres_sdb3 ocf:heartbeat:pgsql \ params pgctl="/usr/local/pgsql/bin/pg_ctl" psql="/usr/local/pgsql/bin/psql" pgport="5434" start_opt="" pgdata="/usr/local/pgsql/data_db3" config="/usr/local/pgsql/data_db3/postgresql.conf" pgdba="postgres" pgdb="postgres" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="120s" \ op monitor interval="10s" timeout="30s" fail-count="10000" \ meta. target-role="Started" is-managed="true" primitive vip_sdb2 ocf:heartbeat:IPaddr2 \ params ip="192.168.x.v" cidr_netmask="22" nic="eth1" flush_routes="true" \ op monitor interval="10s" failure-timeout="60s" \ op start interval="0" timeout="30s" \ op stop interval="0" timeout="30s" \ meta. target-role="Started" is-managed="true" primitive vip_sdb1 ocf:heartbeat:IPaddr2 \ params ip="192.168.y.v" cidr_netmask="22" nic="eth1" flush_routes="true" \ op monitor interval="10s" failure-timeout="60s" \ op start interval="0" timeout="30s" \ op stop interval="0" timeout="30s" \ meta. target-role="Started" is-managed="true" primitive vip_sdb3 ocf:heartbeat:IPaddr2 \ params ip="192.168.s.v" cidr_netmask="22" nic="eth1" flush_routes="true" \ op monitor interval="10s" failure-timeout="60s" \ op start interval="0" timeout="30s" \ op stop interval="0" timeout="30s" \ meta. target-role="Started" is-managed="true" clone clone-ping ping \ meta. global-unique="true" target-role="Started" location LOC-fence-211-NOT-x.x fence_211 -inf: db1 location LOC-fence-211-ON-y.y fence_211 1000: db2 location LOC-fence-211-ON-w.w fence_211 500: db3 location LOC-fence-211-ON-s.s fence_211 100: db4 location LOC-fence-212-NOT-y.y fence_212 -inf: db2 location LOC-fence-212-ON-x.x fence_212 100: db1 location LOC-fence-212-ON-w.w fence_212 1000: db3 location LOC-fence-212-ON-s.s fence_212 500: db4 location LOC-fence-213-NOT-w.w fence_213 -inf: db3 location LOC-fence-213-ON-x.x fence_213 500: db1 location LOC-fence-213-ON-y.y fence_213 100: db2 location LOC-fence-213-ON-s.s fence_213 1000: db4 location LOC-fence-214-NOT-s.s fence_214 -inf: db4 location LOC-fence-214-ON-x.x fence_214 1000: db1 location LOC-fence-214-ON-y.y fence_214 500: db2 location LOC-fence-214-ON-w.w fence_214 100: db3 location LOC-pg-sdb2-NOT-x.x postgres_sdb2 -inf: db1 location LOC-pg-sdb2-NOT-w.w postgres_sdb2 -inf: db3 location LOC-pg-sdb2-ON-y.y postgres_sdb2 1000: db2 location LOC-pg-sdb2-ON-s.s postgres_sdb2 500: db4 location LOC-pg-sdb1-NOT-y.y postgres_sdb1 -inf: db2 location LOC-pg-sdb1-NOT-w.w postgres_sdb1 -inf: db3 location LOC-pg-sdb1-ON-x.x postgres_sdb1 1000: db1 location LOC-pg-sdb1-ON-s.s postgres_sdb1 500: db4 location LOC-pg-sdb3-NOT-x.x postgres_sdb3 -inf: db1 location LOC-pg-sdb3-NOT-y.y postgres_sdb3 -inf: db2 location LOC-pg-sdb3-ON-w.w postgres_sdb3 1000: db3 location LOC-pg-sdb3-ON-s.s postgres_sdb3 500: db4 location LOC-vip-sdb2-NOT-x.x vip_sdb2 -inf: db1 location LOC-vip-sdb2-NOT-w.w vip_sdb2 -inf: db3 location LOC-vip-sdb2-No-connect vip_sdb2 \ rule $id="LOC-vip-sdb2-No-connect-rule" -inf: pingd lt 200 and #uname eq db3 location LOC-vip-sdb2-ON-y.y vip_sdb2 1000: db2 location LOC-vip-sdb2-ON-s.s vip_sdb2 500: db4 location LOC-vip-sdb1-NOT-y.y vip_sdb1 -inf: db2 location LOC-vip-sdb1-NOT-w.w vip_sdb1 -inf: db3 location LOC-vip-sdb1-No-connect vip_sdb1 \ rule $id="LOC-vip-sdb1-No-connect-rule" -inf: pingd lt 200 and #uname eq db1 location LOC-vip-sdb1-ON-x.x vip_sdb1 1000: db1 location LOC-vip-sdb1-ON-s.s vip_sdb1 500: db4 location LOC-vip-PCONLIEN-NOT-x.x vip_sdb3 -inf: db1 location LOC-vip-PCONLIEN-NOT-y.y vip_sdb3 -inf: db2 location LOC-vip-PCONLIEN-ON-w.w vip_sdb3 1000: db3 location LOC-vip-sdb3-No-connect vip_sdb3 \ rule $id="LOC-vip-sdb3-No-connect-rule" -inf: pingd lt 200 and #uname eq db3 location LOC-vip-sdb3-ON-s.s vip_sdb3 500: db4 colocation COL-pg-vip-sdb2 inf: postgres_sdb2 vip_sdb2 colocation COL-pg-vip-sdb1 inf: postgres_sdb1 vip_sdb1 colocation COL-pg-vip-sdb3 inf: postgres_sdb3 vip_sdb3 colocation COL-vip-pg-sdb2 inf: vip_sdb2 postgres_sdb2 colocation COL-vip-pg-sdb1 inf: vip_sdb1 postgres_sdb1 colocation COL-vip-pg-sdb3 inf: vip_sdb3 postgres_sdb3 order ORDER-pg-vip-sdb1 inf: postgres_sdb1 vip_sdb1 order ORDER-pg-vip-sdb3 inf: postgres_sdb3 vip_sdb3 order ORDER-vip-pg-sdb1 inf: postgres_sdb2 vip_sdb2 property $id="cib-bootstrap-options" \ dc-version="1.1.7-6.el6-148fccfd5985c5590cc601123c6c16e966b85d14" \ cluster-infrastructure="openais" \ expected-quorum-votes="5" \ no-quorum-policy="ignore" \ stonith-enabled="true" \ cluster-delay="60s" \ last-lrm-refresh="1370659086" rsc_defaults $id="rsc-options" \ resource-stickiness="5000" |
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/133735/viewspace-763604/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 一個比較靠譜的 pacemaker 配置 ms 模式 pg 資料庫模式資料庫
- PostgreSQL基於Pacemaker+Corosync+pcs的高可用SQLROS
- pg資料庫基於HA 的failover 測試通過資料庫AI
- pg 資料庫HA 啟動指令碼的兩個假設資料庫指令碼
- 基於PMEM的PG資料庫Memhive資料庫Hive
- 高可用叢集之corosync+pacemakerROS
- 基於linux-HA 的pg 高可用平臺正式部署Linux
- Mysql+Corosync+Pacemaker+DRBD構建高可用MMySqlROS
- linux-HA 系統運用在pg資料庫的一些想法Linux資料庫
- DRBD+ CoroSync + PaceMaker實現 MySQL之高可用(物理同步)ROSMySql
- 高可用叢集corosync+pacemaker之crmsh使用(一)ROS
- 高可用叢集corosync+pacemaker之crmsh使用(二)ROS
- corosync+pacemaker+http高可用操作手記薦ROSHTTP
- 【PG資料庫】PG資料庫的安裝及連線方法資料庫
- 一個4節點Hadoop叢集的配置示例Hadoop
- 高可用叢集corosync+pacemaker之pcs安裝使用ROS
- RAC資料庫只能啟動一個節點的故障資料庫
- MySQL on Azure高可用性設計 DRBD - Corosync - Pacemaker - CRM (二)MySqlROS
- MySQL on Azure高可用性設計 DRBD - Corosync - Pacemaker - CRM (一)MySqlROS
- 基於pacemaker 的高可用叢集架構----2 一個示例架構
- 基於知識圖譜與異常檢測的PG資料庫故障定位資料庫
- 資料庫週刊18│4月資料庫排行;PG是最好的資料庫;TiDB 4.0新特性資料庫TiDB
- PG 資料庫 從阿里雲pg rds 同步資料。資料庫阿里
- mongo資料庫單節點搭建Go資料庫
- pg_resetwal pg_resetxlog 重整 pg資料庫 wal 與pg_controldata 。 資料庫恢復。資料庫LDA
- Hadoop-HA節點介紹Hadoop
- 4 為效能配置資料庫資料庫
- 第 4 節:基礎資料型別資料型別
- 5個基於JAVA的開源NoSQL資料庫JavaSQL資料庫
- 8月資料庫排行:Oracle 節節攀升,PG 和 MongoDB 分數再現下跌資料庫OracleMongoDB
- 某資料庫的節點4因網路問題,主機關閉資料庫
- RMAN基於時間點恢復Oracle資料庫Oracle資料庫
- 資料庫開發(19)基於物件的資料庫資料庫物件
- PG資料庫運維中的作業系統關注點資料庫運維作業系統
- 處理rac資料庫一個節點監聽異常資料庫
- ORACLE資料庫基於時間點的不完全恢復Oracle資料庫
- 站點資訊配置-使用資料庫資料庫
- SQL Server AlwaysOn配置兩個節點加共享資料夾仲裁見證SQLServer