]> git.proxmox.com Git - mirror_corosync.git/blame - INSTALL
config: Don't free pointers used by transports
[mirror_corosync.git] / INSTALL
CommitLineData
12329c57
SD
1----------------------------------------------
2The Corosync Cluster Engine Installation Guide
3----------------------------------------------
4Please read LICENSE for a description of the licensing of this software.
5
e8a5c56a
JF
6---------------------
7* Building from git *
8---------------------
9When building and installing from git, autoconf 2.61, automake 1.11,
10libtool 2.2.6 and pkgconfig 0.23 (or later versions) are required.
11Prior versions may result in build failures.
12329c57
SD
12
13Step 1: check out a read only copy of the repository
e8a5c56a 14git clone git://github.com/corosync/corosync.git
12329c57 15
e8a5c56a
JF
16Find the version you want to build. Usually this will be the "master" version.
17If you want to build a specific released version, use git checkout VERSION.
12329c57
SD
18
19Step 2: Generate the makefiles
e8a5c56a 20balance:~/corosync% ./autogen.sh
12329c57
SD
21
22Step 3: Run the configure script
e8a5c56a 23balance:~/corosync% ./configure
12329c57
SD
24
25Step 4: Install the binaries
e8a5c56a
JF
26balance:~/corosync% su
27balance:~/corosync# make install
12329c57
SD
28
29-------------------------
30* Building from tarball *
31-------------------------
32The tarball is distributed with pregenerated makefiles. There is no need
33to run the autogen.sh script in this case.
34
35Step 1: Run the configure script
e8a5c56a 36balance:~/corosync% ./configure
12329c57
SD
37
38Step 2: Install the binaries
e8a5c56a
JF
39balance:~/corosync% su
40balance:~/corosync# make install
12329c57 41
2fd4d6f3
SD
42-------------------------------
43* A notice about dependencies *
44-------------------------------
e8a5c56a 45We have strived very hard to avoid dependencies as much as possible, but there
ce297174
JF
46are two required libraries: LibQB (https://github.com/ClusterLabs/libqb)
47and KNET (https://kronosnet.org/).
978b6080 48
589ed925 49Optional dependencies are support for DBUS, SNMP and libstatgrab.
978b6080 50
06504c0f 51Also don't forget to install pkgconfig.
2fd4d6f3 52
2a568d6e
AS
53-----------------------------------------
54* Building with SNMP/DBUS support *
55-----------------------------------------
56
57You can get SNMP traps on the following corosync events:
581) node joine/leave
592) application connect/dissconnect from corosync
603) quorum gain/lost
61
62There are 2 modes of achieving this DBUS + foghorn and snmp-agentx.
63
64Setting up to get dbus events.
65------------------------------
66foghorn (http://git.fedorahosted.org/git/foghorn.git) converts
67dbus signals into snmp traps. So install foghorn.
68
69$ ./configure --enable-dbus
70$ make && sudo make install
71$ /etc/init.d/corosync start
72$ echo "OPTIONS=\"-d\"" > /etc/sysconfig/corosync-notifyd
73$ /etc/init.d/corosync-notifyd start
74Start foghorn
75
76to see the dbus signals getting sent try:
77$ dbus-monitor --system
78
79Setting up snmp-agentx.
80-----------------------
81If you don't want to use dbus then you can use snmp-agentx.
82
83$ ./configure --enable-snmp
84$ make && sudo make install
85$ /etc/init.d/corosync start
86$ vim /etc/snmp/snmptrapd.conf
87
88Add the following:
89authCommunity log,execute,net public
90$ /etc/init.d/snmptrapd start
91$ echo "OPTIONS=\"-s\"" > /etc/sysconfig/corosync-notifyd
92$ /etc/init.d/corosync-notifyd start
93
94I start up wireshark to see if there are any snmp traps been sent
95as I am too lazy to setup a manager to receive traps.
96
97run a program that talks to corosync e.g.
a516a1f9 98$ corosync-cmapctl
2a568d6e
AS
99
100And you should get traps
101
102
12329c57
SD
103------------------------
104* Configuring Corosync *
105------------------------
ce297174
JF
106The configuration directory (usually /etc/corosync) contains an example
107configuration file (corosync.conf.example). Please copy it as corosync.conf
108and edit it as needed. At the very minimum, the nodelist section will have to be changed
109to list all cluster nodes. For more information about the configuration file
110please read the corosync.conf.5 manual page.
12329c57 111
12329c57
SD
112Generate a private key
113----------------------
114corosync uses cryptographic techniques to ensure authenticity and privacy of
115messages. A private key must be generated and shared by all processors for
116correct operation.
117
118First generate the key on one of the nodes:
119
2fd4d6f3 120balance# corosync-keygen
12329c57 121Corosync Authentication key generator.
ce297174 122Gathering 8192 bits for key from /dev/random.
7c8e83ac 123Writing corosync key to /etc/corosync/authkey.
12329c57 124
7c8e83ac 125After this is complete, a private key will be in the file /etc/corosync/authkey.
12329c57
SD
126This private key must be copied to every processor that will be a member of
127the cluster. If the private key isn't the same for every node, those nodes
128with nonmatching private keys will not be able to join the same configuration.
129
130Copy the key to some transportable storage or use ssh to transmit the key
131from node to node. Then install the key with the command:
132
7c8e83ac 133balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey
12329c57
SD
134
135If the message invalid digest appears, the keys are not the same on each node.
136
137Run the corosync executive
138-------------------------
2fd4d6f3 139Get one or more nodes and run the corosync executive on each node. Run the
12329c57
SD
140corosync daemon after following the previous directions. The daemon must be
141run as UID 0(root).
142
12329c57
SD
143Before running any of the test programs
144---------------------------------------
2fd4d6f3
SD
145The corosync executive will ensure security by only allowing the UID 0(root) or
146GID 0(root) to connect to it. To allow other users to access the corosync
147executive, create a directory called /etc/corosync/uidgid.d and place a file in
148it named in some way that is identifiable to you. All files in this directory
149will be scanned and their contents added to the allowed uid gid database. The
150contents of this file should be
151uidgid {
152 uid: username
153 gid: groupname
154}
12329c57 155
2fd4d6f3 156Please note that these users then have full ability to transmit and receive
94dff3b7 157messages in the cluster.
12329c57
SD
158
159Try out the corosync cpg functionality
160--------------------------------------
161After corosync is running
162
12329c57
SD
163Run test/testcpg on multiple nodes or on the same node. Messages can be typed
164which will then be sent to other testcpg applications in the cluster.
2fd4d6f3
SD
165
166To see a hashed verified output of data on all nodes, test/cpgverify can be
167run.