-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathlan-cluster-node.cfg
229 lines (186 loc) · 8.06 KB
/
lan-cluster-node.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
##############################################################################
# #
# Kickstart file for LAN cluster node. #
# Submitted by baptiste.agasse@lyra-network.com Baptiste AGASSE #
# #
##############################################################################
#
# Install type
###############################################################################
install
cdrom
text
firstboot --disabled
reboot
#
# Locale, timezone and keymap
###############################################################################
lang fr_FR.UTF-8
keyboard fr-latin9
timezone --utc Europe/Paris
#
# Network configuration
###############################################################################
### Bond1
# Admin and VMs network interface available on "public" cluster network (bonding)
network --device eth0 --onboot yes --bootproto static --ip 192.168.2.99 --netmask 255.255.255.240 --gateway 192.168.2.106 --nameserver 192.168.1.10 --hostname sirislanxen1.exemple.com
network --device eth5 --onboot yes --bootproto static --ip 192.168.2.99 --netmask 255.255.255.240 --gateway 192.168.2.106 --nameserver 192.168.1.10 --hostname sirislanxen1.exemple.com
### End Bond1
### ISCSI
# SAN interfaces
network --device eth1 --onboot yes --bootproto static --ip 10.1.1.51 --mtu 9000 --netmask 255.255.255.0 --hostname node1.exemple.com
network --device eth2 --onboot yes --bootproto static --ip 10.1.1.52 --mtu 9000 --netmask 255.255.255.0 --hostname node1.exemple.com
### End ISCSI
### Bond0
# Cluster management interfaces (bonding)
network --device eth3 --onboot yes --bootproto static --ip 10.1.0.2 --netmask 255.255.255.0 --hostname node1.exemple.com
network --device eth4 --onboot yes --bootproto static --ip 10.1.0.2 --netmask 255.255.255.0 --hostname node1.exemple.com
### End bond0
#
# Firewall, SELinux, services and security configuration
###############################################################################
# default root password : 'foo11bar'
rootpw --iscrypted $1$L.LWW5FI$kGSjEOyma9dWQA0NV/9aK1
firewall --disabled
services --disabled cups,iptables,ip6tables,kudzu,netfs,xendomains,avahi-daemon,acpid
services --enabled multipathd
authconfig --enableshadow --enablemd5
selinux --permissive
#
# Disk and partition configuration
###############################################################################
bootloader --location=mbr --driveorder=sda
clearpart --all
part /boot --fstype ext3 --size=100
part pv.5 --size=100 --grow
volgroup VolGroupXen1 --pesize=32768 pv.5
logvol / --fstype ext3 --name=LogVolRoot --vgname=VolGroupXen1 --size=6000
logvol /var --fstype ext3 --name=LogVolVar --vgname=VolGroupXen1 --size=2048
logvol swap --fstype swap --name=LogVolSwap --vgname=VolGroupXen1 --size=2048
logvol /tmp --fstype ext3 --name=LogVolTmp --vgname=VolGroupXen1 --size=2048
#
# Common packages for all cluster nodes
###############################################################################
%packages
@editors
@text-internet
@virtualization
@core
@base
@network-server
@clustering
@french-support
iscsi-initiator-utils
bridge-utils
device-mapper-multipath
vnc-server
OpenIPMI
OpenIPMI-tools
#yum-allowdowngrade
#yum-priorities
yum-security
ntp
luci
-cadaver
-gnome-applet-vm
-words
-coolkey
-nano
-autofs
-pcmciautils
-mtools
-NetworkManager
-nfs-utils
-mkbootdisk
-irda-utils
-amtu
-ypbind
-smartmontools
-ccid
-anacron
-bluez-utils
-talk
-system-config-cluster
-ipvsadm
-piranha
-firstboot-tui
-firstboot
#
# Post install script
###############################################################################
%post
#
# Bonding configuration
#
### Modprobe
# Modify the modprobe.conf file
echo "alias bnx2i off" >> /etc/modprobe.conf
echo "alias bond0 bonding" >> /etc/modprobe.conf
echo "alias bond1 bonding" >> /etc/modprobe.conf
echo "options bond0 miimon=80 mode=1 primary=eth4" >> /etc/modprobe.conf
echo "options bond1 miimon=80 mode=1 primary=eth0" >> /etc/modprobe.conf
### End Modprobe
### Bond0
# Create network interface config file for bond0
echo -e DEVICE=bond0\\nIPADDR=10.1.0.2\\nNETMASK=255.255.255.0\\nONBOOT=yes\\nBOOTPROTO=static\\nUSERCTL=no > /etc/sysconfig/network-scripts/ifcfg-bond0
### End Bond0
### Bond1
# Create network interface config file for bond1
echo -e DEVICE=bond1\\nIPADDR=192.168.2.99\\nNETMASK=255.255.255.240\\nONBOOT=yes\\nBOOTPROTO=static\\nUSERCTL=no > /etc/sysconfig/network-scripts/ifcfg-bond1
### End Bond1
### MTU
# Add MTU configuration for ISCSI
echo "MTU=9000" >> /etc/sysconfig/network-scripts/ifcfg-eth1
echo "MTU=9000" >> /etc/sysconfig/network-scripts/ifcfg-eth2
### End MTU
### Bond0 IFACEs
# Modifiy slaves network interfaces config files for bond0 (eth3, eth4)
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth3
echo -e SLAVE=yes\\nMASTER=bond0 >> /etc/sysconfig/network-scripts/ifcfg-eth3
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth4
echo -e SLAVE=yes\\nMASTER=bond0 >> /etc/sysconfig/network-scripts/ifcfg-eth4
### End Bond0 IFACEs
### Bond1 IFACEs
# Modifiy slaves network interfaces config files for bond1 (eth0, eth5)
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth0
echo -e SLAVE=yes\\nMASTER=bond1 >> /etc/sysconfig/network-scripts/ifcfg-eth0
sed -i -e '/^IPADDR=*/ s/^/#/' -e '/^NETMASK=*/ s/^/#/' -e '/^NETWORK=*/ s/^/#/' -e '/^DHCPCLASS=*/ s/^/#/' /etc/sysconfig/network-scripts/ifcfg-eth5
echo -e SLAVE=yes\\nMASTER=bond1 >> /etc/sysconfig/network-scripts/ifcfg-eth5
### End Bond1 IFACEs
#
# VLAN configuration for VMs
#
#### VLAN 12
echo -e DEVICE=bond1.12\\nBRIDGE=vlanbr0\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.12
echo -e DEVICE=vlanbr0\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr0
### End VLAN 12
### VLAN 10
echo -e DEVICE=bond1.10\\nBRIDGE=vlanbr1\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.10
echo -e DEVICE=vlanbr1\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr1
### End VLAN 10
### VLAN 17
echo -e DEVICE=bond1.17\\nBRIDGE=vlanbr2\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.17
echo -e DEVICE=vlanbr2\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr2
### End VLAN 17
### VLAN 11
echo -e DEVICE=bond1.11\\nBRIDGE=vlanbr3\\nONBOOT=yes\\nBOOTPROTO=static\\nVLAN=yes > /etc/sysconfig/network-scripts/ifcfg-bond0.11
echo -e DEVICE=vlanbr3\\nTYPE=bridge\\nONBOOT=yes\\nBOOTPROTO=static\\nSTP=off\\nDELAY=0 > /etc/sysconfig/network-scripts/ifcfg-vlanbr3
### End VLAN 11
#
# Xen configuration
#
# Modify xen config file to set right params for network and min memory amount for xen
sed -i -e '/(network-script network-bridge)/a (network-script /bin/true)' -e '/(dom0-min-mem 256)/a (dom0-min-mem 1024)' -e '/(network-script network-bridge)/ s/^/#/' -e '/(dom0-min-mem 256)/ s/^/#/' /etc/xen/xend-config.sxp
# Configure xen migration
sed -i -e '/#(xend-relocation-server no)/a (xend-relocation-server yes)' -e '/#(xend-relocation-port 8002)/a (xend-relocation-port 8002)' /etc/xen/xend-config.sxp
sed -i -e "/#(xend-relocation-address '')/a (xend-relocation-address '10.1.0.2')" -e '/^(xend-relocation-hosts-allow*/ s/^/#/' -e "//a (xend-relocation-hosts-allow '')" /etc/xen/xend-config.sxp
### Hosts configuration
sed -i -e '/^127.0.0.1/a 127.0.0.1\tlocalhost.localdomain localhost ' -e '/^127.0.0.1/D' /etc/hosts
echo 10.1.0.2 node1.exemple.com node1 >> /etc/hosts
echo 10.1.0.4 node2.exemple.com node2 >> /etc/hosts
echo 10.1.0.6 node3.exemple.com node3 >> /etc/hosts
echo 10.1.0.8 node4.exemple.com node4 >> /etc/hosts
### End Host configuration
#
# EOF
#####