Contents |
Please do not attempt to install Pacemaker with anything less than Heartbeat 3.0.0
Since Pacemaker was originally part of Heartbeat, it naturally includes many of the files contained in Heartbeat 2.x Most package managers including YUM, RPM and DEB will complain extremely loudly if you try this.
The list of current and supported versions of Pacemaker are available at the Releases page. If you already have Pacemaker installed, please read the documentation on upgrading Pacemaker before following any of the instructions here.
Version | Current Release | Tested w/ Glue | Tested w/ Corosync | Tested w/ Heartbeat | First Released | This Release | Supported Until |
1.1 | NA | -- | -- | Q4 2010 | |||
1.0 | Oct 9, 2008 | Mar 16, 2010 | Q4 2011 (at least) |
0.7 | June 25, 2008 | Sep 22, 2008 | |
0.6 | Jan 16, 2008 | Dec 15, 2008 |
Binary packages for current Fedora, OpenSUSE and EPEL compatible distributions (eg. RHEL, CentOS and Scientific Linux) releases can be found at:
http://www.clusterlabs.org/rpm/
Simply browse for your distribution and download the relevant packages.
Once installed, you can decide which cluster stack to use at runtime simply by starting either /etc/init.d/heartbeat or /etc/init.d/corosync. You can also choose not to install whichever stack you don't wish to use.
For Fedora-11, installation is as simple as:
wget -O /etc/yum.repos.d/pacemaker.repo http://clusterlabs.org/rpm/fedora-11/clusterlabs.repo yum install -y pacemaker corosync heartbeat
As of Fedora-12, Pacemaker is part of the distribution and updates are usually quickly available via the regular channels. There is nothing extra to download, just run:
yum install -y pacemaker corosync heartbeat
The Pacemaker packages in the EPEL directories build against some additional packages that don't exist on vanilla RHEL/CentOS installs. For more information on EPEL, see http://fedoraproject.org/wiki/EPEL/FAQ
So before installing Pacemaker, you will first need to tell the machine how to find the EPEL packages Pacemaker depends on. To do this, download and install the EPEL package that matches your RHEL/CentOS version.
For example to install on RHEL5.3 for i386, you'd run:
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm'
Now add the Cluster Labs repo:
wget -O /etc/yum.repos.d/pacemaker.repo http://clusterlabs.org/rpm/epel-5/clusterlabs.repo
And finally, install Pacemaker:
yum install -y pacemaker corosync heartbeat
openSUSE uses zypper instead of yum, but the procedure is much the same:
zypper ar http://clusterlabs.org/rpm/opensuse-11.1/clusterlabs.repo zypper refresh zypper in pacemaker corosync heartbeat
For those that refuse to install the libraries of whichever stack you wont be using, you can rebuild the published rpms to meet your needs. To do this:
If your packages are not available for your distro/version, you can rebuild the published rpms to meet your needs. To do this:
Martin Loschwitz from LINBIT does the official builds for Pacemaker (and any other required parts of the stack). "Official" in this sense means that the packages are endorsed by Andrew and the Pacemaker maintainers. These builds have been merged into Debian GNU/Linux Unstable proper as of 2010-04-06.
Please note that the repository URLs changed between Pacemaker releases 1.0.4 and 1.0.5. This is due to the fact that the 1.0.5 packages are integrated with Corosync, which the 1.0.4 packages were not -- this required a makeover to the package build layout.
For detailed installation instructions, refer to the Debian Lenny HowTo. If you run into any issues installing, updating, or using these packages, please let us know on the mailing list.
Use your favorite editor to add one of the following to /etc/apt/sources.list
For Debian 5.0 (lenny):
deb http://people.debian.org/~madkiss/ha lenny main
For Debian unstable (sid):
deb http://people.debian.org/~madkiss/ha sid main
Once this has been completed, run:
apt-get update
Finally, to install Pacemaker simply decide which stack you wish to use and run
apt-get install pacemaker corosync
or
apt-get install pacemaker heartbeat
Please note: currently, no direct, "rolling upgrade" path exists for Debian users to move from the woefully outdated Heartbeat 2.1.3 with built-in CRM that continues to be part of the official Debian package repositories. Providing this upgrade path is something that Martin has on his to-do list, but it's a little more challenging than it looks to an observer.
To obtain the latest bug fixes, you may wish to build debian packages from source. To do so:
apt-get source pacemaker
apt-get build-dep pacemaker
cd pacemaker-{someversion}
dpkg-buildpackage -rfakeroot -uc -us
As of Ubuntu 10.4 (Lucid Lynx), Pacemaker and all its dependancies are part of the distribution. Simply run:
aptitude install corosync pacemaker
or
aptitude install heartbeat pacemaker
Users of Ubuntu versions prior to 10.4 can either install the Debian packages, or try the ones from LaunchPad by adding
deb http://ppa.launchpad.net/ubuntu-ha/ppa/ubuntu karmic main deb-src http://ppa.launchpad.net/ubuntu-ha/ppa/ubuntu karmic main
to /etc/apt/sources.list before running the same aptitude command above.
Follow the source based installation instructions below after having installed MacPorts and installing the following pre-requisites:
sudo port install pkgconfig glib2 help2man
And make sure the default autoconf installation understands the pkg-config macros:
sudo ln -s /opt/local/share/aclocal/pkg.m4 /usr/share/aclocal/
Setup a number of variables that we'll use throughout the build process. Adjust them to your needs.
export PREFIX=/usr export LCRSODIR=$PREFIX/libexec/lcrso export CLUSTER_USER=hacluster export CLUSTER_GROUP=haclient
Create a user and group for the cluster
getent group ${CLUSTER_GROUP} >/dev/null || groupadd -r ${CLUSTER_GROUP}
getent passwd ${CLUSTER_USER} >/dev/null || useradd -r -g ${CLUSTER_GROUP} -d /var/lib/heartbeat/cores/hacluster -s /sbin/nologin -c "cluster user" ${CLUSTER_USER}
Obtain the latest Cluster Glue sources, then create and initialize the build directory
wget -O cluster-glue.tar.bz2 http://hg.linux-ha.org/glue/archive/tip.tar.bz2 tar jxvf cluster-glue.tar.bz2 cd Reusable-Cluster-Components-*
Or, if you want to fetch Cluster Glue directly from the Mercurial repository:
hg clone http://hg.linux-ha.org/glue cd glue
Teach Cluster Glue about the machine it will run on
./autogen.sh && ./configure --prefix=$PREFIX --with-daemon-user=${CLUSTER_USER} --with-daemon-group=${CLUSTER_GROUP}
Once configure reports success, simply execute
make sudo make install
Obtain the latest sources:
wget -O resource-agents.tar.bz2 http://hg.linux-ha.org/agents/archive/tip.tar.bz2
Create and initialize the build directory
tar jxvf resource-agents.tar.bz2 cd Cluster-Resource-Agents-*
Teach Agents about the machine it will run on
./autogen.sh && ./configure --prefix=$PREFIX
Once configure reports success, simply execute
make sudo make install
* You can skip this step if you prefer to use the OpenAIS/Corosync cluster stack.
Obtain the latest Heartbeat sources:
wget -O heartbeat.tar.bz2 http://hg.linux-ha.org/dev/archive/tip.tar.bz2
Create and initialize the build directory
tar jxvf heartbeat.tar.bz2 cd Linux-HA-Dev-*
Teach Heartbeat about the machine it will run on
./bootstrap && ./configure --prefix=$PREFIX
Once configure reports success, simply execute
make sudo make install
*You can skip this step if you prefer to use the Heartbeat cluster stack.
CoroSync contains the infrastructure (such as interprocess communication and network protocols) that used to be part of OpenAIS. See the CoroSync FAQ entry for more details.
For the majority of Pacemaker users, it is simplest to think of CoroSync as simply a new version of OpenAIS without a bunch of stuff you weren't using anyway.
Grab the latest code from the CoroSync project which has all the required patches to support Pacemaker
svn co http://svn.fedorahosted.org/svn/corosync/branches/flatiron/ cd flatiron
Teach CoroSync about the machine it will run on
./autogen.sh && ./configure --prefix=$PREFIX --with-lcrso-dir=$LCRSODIR
Once configure reports success, simply execute
make sudo make install
*You can skip this step if you prefer to use the Heartbeat cluster stack or don't plan on using GFS2 or OCFS2.
Although Pacemaker doesn't require the full OpenAIS stack (just CoroSync is sufficient), some cluster services do. These include:
* OCFS2 * GFS2 * cLVM
In order to use any of the above services in a Pacemaker cluster, you'll need to install OpenAIS.
Grab the latest code from the OpenAIS project
svn co http://svn.fedorahosted.org/svn/openais/branches/wilson cd wilson
Teach OpenAIS about the machine it will run on ./autogen.sh && ./configure --prefix=$PREFIX --with-lcrso-dir=$LCRSODIR
Once configure reports success, simply execute
make sudo make install
Obtain the latest Pacemaker sources:
wget -O pacemaker.tar.bz2 http://hg.clusterlabs.org/pacemaker/stable-1.0/archive/tip.tar.bz2
You can obtain a specific release by substituting tip with Pacemaker-{version}. eg.
wget -O pacemaker.tar.bz2 http://hg.clusterlabs.org/pacemaker/stable-1.0/archive/Pacemaker-1.0.5.tar.bz2
Alternatively, for people that want to update regularly, clone the underlying Mercurial repository:
hg clone http://hg.clusterlabs.org/pacemaker/stable-1.0 cd stable-1.0 hg update -C stable-1.0
Create and initialize the build directory
tar jxvf pacemaker.tar.bz2 cd Pacemaker-1-0-*
Teach Pacemaker about the machine it will run on
./autogen.sh && ./configure --prefix=$PREFIX --with-lcrso-dir=$LCRSODIR
Once configure reports success, simply execute
make sudo make install
for some reason this also appears to be necessary
sudo ldconfig -v
be sure to first update LD_LIBRARY_PATH if you installed Pacemaker (or anything else) into a non-standard location.
Although I personally dislike the current GUI, it does appear to be getting better and many people seem to get value from it.
Similar to Pacemaker, you can get the latest sources from:
http://hg.clusterlabs.org/pacemaker/pygui/archive/tip.tar.bz2
Contents[hide] |
Sample /etc/ha.d/ha.cf configuration file
# Logging debug 1 use_logd false logfacility daemon # Misc Options traditional_compression off compression bz2 coredumps true # Communications udpport 691 bcast eth0 autojoin any # Thresholds (in seconds) keepalive 1 warntime 6 deadtime 10 initdead 15
For more details on these and other available options, please refer to http://www.linux-ha.org/ha.cf
Before starting CoroSync for the first time, you need to create the authkey-file for authentication within cluster communication.
corosync-keygen #no arguments required
Then you need to copy that file to all of your nodes and put it in /etc/corosync/ with user=root, group=root and mode 0400.
totem {
version: 2
# How long before declaring a token lost (ms)
token: 5000
# How many token retransmits before forming a new configuration
token_retransmits_before_loss_const: 20
# How long to wait for join messages in the membership protocol (ms)
join: 1000
# How long to wait for consensus to be achieved before starting a new round of membership configuration (ms)
consensus: 7500
# Turn off the virtual synchrony filter
vsftype: none
# Number of messages that may be sent by one processor on receipt of the token
max_messages: 20
# Disable encryption
secauth: off
# How many threads to use for encryption/decryption
threads: 0
# Limit generated nodeids to 31-bits (positive signed integers)
clear_node_high_bit: yes
# Optionally assign a fixed node id (integer)
# nodeid: 1234
interface {
ringnumber: 0
# The following three values need to be set based on your environment
bindnetaddr: 10.0.0.1
mcastaddr: 226.94.1.1
mcastport: 5405
}
}
logging {
fileline: off
to_syslog: yes
to_stderr: no
syslog_facility: daemon
debug: on
timestamp: on
}
amf {
mode: disabled
}
To instruct Heartbeat to start Pacemaker, add the following to /etc/ha.d/ha.cf
crm yes
or, if you plan to enable STONITH
crm respawn
To instruct CoroSync to start Pacemaker, create /etc/corosync/service.d/pcmk with the following fragment
service {
# Load the Pacemaker Cluster Resource Manager
name: pacemaker
ver: 0
}
CoroSync and Heartbeat identify nodes differently. This is reflected in the value of 'id' for 'node' objects in the CIB.
Since 'id' is the attribute by which a node is identified, this can lead to each node having duplicate entries in the CIB's 'nodes' section and cause expected cluster behavior.
To prevent this, delete the contents of 'nodes' before starting up the alternative cluster stack (and remember to zap the .sig files in the same directory after you do so).
/etc/init.d/heartbeat start
/etc/init.d/corosync start
It is quite useful and interesting too.
VIRT 的上限是64G,也就是36位, cat /proc/cpuinfo的结果是:addre
昨天要准备用线程重写webbench,试验了下Fedora Linux 2.6.35.14
不明白您的具体的意思是什么?
已经发送到你QQ邮箱
http://www.2mysite.net/scriptencoder/screnc.asp 站长你好,看
你好,我发现一个问题,就是从mysqld2同步过来的数据,在mysqld1的
晕,我说是怎么回事情,原来我和你一样,忘记设置了活动分区