SETUP » История » Версия 5
Владимир Ипатов, 24.10.2012 09:11
1 | 1 | Dmitry Chernyak | h1. SETUP |
---|---|---|---|
2 | 1 | Dmitry Chernyak | |
3 | 1 | Dmitry Chernyak | {{toc}} |
4 | 1 | Dmitry Chernyak | |
5 | 1 | Dmitry Chernyak | Ensure both nodes are up. |
6 | 1 | Dmitry Chernyak | |
7 | 1 | Dmitry Chernyak | If you planning to use the secondary network for SAN and DRBD synchronization, you |
8 | 1 | Dmitry Chernyak | should configure secondary IP interfaces manually on both nodes at this time. |
9 | 1 | Dmitry Chernyak | |
10 | 1 | Dmitry Chernyak | Log in to the first node via ssh. Due to lack of DNS there may be |
11 | 1 | Dmitry Chernyak | a minute timeout before password prompt. |
12 | 1 | Dmitry Chernyak | |
13 | 2 | Владимир Ипатов | h2. NETWORK CONFIGURATION |
14 | 2 | Владимир Ипатов | |
15 | 2 | Владимир Ипатов | Network configuration may be highly various. |
16 | 2 | Владимир Ипатов | Here we describe several schemas. |
17 | 2 | Владимир Ипатов | |
18 | 4 | Владимир Ипатов | h3. Default schema |
19 | 2 | Владимир Ипатов | |
20 | 3 | Владимир Ипатов | one ethernet, one subnet, internet connection provided by external (not in claster) router. |
21 | 3 | Владимир Ипатов | By default installer create bridge named xen-br0. You can customize parameters by editing /etc/network/interfaces. |
22 | 3 | Владимир Ипатов | By default it looks like: |
23 | 3 | Владимир Ипатов | <pre> |
24 | 3 | Владимир Ипатов | auto xen-br0 |
25 | 3 | Владимир Ипатов | iface xen-br0 inet static |
26 | 3 | Владимир Ипатов | address 192.168.5.88 |
27 | 3 | Владимир Ипатов | netmask 255.255.255.0 |
28 | 3 | Владимир Ипатов | network 192.168.5.0 |
29 | 3 | Владимир Ипатов | broadcast 192.168.5.255 |
30 | 3 | Владимир Ипатов | gateway 192.168.5.1 |
31 | 3 | Владимир Ипатов | bridge_ports eth0 |
32 | 3 | Владимир Ипатов | bridge_stp off |
33 | 3 | Владимир Ипатов | bridge_fd 0 |
34 | 3 | Владимир Ипатов | # up ifconfig eth0 mtu 9000 |
35 | 3 | Владимир Ипатов | # up ifconfig xen-br0 mtu 9000 |
36 | 3 | Владимир Ипатов | </pre> |
37 | 3 | Владимир Ипатов | Important parameters besides ipv4 settings is: |
38 | 3 | Владимир Ипатов | bridge_ports eth0 - means that physical interface eth0 enslaved to this bridge. |
39 | 3 | Владимир Ипатов | |
40 | 3 | Владимир Ипатов | up ifconfig eth0 mtu 9000 |
41 | 3 | Владимир Ипатов | up ifconfig xen-br0 mtu 9000 - setting jumbo frame on bridge for more net speed and less cpu utilization. |
42 | 3 | Владимир Ипатов | It will be actual on interface where drbd link will be. |
43 | 3 | Владимир Ипатов | However, setting mtu higher than 1500 will cause problems with any network equipment that |
44 | 3 | Владимир Ипатов | doesn't support jumbo frames. That's the reason because it option commented out by default. |
45 | 3 | Владимир Ипатов | |
46 | 3 | Владимир Ипатов | Also it is important to specify broadcast and network adresses - it will help automatically |
47 | 3 | Владимир Ипатов | fullfill /etc/ganeti/networks file(a file that specify networks for instances). |
48 | 3 | Владимир Ипатов | However, it ins't required. |
49 | 3 | Владимир Ипатов | |
50 | 3 | Владимир Ипатов | h3. Mupltiple bridges with routing |
51 | 3 | Владимир Ипатов | |
52 | 3 | Владимир Ипатов | Here is a bit more complicated network setup. |
53 | 3 | Владимир Ипатов | In this setup we have, for example, two private netwokrs and wan by ethernet. All routing and firewalling |
54 | 3 | Владимир Ипатов | performed by instance in our cluster. This setup fit when you don't have expensive hardware routers and firewalls. |
55 | 3 | Владимир Ипатов | This is /etc/network/interfaces file in this setup: |
56 | 3 | Владимир Ипатов | <pre> |
57 | 5 | Владимир Ипатов | auto lan |
58 | 5 | Владимир Ипатов | iface lan inet static |
59 | 5 | Владимир Ипатов | address 192.168.21.10 |
60 | 5 | Владимир Ипатов | netmask 255.255.255.0 |
61 | 1 | Dmitry Chernyak | bridge_ports eth0 |
62 | 1 | Dmitry Chernyak | bridge_stp off |
63 | 1 | Dmitry Chernyak | bridge_fd 0 |
64 | 5 | Владимир Ипатов | |
65 | 5 | Владимир Ипатов | auto dmz |
66 | 5 | Владимир Ипатов | iface dmz inet static |
67 | 5 | Владимир Ипатов | address 192.168.20.10 |
68 | 5 | Владимир Ипатов | netmask 255.255.255.0 |
69 | 5 | Владимир Ипатов | gateway 192.168.20.1 |
70 | 5 | Владимир Ипатов | bridge_ports eth1 |
71 | 5 | Владимир Ипатов | bridge_stp off |
72 | 5 | Владимир Ипатов | bridge_fd 0 |
73 | 5 | Владимир Ипатов | up ifconfig eth1 mtu 9000 |
74 | 5 | Владимир Ипатов | up ifconfig dmz mtu 9000 |
75 | 5 | Владимир Ипатов | |
76 | 5 | Владимир Ипатов | auto wan1 |
77 | 5 | Владимир Ипатов | iface wan1 inet manual |
78 | 5 | Владимир Ипатов | bridge_ports eth2 |
79 | 5 | Владимир Ипатов | bridge_stp off |
80 | 5 | Владимир Ипатов | bridge_fd 0 |
81 | 1 | Dmitry Chernyak | </pre> |
82 | 5 | Владимир Ипатов | In this example we have separate lan interfaces, dmz interface(it isn't actually dmz, |
83 | 5 | Владимир Ипатов | it just named this) and wan interface. dmz interface - ganeti master dev and drbd link |
84 | 5 | Владимир Ипатов | interfase, so there is mtu 9000. |
85 | 5 | Владимир Ипатов | There is no address in wan for hypervisor, although we recommend you to get subnet from |
86 | 5 | Владимир Ипатов | your ISP in order to assign IP addresses to nodes to management it even if router instance |
87 | 5 | Владимир Ипатов | is down. |
88 | 5 | Владимир Ипатов | |
89 | 5 | Владимир Ипатов | Here is an example /etc/network/interfaces in router instance: |
90 | 5 | Владимир Ипатов | <pre> |
91 | 5 | Владимир Ипатов | auto eth0 |
92 | 5 | Владимир Ипатов | iface eth0 inet static |
93 | 5 | Владимир Ипатов | address 192.168.20.1 |
94 | 5 | Владимир Ипатов | netmask 255.255.255.0 |
95 | 5 | Владимир Ипатов | |
96 | 5 | Владимир Ипатов | auto eth1 |
97 | 5 | Владимир Ипатов | iface eth1 inet static |
98 | 5 | Владимир Ипатов | address 192.168.21.1 |
99 | 5 | Владимир Ипатов | netmask 255.255.255.0 |
100 | 5 | Владимир Ипатов | |
101 | 5 | Владимир Ипатов | auto eth2 |
102 | 5 | Владимир Ипатов | iface eth2 inet static |
103 | 5 | Владимир Ипатов | address 1.1.1.2 |
104 | 5 | Владимир Ипатов | netmask 255.255.255.0 |
105 | 5 | Владимир Ипатов | address 1.1.1.1 |
106 | 5 | Владимир Ипатов | </pre> |
107 | 5 | Владимир Ипатов | Where eth0 linked to bridge dmz, eth1 linked to lan, eth2 linked to wan. |
108 | 5 | Владимир Ипатов | |
109 | 5 | Владимир Ипатов | h3. VLAN schema |
110 | 5 | Владимир Ипатов | |
111 | 5 | Владимир Ипатов | If you have managed switches, you can set networking with VLANs. |
112 | 5 | Владимир Ипатов | You should add something like this for each VLAN: |
113 | 5 | Владимир Ипатов | <pre> |
114 | 5 | Владимир Ипатов | auto eth0.55 |
115 | 5 | Владимир Ипатов | iface eth0.55 inet manual |
116 | 5 | Владимир Ипатов | up ifconfig eth0.55 up |
117 | 5 | Владимир Ипатов | |
118 | 5 | Владимир Ипатов | auto bridge-example-vlan |
119 | 5 | Владимир Ипатов | iface bridge-example-vlan inet manual |
120 | 5 | Владимир Ипатов | up brctl addbr bridge-example-vlan |
121 | 5 | Владимир Ипатов | up brctl addif bridge-example-vlan eth0.55 |
122 | 5 | Владимир Ипатов | up brctl stp bridge-example-vlan off |
123 | 5 | Владимир Ипатов | up ifconfig bridge-example-vlan up |
124 | 5 | Владимир Ипатов | down ifconfig bridge-example-vlan down |
125 | 5 | Владимир Ипатов | down brctl delbr bridge-example-vlan |
126 | 5 | Владимир Ипатов | </pre> |
127 | 5 | Владимир Ипатов | Where 55 - VLAN number. |
128 | 5 | Владимир Ипатов | In this example node don't have an ip address in this VLAN, although you could |
129 | 5 | Владимир Ипатов | assign an ip to bridge just like standard bridge. |
130 | 5 | Владимир Ипатов | |
131 | 5 | Владимир Ипатов | Alternative schema is: |
132 | 5 | Владимир Ипатов | <pre> |
133 | 5 | Владимир Ипатов | auto vlan55 |
134 | 5 | Владимир Ипатов | iface vlan55 inet manual |
135 | 5 | Владимир Ипатов | vlan_raw_device eth0 |
136 | 5 | Владимир Ипатов | |
137 | 5 | Владимир Ипатов | auto bridge-example-vlan |
138 | 5 | Владимир Ипатов | iface bridge-example-vlan inet manual |
139 | 5 | Владимир Ипатов | bridge_ports vlan55 |
140 | 5 | Владимир Ипатов | bridge_stp off |
141 | 5 | Владимир Ипатов | bridge_fd 0 |
142 | 5 | Владимир Ипатов | </pre> |
143 | 5 | Владимир Ипатов | It do the same, but in another way. |
144 | 2 | Владимир Ипатов | |
145 | 1 | Dmitry Chernyak | h2. DEFINING ENVIRONMENT |
146 | 1 | Dmitry Chernyak | |
147 | 1 | Dmitry Chernyak | Edit @/etc/sci/sci.conf@ |
148 | 1 | Dmitry Chernyak | |
149 | 1 | Dmitry Chernyak | * You should specify node1 and node2 data as you have installed them. |
150 | 1 | Dmitry Chernyak | *NOTE*: You can setup the cluster even with one node. In this case just leave NODE2_ |
151 | 1 | Dmitry Chernyak | lines as is. In fact this is a dangerous setup, so you will be warned about this duging |
152 | 1 | Dmitry Chernyak | the procedures. |
153 | 1 | Dmitry Chernyak | |
154 | 1 | Dmitry Chernyak | * You should specify the cluster's name and IP. |
155 | 1 | Dmitry Chernyak | |
156 | 1 | Dmitry Chernyak | * NODE#_SAN_IP should be specified on both nodes or none. |
157 | 1 | Dmitry Chernyak | |
158 | 1 | Dmitry Chernyak | * If you haven't Internet uplink or have a local package mirrors, you should correct |
159 | 1 | Dmitry Chernyak | APT_ - settings. |
160 | 1 | Dmitry Chernyak | |
161 | 1 | Dmitry Chernyak | * If you need to uplink to the DNS hierarchy other than root hint zones, specify DNS_FORWARDERS |
162 | 1 | Dmitry Chernyak | (note trailing ';'). |
163 | 1 | Dmitry Chernyak | |
164 | 1 | Dmitry Chernyak | h2. SETUP CLUSTER |
165 | 1 | Dmitry Chernyak | |
166 | 1 | Dmitry Chernyak | Issue: |
167 | 1 | Dmitry Chernyak | |
168 | 1 | Dmitry Chernyak | <pre> |
169 | 1 | Dmitry Chernyak | # sci-setup cluster |
170 | 1 | Dmitry Chernyak | </pre> |
171 | 1 | Dmitry Chernyak | |
172 | 1 | Dmitry Chernyak | Check and confirm settings printed. |
173 | 1 | Dmitry Chernyak | |
174 | 1 | Dmitry Chernyak | The process will go on. |
175 | 1 | Dmitry Chernyak | |
176 | 1 | Dmitry Chernyak | Next you will be prompted to accept ssh key from node2 and for the root's password to node2. |
177 | 1 | Dmitry Chernyak | |
178 | 1 | Dmitry Chernyak | On finish you will look something like this: |
179 | 1 | Dmitry Chernyak | |
180 | 1 | Dmitry Chernyak | <pre> |
181 | 1 | Dmitry Chernyak | Verify |
182 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:10 2011 * Verifying global settings |
183 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:10 2011 * Gathering data (1 nodes) |
184 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Verifying node status |
185 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Verifying instance status |
186 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Verifying orphan volumes |
187 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Verifying orphan instances |
188 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Verifying N+1 Memory redundancy |
189 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Other Notes |
190 | 1 | Dmitry Chernyak | Wed Jan 12 15:36:11 2011 * Hooks Results |
191 | 1 | Dmitry Chernyak | Node DTotal DFree MTotal MNode MFree Pinst Sinst |
192 | 1 | Dmitry Chernyak | gnt1.ganeti.example.org 100.0G 100.0G 1020M 379M 625M 0 0 |
193 | 1 | Dmitry Chernyak | gnt2.ganeti.example.org 100.0G 100.0G 1020M 379M 625M 0 0 |
194 | 1 | Dmitry Chernyak | If all is ok, proceed with /usr/local/sbin/sci-setup service |
195 | 1 | Dmitry Chernyak | </pre> |
196 | 1 | Dmitry Chernyak | |
197 | 1 | Dmitry Chernyak | h2. SETUP SERVICE INSTANCE |
198 | 1 | Dmitry Chernyak | |
199 | 1 | Dmitry Chernyak | The service instance is named 'sci' and have a few aliases. |
200 | 1 | Dmitry Chernyak | On setup, it's IP address is determined from @/etc/resolv.conf@ of your first node. |
201 | 1 | Dmitry Chernyak | This instance will be hardcoded in @/etc/hosts@ file of all cluster nodes and instances. |
202 | 1 | Dmitry Chernyak | |
203 | 1 | Dmitry Chernyak | Issue: |
204 | 1 | Dmitry Chernyak | |
205 | 1 | Dmitry Chernyak | <pre> |
206 | 1 | Dmitry Chernyak | # sci-setup service |
207 | 1 | Dmitry Chernyak | </pre> |
208 | 1 | Dmitry Chernyak | |
209 | 1 | Dmitry Chernyak | You'll see the progress of DRBD syncing disks, then the message |
210 | 1 | Dmitry Chernyak | <pre> |
211 | 1 | Dmitry Chernyak | * running the instance OS create scripts... |
212 | 1 | Dmitry Chernyak | </pre> |
213 | 1 | Dmitry Chernyak | appears. The further may take a while. The process finishes with |
214 | 1 | Dmitry Chernyak | <pre> |
215 | 1 | Dmitry Chernyak | * starting instance... |
216 | 1 | Dmitry Chernyak | </pre> |
217 | 1 | Dmitry Chernyak | message. |
218 | 1 | Dmitry Chernyak | |
219 | 1 | Dmitry Chernyak | Now you can log on to the sci instance using: |
220 | 1 | Dmitry Chernyak | |
221 | 1 | Dmitry Chernyak | <pre> |
222 | 1 | Dmitry Chernyak | # gnt-instance console sci |
223 | 1 | Dmitry Chernyak | </pre> |
224 | 1 | Dmitry Chernyak | |
225 | 1 | Dmitry Chernyak | Log in as root, the password is empty. |
226 | 1 | Dmitry Chernyak | *NOTE*: Due to empty password all remote connections to new instance is prohibited. |
227 | 1 | Dmitry Chernyak | You should change password and install @openssh-server@ package manually after |
228 | 1 | Dmitry Chernyak | successful bootstrap procedure. |
229 | 1 | Dmitry Chernyak | |
230 | 1 | Dmitry Chernyak | h2. SERVICE INSTANCE BOOTSTRAP |
231 | 1 | Dmitry Chernyak | |
232 | 1 | Dmitry Chernyak | The system will setup itself via puppet. This is the iterative process. You can monitor |
233 | 1 | Dmitry Chernyak | it by looking into @/var/log/daemon.log@. At start there is no @less@ command yet, so |
234 | 1 | Dmitry Chernyak | you can use @more@, @cat@, @tail@ or @tail -f@ until @less@ will be auto-installed. |
235 | 1 | Dmitry Chernyak | |
236 | 1 | Dmitry Chernyak | By default the iterations are repeated in 20 minutes. To shorten the wait time you can |
237 | 1 | Dmitry Chernyak | issue |
238 | 1 | Dmitry Chernyak | |
239 | 1 | Dmitry Chernyak | <pre> |
240 | 1 | Dmitry Chernyak | # /etc/init.d/puppet restart |
241 | 1 | Dmitry Chernyak | </pre> |
242 | 1 | Dmitry Chernyak | |
243 | 1 | Dmitry Chernyak | and then look into @daemon.log@ how it finishes. |
244 | 1 | Dmitry Chernyak | |
245 | 1 | Dmitry Chernyak | Repeat this a few times until puppet will do nothing in turn. |
246 | 1 | Dmitry Chernyak | |
247 | 1 | Dmitry Chernyak | h2. PREPARING FOR NEW INSTANCES |
248 | 1 | Dmitry Chernyak | |
249 | 1 | Dmitry Chernyak | New instances are created just by regular Ganeti commands such as: |
250 | 1 | Dmitry Chernyak | |
251 | 1 | Dmitry Chernyak | <pre> |
252 | 1 | Dmitry Chernyak | gnt-instance add -t drbd -o debootstrap+default -s 10g -B memory=256m -n NODE1_NAME:NODE2_NAME INSTANCE_NAME |
253 | 1 | Dmitry Chernyak | </pre> |
254 | 1 | Dmitry Chernyak | |
255 | 1 | Dmitry Chernyak | Altought, some tuning hooks are provided by SCI-CD project: |
256 | 1 | Dmitry Chernyak | # Each instance has installed @puppet@ for autoconfiguration and @openssh-client@ for file transfers etc. |
257 | 1 | Dmitry Chernyak | # The instance uses pygrub to boot kernel from /vmlinuz & Co on the innstance's own disk. |
258 | 1 | Dmitry Chernyak | # The instance's network interfaces may be set up automatically as described below. |
259 | 1 | Dmitry Chernyak | |
260 | 1 | Dmitry Chernyak | h3. INSTANCE INTERFACE AUTOCONFIGURATION |
261 | 1 | Dmitry Chernyak | |
262 | 1 | Dmitry Chernyak | If your instances may sit on several networks and you need static addressing in them, you should fulfill |
263 | 1 | Dmitry Chernyak | the file @/etc/ganeti/networks@ with all known networks you want to attach your instances. |
264 | 1 | Dmitry Chernyak | Each line in the file has format |
265 | 1 | Dmitry Chernyak | |
266 | 1 | Dmitry Chernyak | |NETWORK|NETMASK|BROADCAST|GATEWAY| |
267 | 1 | Dmitry Chernyak | |
268 | 1 | Dmitry Chernyak | Ganeti instance debootstrap hook looks in this file for the network, mathing the address of bootstraped |
269 | 1 | Dmitry Chernyak | instance and fulfill it's @/etc/network/interfaces@ accordingly. |
270 | 1 | Dmitry Chernyak | |
271 | 1 | Dmitry Chernyak | *NOTE*: If you have only one default network, you shouldn't care because it's data are preinstalled. |
272 | 1 | Dmitry Chernyak | *NOTE*: networks file must be copied to all cluster nodes (not automated yet). |
273 | 1 | Dmitry Chernyak | |
274 | 1 | Dmitry Chernyak | h2. SCI OPERATIONS |
275 | 1 | Dmitry Chernyak | |
276 | 1 | Dmitry Chernyak | Read [[OPERATIONS]] next. |