Heartbeat Score的計算-+colocation
再次研究COLOCATION,希望其能在<2resource2group4score>的配置環境中起作用,(限制兩個資源跑到一起)。
1,配置:在<2resource2group4score>CIB.XML中,
...
...
1,配置:在<2resource2group4score>CIB.XML中,
...
...
加完以後,請用crm_verify -V -x cib.xml 檢查是否有配置錯誤.
2,積分的檢視計算
2.1 積分的檢視
[root@MYSQL4 crm]# 2>&1 /usr/heartbeat/sbin/ptest -LVVVVVVVV|grep -E "dump_node_scores"
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_1 allocation score on mysql4: 0
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_1 allocation score on mysql3: 5
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: IPaddr_10_2_225_225 allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: IPaddr_10_2_225_225 allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: IPaddr_10_2_225_225 allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: IPaddr_10_2_225_225 allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_mysql allocation score on mysql4: 0
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_mysql allocation score on mysql3: 5
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Post-coloc: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Post-coloc: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: native_color: mysql allocation score on mysql4: 400
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: native_color: mysql allocation score on mysql3: 420
IPaddr.SCORE = Pre-allloc: IPaddr_10_2_225_225
Mysql.SCORE = Pre-allloc: mysql
綜合all.SCORE = native_color: mysql 用來判決是否切換
2.1 積分的檢視
[root@MYSQL4 crm]# 2>&1 /usr/heartbeat/sbin/ptest -LVVVVVVVV|grep -E "dump_node_scores"
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_1 allocation score on mysql4: 0
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_1 allocation score on mysql3: 5
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: IPaddr_10_2_225_225 allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: IPaddr_10_2_225_225 allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: IPaddr_10_2_225_225 allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: IPaddr_10_2_225_225 allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_mysql allocation score on mysql4: 0
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: group_mysql allocation score on mysql3: 5
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: group_color: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Pre-allloc: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Post-coloc: mysql allocation score on mysql4: 100
ptest[5808]: 2009/11/25_17:33:10 debug: debug3: dump_node_scores: Post-coloc: mysql allocation score on mysql3: 105
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: native_color: mysql allocation score on mysql4: 400
ptest[5808]: 2009/11/25_17:33:10 debug: debug2: dump_node_scores: native_color: mysql allocation score on mysql3: 420
IPaddr.SCORE = Pre-allloc: IPaddr_10_2_225_225
Mysql.SCORE = Pre-allloc: mysql
綜合all.SCORE = native_color: mysql 用來判決是否切換
2.2 積分的計算
注:以下所有得出的結論是基於<2resource2group4score> + colocation 的配置環境測試的。
(1個資源組只配置1個資源,簡稱其cib.xml原文見 http://steven1981.itpub.net/post/7967/494030)
注:以下所有得出的結論是基於<2resource2group4score> + colocation 的配置環境測試的。
(1個資源組只配置1個資源,簡稱其cib.xml原文見 http://steven1981.itpub.net/post/7967/494030)
0)資源要切換不再以單個資源的分數來比較. 而是以該NODE的N個資源SCORE之和,再乘N,我們下面稱它為
NodeX.all.score= (mysqlX.resource1.score+ .... + mysqlX.resourceN.score) *N
1)當HB發生NodeX資源失敗時,會給該NODE
NodeX.resourceN.score += default-resource-failure-stickiness
NodeX.resourceN.score -= default-resource-stickiness
NodeX.resourceN.score += default-resource-stickiness
NodeX.all.score = (NodeX.resource1.score + ...... + NodeX.resourceN.score)* N
然後多個NODE之間比較NodeX.all.score
2)當HB發現NodeX上資源發生切換到"NodeY" 時,會減去之前賦給該NODE的"成功分:default-resource-stickiness",
NodeX.resource[1..N].score -= default-resource-stickiness
NodeY.resource[1..N].score += default-resource-stickiness
NodeX.all.score = NodeX.resource1.score + ...... + NodeX.resourceN.score
NodeY.all.score = NodeY.resource1.score + ...... + NodeY.resourceN.score
3)其他演算法同配置<2resource2group4score>.
NodeX.all.score= (mysqlX.resource1.score+ .... + mysqlX.resourceN.score) *N
1)當HB發生NodeX資源失敗時,會給該NODE
NodeX.resourceN.score += default-resource-failure-stickiness
NodeX.resourceN.score -= default-resource-stickiness
NodeX.resourceN.score += default-resource-stickiness
NodeX.all.score = (NodeX.resource1.score + ...... + NodeX.resourceN.score)* N
然後多個NODE之間比較NodeX.all.score
2)當HB發現NodeX上資源發生切換到"NodeY" 時,會減去之前賦給該NODE的"成功分:default-resource-stickiness",
NodeX.resource[1..N].score -= default-resource-stickiness
NodeY.resource[1..N].score += default-resource-stickiness
NodeX.all.score = NodeX.resource1.score + ...... + NodeX.resourceN.score
NodeY.all.score = NodeY.resource1.score + ...... + NodeY.resourceN.score
3)其他演算法同配置<2resource2group4score>.
3,例子以及測試資料。
例1: default-resource-stickiness=5 default-resource-failure-stickiness=-15 mysql4.ipaddr.score=100 mysql3.ipaddr.score=100 mysql4.mysql.score=100 mysql3.mysql.score=101 | ||||||||||
SCORE | Resource Status | Action | MEMO | |||||||
mysql3.ipaddr | mysql4.ipaddr | mysql3.mysql | mysql4.mysql | mysql3.all | mysql4.all | mysql3.status | mysql4.status | seq | operation | |
105 | 100 | 106 | 100 | 422 | 400 | Ipaddr/mysql | 1 | Start | ||
90 | 100 | 106 | 100 | 392 | 400 | 2 | mysql3.ipaddr down | 中間計算,HB認為需要切換 | ||
85 | 105 | 101 | 105 | 372 | 420 | Ipaddr/mysql | 這時可以mysql3.HB restart,以置回初值 | |||
100 | 105 | 101 | 105 | 402 | 420 | 3 | mysql3.HB restart | |||
下面不演示也去了。與前面的計算也很類似。
有興趣的同學,可以先把分數計算好,然後再看看HB的結果。
有興趣的同學,可以先把分數計算好,然後再看看HB的結果。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/703656/viewspace-1029075/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Heartbeat Score的計算-
- Heartbeat Score的計算(轉)
- 分類模型的F1-score、Precision和Recall 計算過程模型
- ES 筆記二十五:綜合排序 Function Score Query 優化算分筆記排序Function優化
- Oracle Heartbeat研究Oracle
- heartbeat錯誤排查
- linux heartbeat mysqlLinuxMySql
- heartbeat下載地址
- Heartbeat3.x應用全攻略之: 測試Heartbeat的HA功能薦
- 機器學習中的 precision、recall、accuracy、F1 Score機器學習
- 深入理解F1-score
- SAP Hybris Helps NHL Score with Fans
- 雲端計算,網格計算,分散式計算,叢集計算的區別?分散式
- DB2 HADR的heartbeat檢測DB2
- 基於heartbeat的NFS HA實現(轉)NFS
- 基於heartbeat的NFS HA實現 (轉)NFS
- HA叢集heartbeat配置--NginxNginx
- heartbeat安裝配置實驗
- linux-ha heartbeat 搭建Linux
- MySQL + Heartbeat + DRBD架構部署MySql架構
- Elasticsearch複合查詢—constant score queryElasticsearch
- Heartbeat實現LVS的故障轉移
- 計算機計算小數除法的陷阱計算機
- heartbeat+drbd+nfs安裝配置NFS
- Mysql 雙主 + heartbeat + Mon 部署文件MySql
- 冪的計算
- 音量的計算
- 邊緣計算與雲端計算的未來
- seconds_behind_master的陷阱和pt-heartbeatAST
- mysql 的一個監控指令碼,監控heartbeatMySql指令碼
- 威爾遜得分 Wilson Score 排序演算法排序演算法
- mysql GROUP_CONCAT(test_score) 很好的拼字元的函式MySql字元函式
- 本地計算、雲端計算、霧計算、邊緣計算有什麼區別?
- word公式怎麼計算 word公式計算的方法公式
- 圖計算 on nLive:Nebula 的圖計算實踐
- Tableau的計算欄位、粒度、聚合、比率、表計算
- 雲端計算與網格計算的深入比較
- 【計算機組成原理】第6章 計算機的運算方法計算機