]> git.proxmox.com Git - mirror_corosync.git/blame - INSTALL
BSD support: Fix EOF handling in coroipcs.c:req_setup_recv() and coroipcs:coroipcs_ha...
[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
6All cryptographic software in this package is subject to the following legal
7notice:
8This package includes publicly available encryption source code which,
9together with object code resulting from the compiling of publicly
10available source code, may be exported from the United States under License
11Exception TSU prsuant to 15 C.F.R Section 740.13(e).
12
13----------------------------
14* Building from subversion *
15----------------------------
16When building and installing from subversion, automake 2.61 or later is
17required. Prior versions will result in build failures.
18
19Step 1: check out a read only copy of the repository
20svn checkout http://svn.fedoraprojects.org/svn/corosync
21
22Find the version you want to build. Usually this will be the "trunk" version
23located in the trunk directory. If you want to build a specific released
24version check in the tags directory.
25
26Step 2: Generate the makefiles
27balance:~/corosync/trunk% ./autogen.sh
28
29Step 3: Run the configure script
30balance:~/corosync/trunk% ./configure
31
32Step 4: Install the binaries
33balance:~/corosync/trunk% su
34balance:~/corosync/trunk# make install
35
36-------------------------
37* Building from tarball *
38-------------------------
39The tarball is distributed with pregenerated makefiles. There is no need
40to run the autogen.sh script in this case.
41
42Step 1: Run the configure script
43balance:~/corosync/trunk% ./configure
44
45Step 2: Install the binaries
46balance:~/corosync/trunk% su
47balance:~/corosync/trunk# make install
48
49------------------------
50* Configuring Corosync *
51------------------------
52The corosync executive will automatically determine cluster membership by
53communicating on a specified multicast address and port.
54
45bc8323 55The directory conf contains the file corosync.conf.example
12329c57
SD
56
57# Please read the corosync.conf.5 manual page
58totem {
59 version: 2
60 secauth: off
61 threads: 0
62 interface {
63 ringnumber: 0
64 bindnetaddr: 192.168.1.1
65 mcastaddr: 226.94.1.1
66 mcastport: 5405
67 }
68}
69
70logging {
71 fileline: off
72 to_stderr: yes
73 to_file: yes
74 to_syslog: yes
75 logfile: /tmp/corosync.log
76 debug: off
77 timestamp: on
78}
79
80The totem section contains three values. All three values must be set
81or the corosync executive wll exit with an error.
82
83bindnetaddr specifies the address which the corosync Executive should bind to.
84This address should always end in zero. If the local interface taffic
85should routed over is 192.168.5.92, set bindnetaddr to 192.168.5.0.
86
87mcastaddr is a multicast address. The default should work but you may have
88a different network configuration. Avoid 224.x.x.x because this is a "config"
89multicast address.
90
91mcastport specifies the UDP port number. It is possible to use the same
92multicast address on a network with the corosync services configured for
93different UDP ports.
94
95The timeout section contains seven values. This section is not normally used,
96but rather used to override the program defaults for the purposes of fine
97tuning for a given networking/processor combination or for debugging purposes.
98Be careful to use the same timeout values on each of the nodes in the cluster
99or unpredictable results may occur.
100
101Do not use DOS style termination. This breaks the parser.
102
103Configure Host
104--------------
105For security reasons, corosync only allows a process that had the EGID/GID
106of "ais" to connect to it. To make development easier, it is recommended to
107create an "ais" user with the "ais" group.
108
109[root@balance root]# adduser ais -g ais
110
111Set the ais user's password:
112
113[root@balance root]# passwd ais
114Changing password for user ais.
115New password:
116Retype new password:
117passwd: all authentication tokens updated successfully.
118
119Generate a private key
120----------------------
121corosync uses cryptographic techniques to ensure authenticity and privacy of
122messages. A private key must be generated and shared by all processors for
123correct operation.
124
125First generate the key on one of the nodes:
126
127unix# exec/keygen
128Corosync Authentication key generator.
129Gathering 1024 bits for key from /dev/random.
130Writing corosync key to /etc/ais/authkey.
131
132After this is complete, a private key will be in the file /etc/ais/authkey.
133This private key must be copied to every processor that will be a member of
134the cluster. If the private key isn't the same for every node, those nodes
135with nonmatching private keys will not be able to join the same configuration.
136
137Copy the key to some transportable storage or use ssh to transmit the key
138from node to node. Then install the key with the command:
139
140unix# install -D --group=0 --owner=0 --mode=0400 /path_to_authkey/authkey /etc/ais/authkey
141
142If the message invalid digest appears, the keys are not the same on each node.
143
144Run the corosync executive
145-------------------------
146Get one or more nodes and run the corosync executive on each node. A list of
147node IPs should be logged when the nodes join a configuration. Run the
148corosync daemon after following the previous directions. The daemon must be
149run as UID 0(root).
150
151please read SECURITY to understand the threat model assumed by corosync
152and the techniques corosync use to overcome these threats.
153
154Before running any of the test programs
155---------------------------------------
156The corosync executive will ensure security by only allowing the ais group (or
157uid root) to connect to the service. Switch to the ais group before
158running any applications linked to the ais apis, or the applications will
159not be authenticated and won't be able to access services.
160
161[sdake@balance sdake]$ su ais
162Password:
163[ais@balance sdake]$ id
164uid=501(ais) gid=502(ais) groups=502(ais)
165
166Try out the corosync cpg functionality
167--------------------------------------
168After corosync is running
169
170su to ais user
171
172Run test/testcpg on multiple nodes or on the same node. Messages can be typed
173which will then be sent to other testcpg applications in the cluster.