]> git.proxmox.com Git - mirror_corosync.git/blame_incremental - INSTALL
config: Don't free pointers used by transports
[mirror_corosync.git] / INSTALL
... / ...
CommitLineData
1----------------------------------------------
2The Corosync Cluster Engine Installation Guide
3----------------------------------------------
4Please read LICENSE for a description of the licensing of this software.
5
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.
12
13Step 1: check out a read only copy of the repository
14git clone git://github.com/corosync/corosync.git
15
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.
18
19Step 2: Generate the makefiles
20balance:~/corosync% ./autogen.sh
21
22Step 3: Run the configure script
23balance:~/corosync% ./configure
24
25Step 4: Install the binaries
26balance:~/corosync% su
27balance:~/corosync# make install
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
36balance:~/corosync% ./configure
37
38Step 2: Install the binaries
39balance:~/corosync% su
40balance:~/corosync# make install
41
42-------------------------------
43* A notice about dependencies *
44-------------------------------
45We have strived very hard to avoid dependencies as much as possible, but there
46are two required libraries: LibQB (https://github.com/ClusterLabs/libqb)
47and KNET (https://kronosnet.org/).
48
49Optional dependencies are support for DBUS, SNMP and libstatgrab.
50
51Also don't forget to install pkgconfig.
52
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.
98$ corosync-cmapctl
99
100And you should get traps
101
102
103------------------------
104* Configuring Corosync *
105------------------------
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.
111
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
120balance# corosync-keygen
121Corosync Authentication key generator.
122Gathering 8192 bits for key from /dev/random.
123Writing corosync key to /etc/corosync/authkey.
124
125After this is complete, a private key will be in the file /etc/corosync/authkey.
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
133balance# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/corosync/authkey
134
135If the message invalid digest appears, the keys are not the same on each node.
136
137Run the corosync executive
138-------------------------
139Get one or more nodes and run the corosync executive on each node. Run the
140corosync daemon after following the previous directions. The daemon must be
141run as UID 0(root).
142
143Before running any of the test programs
144---------------------------------------
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}
155
156Please note that these users then have full ability to transmit and receive
157messages in the cluster.
158
159Try out the corosync cpg functionality
160--------------------------------------
161After corosync is running
162
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.
165
166To see a hashed verified output of data on all nodes, test/cpgverify can be
167run.