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