Skip to content

Instantly share code, notes, and snippets.

@takehironet
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takehironet/1469bd7123f63d61f843 to your computer and use it in GitHub Desktop.
Save takehironet/1469bd7123f63d61f843 to your computer and use it in GitHub Desktop.
auth 1
1 sha1 abcdefg
# 設定内容に意味はありません
primitive dummy Dummy
primitive dummy2 Dummy \
meta target-role=Started
colocation dummies-colocation -inf: dummy:Started dummy2:Stopped
property cib-bootstrap-options: \
stonith-enabled=false
rsc_defaults rsc-options: \
resource-stickiness=200 \
migration-threshold=1

Debian 7.8にHeartbeat 3.0.6 + Pacemaker 1.1.12をインストール

下準備

groupadd -r haclient
useradd -g haclient -r -M -s /bin/false hacluster
apt-get install build-essential mercurial git \
  autoconf pkg-config xsltproc libxslt1-dev docbook-xsl \
  libxml2-dev libglib2.0-dev libbz2-dev uuid-dev \
  libncurses5-dev python-lxml
cd ~
mkdir -v build
cd build

Cluster-glue

hg clone http://hg.linux-ha.org/glue
cd glue
hg checkout glue-1.0.12
./autogen.sh
./configure --prefix=/usr/local/heartbeat \
            --localstatedir=/var --sysconfdir=/etc --disable-doc
make
su
make install
exit
cd ../

resource-agents

git clone https://github.com/ClusterLabs/resource-agents.git
cd resource-agents
git checkout v3.9.6
./autogen.sh
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
make
su
make install
exit
cd ../

Heartbeat 3.0.6

hg clone http://hg.linux-ha.org/heartbeat-STABLE_3_0
cd heartbeat-STABLE_3_0
hg checkout STABLE-3.0.6
./bootstrap
CFLAGS="$CFLAGS -L/usr/local/heartbeat/lib \
                -I/usr/local/heartbeat/include \
                -I/usr/local/heartbeat/include/heartbeat \
                -I/usr/local/heartbeat/include/clplumbing" \
./configure \
  --bindir=/usr/local/bin \
  --sbindir=/usr/local/sbin \
  --prefix=/usr/local/heartbeat \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/share/man \
  --disable-fatal-warnings \
  --disable-rpath
make
su
make install
exit
cd ../

libqb 0.17.1

git clone https://github.com/ClusterLabs/libqb.git
cd libqb
git checkout v0.17.1
./autogen.sh
./configure \
  --prefix=/usr \
  --sysconfdir=/etc \
  --localstatedir=/var
make
su
make install
exit
cd ../

Pacemaker 1.1.12

git clone https://github.com/ClusterLabs/pacemaker.git
cd pacemaker
git checkout Pacemaker-1.1.12
./autogen.sh
CFLAGS="$CFLAGS -L/usr/local/heartbeat/lib \
                -I/usr/local/heartbeat/include \
                -I/usr/local/heartbeat/include/heartbeat" \
./configure \
  --bindir=/usr/local/bin \
  --sbindir=/usr/local/sbin \
  --prefix=/usr/local/heartbeat \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/share/man \
  --docdir=/usr/share/doc/pacemaker \
  --with-heartbeat \
  --without-cman \
  --without-corosync \
  --without-ais \
  --with-acl
make
su
make install
exit
cd ../

crmsh 2.1.2

git clone https://github.com/ClusterLabs/crmsh.git
cd crmsh
git checkout 2.1.2
./autogen.sh
CFLAGS="$CFLAGS -L/usr/local/heartbeat/lib \
                -I/usr/local/heartbeat/include \
                -I/usr/local/heartbeat/include/heartbeat \
                -I/usr/local/heartbeat/include/pacemaker" \
PYTHON=$(which python) \
./configure \
  --prefix=/usr/local \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/share/man
make
su
make install
exit
cd ../

動作確認

Heartbeatの設定

vim /etc/ha.d/ha.cf
# ha.cfを設定
vim /etc/ha.d/authkeys
# authkeysを設定
chmod 600 /etc/ha.d/authkeys

動作確認

/etc/init.d/heartbeat start
vim ~/crm.txt
# crm.txtを作成
crm configure load update ~/crm.txt
crm_mon -Aortf
pacemaker on
logfacility local1
debug 0
udpport 694
bcast eth0
keepalive 2
warntime 20
deadtime 24
initdead 48
node debian
@HideoYamauchi
Copy link

私がdebian不慣れなせいかも知れませんが・・・・debian7.8上の最初の準備が私の環境では違いました。
#単に、事前にリポジトリなどを追加すればよいだけなのかも知れませんが。。。

  1. apt-getでlibslt1-dev,uuid-devは、デフォルト設定のままでは、インストールできず、https://packages.debian.org/wheezy/から手動ダウンロードしてdpkgでインストールしました。
  2. libtoolも追加でapt-get installが必要でした。
  3. stonithの関係で、このパスでのインストールの場合、Heartbeatの起動前に、/usr/local/heartbeat/sbin/をPATHに含める必要がありました。
    (ただし、設定しなくてもHeartbeatは起動しますが、stonithプラグインが動作しなくなります)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment