OpenStack的高可用系統構建(2)
1.1.1 共同包的安裝
ntp伺服器安裝
yum install ntp vi /etc/ntp.conf # Hosts on local network are less restricted. #restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap ←指定訪問範圍 # Use public servers from the pool.ntp.org project. # Please consider joining the pool (). #server 0.centos.pool.ntp.org iburst ←Internet伺服器,不需要進行註釋 #server 1.centos.pool.ntp.org iburst #server 2.centos.pool.ntp.org iburst #server 3.centos.pool.ntp.org iburst server 127.127.1.0 #local clock ←hacontroller1指定為自己 fudge 127.127.1.0 stratum 10
service ntpd start chkconfig ntpd on |
安裝前先停止firewall
service iptables stop chkconfig iptabls off |
1.1.2 安裝 pacemarker+corosync
1.1.2.1 安裝 pacemakerとcorosync
yum install pacemaker corosync cluster-glue resource-agents |
1.1.2.2 corosync.conf檔案設定
設定/etc/corosync/corosync.conf為下面方式
totem { version: 2 secauth: off threads: 0 rrp_mode: active clear_node_high_bit: yes token: 4000 consensus: 10000 rrp_problem_count_timeout: 3000 interface { ←心跳用的NIC,可以設定為多個 ringnumber: 0 bindnetaddr: 192.168.3.0 ← 並非內網NIC的IP,而是網路地址 mcastaddr: 226.94.1.1 mcastport: 5405 ← 多個pacemaker網路卡使用同樣LAN,可以變更埠號。 } } logging { fileline: on to_syslog: yes syslog_facility: local1 syslog_priority: info debug: off timestamp: on } |
1.1.2.3 啟動服務
啟動Corosyncs,Pacemaker服務
service corosync start chkconfig corosync on service corosync start chkconfig corosync on |
1.1.2.4 檢查通訊狀態
(1)corosync-cfgtool命令獲得通訊健康狀態。
[root@hacontroller1 ~]# corosync-cfgtool -s Printing ring status. Local node ID 33794240 RING ID 0 id = 192.168.3.2 status = ring 0 active with no faults [root@hacontroller2 ~]# corosync-cfgtool -s Printing ring status. Local node ID 50571456 RING ID 0 id = 192.168.3.2 status = ring 0 active with no faults |
(2)corosync-objctl參加HA的成員一覽
[root@hacontroller1 ~]# corosync-objctl runtime.totem.pg.mrp.srp.members runtime.totem.pg.mrp.srp.33794240.ip=r(0) ip(192.168.3.2) runtime.totem.pg.mrp.srp.33794240.join_count=1 runtime.totem.pg.mrp.srp.33794240.status=joined runtime.totem.pg.mrp.srp.50571456.ip=r(0) ip(192.168.3.3) runtime.totem.pg.mrp.srp.50571456.join_count=1 runtime.totem.pg.mrp.srp.50571456.status=joined |
到大部分不會發生大的錯誤。
1.1.2.5 pacemaker plugin
使用下面的命令來新增pacemaker plugin到corosync服務。
cat <>/etc/corosync/service.d/pcmk service { # Load the Pacemaker Cluster Resource Manager name: pacemaker ver: 1 } END |
※上面的操作手冊沒有記載,當時如果直接啟動pacemaker,就會失敗,必須進行上面的設定。
1.1.2.6 啟動pacemaker
(1)重新啟動corosync服務,載入pacemaker服務
[root@hacontroller2 ~]# service corosync restart Signaling Corosync Cluster Engine (corosync) to terminate: [ OK ] Waiting for corosync services to unload:. [ OK ] Starting Corosync Cluster Engine (corosync): [ OK ] |
(2)啟動packmaker服務
[root@hacontroller1 ~]# service pacemaker start Starting Pacemaker Cluster Manager [ OK ] |
(3)crm_mon命令來檢視pacemaker服務的狀態。
Last updated: Mon Mar 11 11:08:38 2013 Last change: Mon Mar 11 11:07:16 2013 via crmd on hacontroller1 Stack: classic openais (with plugin) Current DC: hacontroller1 - partition with quorum Version: 1.1.10-14.el6_5.2-368c726 2 Nodes configured, 2 expected votes 0 Resources configured
Online: [ hacontroller1 hacontroller2 ] |
1.1.2.7 pacemaker/corosync自動啟動
[root@hacontroller1 ~]# chkconfig corosync on [root@hacontroller1 ~]# chkconfig pacemaker on |
1.1.2.8 設定叢集的屬性
(1)安裝crmsh
pacemaker叢集屬性必須使用crm命令列,從pacemaker 1.1.8開始crm作為獨立的專案crmsh,從下面的網址下載,安裝。
wget -P /etc/yum.repos.d/ yum -y install crmsh |
※在手冊沒有相關的說明。
設定pacemaker叢集屬性。crm configure命令,設定下面的屬性。
property no-quorum-policy=ignore \
pe-warn-series-max="1000" \
pe-input-series-max="1000" \
pe-error-series-max="1000" \
cluster-recheck-interval="5min"
※no-quorum-policy=ignore當只有兩個節點時需要設定。兩節點以上時不要進行設定。
※pe-warn-series-max,
pe-input-series-max and pe-errorseries-max設定為1000,可以儲存更多的歷史紀錄。
※將叢集的檢查期間設定為5分鐘。
[root@hacontroller1 ~]# crm configure crm(live)configure# property no-quorum-policy=ignore \ > pe-warn-series-max="1000" \ > pe-input-series-max="1000" \ > pe-error-series-max="1000" \ > cluster-recheck-interval="5min" crm(live)configure# |
到此,控制節點和網路節點所使用的pacemaker/corosysnc的安裝完畢。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18455/viewspace-1126155/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 構建持續高可用系統的破局之道
- 華為雲FunctionGraph構建高可用系統的實踐Function
- Activemq構建高併發、高可用的大規模訊息系統MQ
- 【轉】如何建設高可用系統
- 構建生產環境可用的高可用kubernetes叢集
- 用 Hystrix 構建高可用服務架構架構
- 搭建高併發、高可用的系統
- Packer構建openStack映象
- 使用Keepalived構建LVS高可用叢集
- 降本增笑P0事故頻發,構建持續高可用系統的破局之道
- 如何快速構建服務發現的高可用能力
- 構建MHA實現MySQL高可用叢集架構MySql架構
- Mysql+Corosync+Pacemaker+DRBD構建高可用MMySqlROS
- 金融級系統海量流量下高可用架構的道與術架構
- Kubernetes — 在 OpenStack 上使用 kubeadm 部署高可用叢集
- RabbitMQ從零到叢集高可用(.NetCore5.0) -高可用叢集構建落地MQNetCore
- 高可用架構架構
- 高可用訂單系統設計
- 如何構建高可用、高併發、高效能的雲原生容器網路?
- 使用Redis構建高併發高可靠的秒殺拍賣系統 - LuisRedisUI
- LVS + Keepalived + Nginx基於DR模式構建高可用方案Nginx模式
- 高可用高可靠系統設計中的重試機制
- 智慧金融系統的構建
- Gitlab倉庫管理系統-高可用部署Gitlab
- 基於Redis的低成本高可用排行榜服務構建Redis
- 基於 Apache ShardingSphere 構建高可用分散式資料庫Apache分散式資料庫
- 整合LlamaIndex與LangChain構建高階的查詢處理系統IndexLangChain
- java B2B2C springmvc mybatis多租戶電子商城系統--Zuul的高可用JavaSpringMVCMyBatisZuul
- 如何設計一個高可用的運營系統
- kolla-ansible安裝openstack(rocky)企業級高可用叢集
- MySQL 高擴充套件架構構建百萬線上系統實踐MySql套件架構
- 利用 K8S 的反親和性構建高可用應用K8S
- 構建高可用性、高效能和可擴充套件的Zabbix Server架構套件Server架構
- 如何在大促中做好系統高可用
- 工作十年,談談我的高可用架構和系統設計經驗架構
- SpringCloud微服務雲架構構建B2B2C電子商務平臺之-(十)高可用的服務註冊中心SpringGCCloud微服務架構
- RabbitMQ(四):使用Docker構建RabbitMQ高可用負載均衡叢集MQDocker負載
- Mysql高可用架構方案MySql架構
- Canal高可用架構部署架構