pikesaku’s blog

個人的なプログラム勉強メモです。記載内容について一切の責任は持ちません。

OpenStack環境構築メモ(Pacemaker & Corosyncセットアップ)

参考

OpenStack Docs: Pacemaker cluster stack
 
DBクラスタセットアップ実施後に、以下作業をコントローラ3台に実施する。
 

①Pacemaker & Corosyncインストール

$ sudo apt -y install crmsh

 

②設定ファイル編集

/etc/corosync/corosync.conf

totem {
	version: 2
	cluster_name: debian
	token: 3000
	token_retransmits_before_loss_const: 10
	clear_node_high_bit: yes
	crypto_cipher: none
	crypto_hash: none
	interface {
		ringnumber: 0
		bindnetaddr: 192.168.1.0
		broadcast: yes
		mcastport: 5405
		ttl: 1
	}
}

logging {
	fileline: off
	to_stderr: no
	to_logfile: no
	to_syslog: yes
	syslog_facility: daemon
	debug: off
	timestamp: on
	logger_subsys {
		subsys: QUORUM
		debug: off
	}
}

quorum {
	provider: corosync_votequorum
	expected_votes: 2
}

nodelist {
	node {
		ring0_addr: 192.168.1.51
		nodeid: 1
	}
	node {
		ring0_addr: 192.168.1.52
		nodeid: 2
	}
	node {
		ring0_addr: 192.168.1.53
		nodeid: 3
	}
} 

 

③Corosync再起動

$ sudo systemctl stop corosync
$ sudo systemctl start corosync

 

④動作確認

$ sudo corosync-cfgtool -s
Printing ring status.
Local node ID 1
RING ID 0
	id	= 192.168.1.51
	status	= ring 0 active with no faults

※statusがno faultsであること
 

$ sudo corosync-cmapctl runtime.totem.pg.mrp.srp.members
runtime.totem.pg.mrp.srp.members.1.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.1.ip (str) = r(0) ip(192.168.1.51) 
runtime.totem.pg.mrp.srp.members.1.join_count (u32) = 1
runtime.totem.pg.mrp.srp.members.1.status (str) = joined
runtime.totem.pg.mrp.srp.members.2.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.2.ip (str) = r(0) ip(192.168.1.52) 
runtime.totem.pg.mrp.srp.members.2.join_count (u32) = 1
runtime.totem.pg.mrp.srp.members.2.status (str) = joined
runtime.totem.pg.mrp.srp.members.3.config_version (u64) = 0
runtime.totem.pg.mrp.srp.members.3.ip (str) = r(0) ip(192.168.1.53) 
runtime.totem.pg.mrp.srp.members.3.join_count (u32) = 1
runtime.totem.pg.mrp.srp.members.3.status (str) = joined

※statusがjoinedであること
 

⑤Pacemaker再起動

$ sudo systemctl restart pacemaker

 

⑥Pacemaker起動確認

$  sudo crm_mon -1
Last updated: Sat Nov  4 00:27:14 2017		Last change: Sat Nov  4 00:25:10 2017 by hacluster via crmd on cnt1
Stack: corosync
Current DC: cnt1 (version 1.1.14-70404b0) - partition with quorum
3 nodes and 0 resources configured

Online: [ cnt1 cnt2 cnt3 ]

※Onlineに3台表示されること
 

⑦Pacemaker設定

cnt1のみで以下を実施
 
プロパティ設定

$ sudo crm configure property pe-warn-series-max="1000" pe-input-series-max="1000" pe-error-series-max="1000" cluster-recheck-interval="5min" no-quorum-policy="ignore" stonith-enabled=false
$  

 
VIP設定

$ sudo crm configure primitive vip-public ocf:heartbeat:IPaddr2 params ip="192.168.0.50" cidr_netmask="24" op monitor interval="30s"  
$ sudo crm configure primitive vip-local ocf:heartbeat:IPaddr2 params ip="192.168.1.50" cidr_netmask="24" op monitor interval="30s"