LoginSignup
1
3

More than 5 years have passed since last update.

数分で構築できた!ansibleでCent7 Pacemaker/Corosync

Last updated at Posted at 2017-03-28

使用したもの

Ansible playbooks for Linux-HA Japan Pacemaker repository package.
https://github.com/kskmori/ansible-pacemaker/

前提

  • Cent7をインストールしたマシンを2台(ha1,ha2)用意
  • ansibleサーバーは別途用意せずha1で実行

/etc/hosts編集

pacemakerに設定するのと同じhosts名を付けておきます。

gitとansibleをインストールし、playbookをclone


yum install epel-release
yum install ansible --enablerepo=epel
yum install git
git clone https://github.com/kskmori/ansible-pacemaker.git

cloneしてきたansible-pacemakerディレクトリに移動して編集

  • ユニキャストの場合はhosts.sample.udpuをベースに
  • hosts.sampleだとマルチキャストの設定

known_hosts登録

ansibleがこけないように、1回SSHで繋いでおきます。


ssh ha2

playbookの実行

(1)から順番に実行していきます。
SSH鍵認証設定していないので、最後に-kオプションを付けてパスワード認証します。


ansible-playbook 00-download.yml -k

ha1,ha2生成された設定ファイルを確認


/etc/corosync/corosync.conf
/etc/sysconfig/pacemaker

corosync.confなどを再設定したい場合

ansible-playbook -i hosts 10-pacemaker-install.yml
を再実行するとまたインストールから始まってしまうので、
roles/pacemaker-install/tasks/pacemaker-install.yml
でconfファイルの生成部分だけ抜粋した方がよいかも・・

感想

ansibleでconfファイルを生成すると設定間違いがなくていいですね。
linux-haのサイトはきちんと熟読しなくては・・

Pacemaker-1.1.15-1.1 リポジトリパッケージ

1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3