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