inet 192.168.9.41/24 brd 192.168.9.255 scope global eth0
inet6 ::20c:29ff:fe6f:e158/64 scope global dynamic
valid_lft 2591667sec preferred_lft 604467sec
inet6 2002:57ae:43fc:0:20c:29ff:fe6f:e158/64 scope global dynamic
valid_lft 2591990sec preferred_lft 604790sec
inet6 fe80::20c:29ff:fe6f:e158/64 scope link
valid_lft forever preferred_lft forever
# ping -c 1 www.google.com
PING www.l.google.com (74.125.39.99) 56(84) bytes of data.
64 bytes from fx-in-f99.1e100.net (74.125.39.99): icmp_seq=1 ttl=56 time=16.7 ms
--- www.l.google.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 20ms
rtt min/avg/max/mdev = 16.713/16.713/16.713/0.000 ms
# /sbin/chkconfig network on
#
....
=== Security Shortcuts ===
To simplify this guide and focus on the aspects directly connected to
clustering, we will now disable the machine’s firewall and SELinux
installation. Both of these actions create significant security issues
and should not be performed on machines that will be exposed to the
outside world.
[IMPORTANT]
===========
TODO: Create an Appendix that deals with (at least) re-enabling the firewall.
===========
[source,Bash]
----
# sed -i.bak "s/SELINUX=enforcing/SELINUX=permissive/g" /etc/selinux/config
# /sbin/chkconfig --del iptables
# service iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
----
[NOTE]
================
You will need to reboot for the SELinux changes to take effect. Otherwise
you will see something like this when you start corosync:
May 4 19:30:54 pcmk-1 setroubleshoot: SELinux is preventing /usr/sbin/corosync "getattr" access on /. For complete SELinux messages. run sealert -l 6e0d4384-638e-4d55-9aaf-7dac011f29c1
May 4 19:30:54 pcmk-1 setroubleshoot: SELinux is preventing /usr/sbin/corosync "getattr" access on /. For complete SELinux messages. run sealert -l 6e0d4384-638e-4d55-9aaf-7dac011f29c1
================
=== Install the Cluster Software ===
Since version 12, Fedora comes with recent versions of everything you
Install the key on the other nodes and test that you can now run commands
remotely, without being prompted
[source,Bash]
----
# scp -r .ssh pcmk-2:
The authenticity of host 'pcmk-2 (192.168.122.102)' can't be established.
RSA key fingerprint is b1:2b:55:93:f1:d9:52:2b:0f:f2:8a:4e:ae:c6:7c:9a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'pcmk-2,192.168.122.102' (RSA) to the list of known hosts.root@pcmk-2's password:
id_dsa.pub 100% 616 0.6KB/s 00:00
id_dsa 100% 672 0.7KB/s 00:00
known_hosts 100% 400 0.4KB/s 00:00
authorized_keys 100% 616 0.6KB/s 00:00
# ssh pcmk-2 -- uname -npcmk-2
#
----
Figure 2.22. Installing the SSH Key on Another Host
=== Short Node Names ===
During installation, we filled in the machine’s fully qualifier domain
name (FQDN) which can be rather long when it appears in cluster logs and
status output. See for yourself how the machine identifies itself:
(((Nodes, short name)))
[source,Bash]
----
# uname -n
pcmk-1.clusterlabs.org
# dnsdomainname clusterlabs.org
----
(((Nodes, Domain name (Query))))
The output from the second command is fine, but we really don’t need the
domain name included in the basic host details. To address this, we need
to update /etc/sysconfig/network. This is what it should look like before
we start.
[source,Bash]
----
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pcmk-1.clusterlabs.org
GATEWAY=192.168.122.1
----
All we need to do now is strip off the domain name portion, which is
stored elsewhere anyway.
[source,Bash]
----
# sed -i.bak 's/\.[a-z].*//g' /etc/sysconfig/network
----
Now confirm the change was successful. The revised file contents should
look something like this.
[source,Bash]
----
# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pcmk-1
GATEWAY=192.168.122.1
----
However we’re not finished. The machine wont normally see the shortened
host name until about it reboots, but we can force it to update.
[source,Bash]
----
# source /etc/sysconfig/network
# hostname $HOSTNAME
----
(((Nodes, Domain name (Remove from host name))))
Now check the machine is using the correct names
[source,Bash]
----
# uname -npcmk-1
# dnsdomainname clusterlabs.org
----
Now repeat on pcmk-2.
=== Configuring Corosync ===
Choose a port number and multi-cast footnote:[http://en.wikipedia.org/wiki/Multicast] address. footnote:[http://en.wikipedia.org/wiki/Multicast_address] Be sure that the
values you chose do not conflict with any existing clusters you might
have. For advice on choosing a multi-cast address, see
http://www.29west.com/docs/THPM/multicast-address-assignment.html For
this document, I have chosen port 4000 and used 226.94.1.1 as the
multi-cast address.
[IMPORTANT]
===========
The instructions below only apply for a machine with a single NIC. If you
have a more complicated setup, you should edit the configuration
manually.
===========
[source,Bash]
----
# export ais_port=4000
# export ais_mcast=226.94.1.1
----
Next we automatically determine the hosts address. By not using the full
address, we make the configuration suitable to be copied to other nodes.