Проект

Общее

Профиль

OPERATIONS » История » Версия 3

Владимир Ипатов, 24.10.2012 18:16

1 1 Dmitry Chernyak
h1. OPERATIONS
2 1 Dmitry Chernyak
3 2 Владимир Ипатов
[[Cluster management]]
4 2 Владимир Ипатов
[[Instance management]]
5 2 Владимир Ипатов
[[Puppet]]
6 3 Владимир Ипатов
[[DNS+DHCP]]
7 2 Владимир Ипатов
8 1 Dmitry Chernyak
{{toc}}
9 1 Dmitry Chernyak
10 1 Dmitry Chernyak
h2. Virtualization and HA
11 1 Dmitry Chernyak
12 1 Dmitry Chernyak
SCI cluster virtualization and HA capabilities are really bringed
13 1 Dmitry Chernyak
by a *Ganety* installation over the Debia/GNU Linux, so you should
14 1 Dmitry Chernyak
read Ganeti manuals on how to operate with virtualisation and HA
15 1 Dmitry Chernyak
features.
16 1 Dmitry Chernyak
17 1 Dmitry Chernyak
The main documentation page: http://docs.ganeti.org/ganeti/master/html/
18 1 Dmitry Chernyak
A brief operations overview: http://docs.ganeti.org/ganeti/master/html/walkthrough.html
19 1 Dmitry Chernyak
20 1 Dmitry Chernyak
Ganeti operations should be issued on the 'master' node which has additional the
21 1 Dmitry Chernyak
cluster's IP  as an interface alias.
22 1 Dmitry Chernyak
The first new nodes becames the 'master candidates', so they can be promoted to master
23 1 Dmitry Chernyak
if the master node will fail.
24 1 Dmitry Chernyak
25 1 Dmitry Chernyak
Major commands:
26 1 Dmitry Chernyak
27 1 Dmitry Chernyak
h3. Check if all is ok
28 1 Dmitry Chernyak
29 1 Dmitry Chernyak
<pre>
30 1 Dmitry Chernyak
gnt-cluster verify
31 1 Dmitry Chernyak
</pre>
32 1 Dmitry Chernyak
33 1 Dmitry Chernyak
h3. Show detailed information
34 1 Dmitry Chernyak
35 1 Dmitry Chernyak
<pre>
36 1 Dmitry Chernyak
gnt-(cluster|node|instance) info
37 1 Dmitry Chernyak
</pre>
38 1 Dmitry Chernyak
39 1 Dmitry Chernyak
h3. List objects
40 1 Dmitry Chernyak
41 1 Dmitry Chernyak
Nodes
42 1 Dmitry Chernyak
<pre>
43 1 Dmitry Chernyak
gnt-node list
44 1 Dmitry Chernyak
</pre>
45 1 Dmitry Chernyak
46 1 Dmitry Chernyak
Configured instances
47 1 Dmitry Chernyak
<pre>
48 1 Dmitry Chernyak
gnt-instance list
49 1 Dmitry Chernyak
</pre>
50 1 Dmitry Chernyak
51 1 Dmitry Chernyak
h3. Create new instance
52 1 Dmitry Chernyak
53 1 Dmitry Chernyak
New instance on the NODE1 with failover on the NODE2, with one disk size 10Gb and 256M RAM.
54 1 Dmitry Chernyak
INSTANCE_NAME must be resolvable via DNS.
55 1 Dmitry Chernyak
<pre>
56 1 Dmitry Chernyak
gnt-instance add -t drbd -o debootstrap+default -s 10g -B memory=256m -n NODE1:NODE2 INSTANCE_NAME
57 1 Dmitry Chernyak
</pre>
58 1 Dmitry Chernyak
59 1 Dmitry Chernyak
Real example: create new instance
60 1 Dmitry Chernyak
* on the node gnt2
61 1 Dmitry Chernyak
* with failover on gnt1
62 1 Dmitry Chernyak
* with three disks:
63 1 Dmitry Chernyak
** 10g on volume group xenvg
64 1 Dmitry Chernyak
** 600m on volume group xenvg (probably for swap)
65 1 Dmitry Chernyak
* 5g on volume group xenvg
66 1 Dmitry Chernyak
* DNS name vg-test1
67 1 Dmitry Chernyak
* IP address will be configured automatically by resolving vg-test1' IP and matching it against @/etc/ganeti/networks@
68 1 Dmitry Chernyak
69 1 Dmitry Chernyak
<pre>
70 1 Dmitry Chernyak
gnt-instance add -t drbd -o debootstrap+default --disk 0:size=10g,vg=xenvg --disk 1:size=600m,vg=xenvg --disk 2:size=5g,vg=newvg -B memory=256m -n gnt2:gnt1 vg-test1
71 1 Dmitry Chernyak
</pre>
72 1 Dmitry Chernyak
73 1 Dmitry Chernyak
*NOTE:* the @vg=....@ option to specify different volume groups will be available since Ganeti 2.4.0 release.
74 1 Dmitry Chernyak
75 1 Dmitry Chernyak
h3. Instance manipulations
76 1 Dmitry Chernyak
77 1 Dmitry Chernyak
Various simple instance manipulations
78 1 Dmitry Chernyak
<pre>
79 1 Dmitry Chernyak
gnt-instance (startup|shutdown|reboot|failover|remove|console) INSTANCE
80 1 Dmitry Chernyak
</pre>
81 1 Dmitry Chernyak
82 1 Dmitry Chernyak
h3. OS command execution
83 1 Dmitry Chernyak
84 1 Dmitry Chernyak
Run OS command on all nodes
85 1 Dmitry Chernyak
<pre>
86 1 Dmitry Chernyak
gnt-cluster command .....
87 1 Dmitry Chernyak
</pre>
88 1 Dmitry Chernyak
89 1 Dmitry Chernyak
h2. SSH
90 1 Dmitry Chernyak
91 1 Dmitry Chernyak
All new instances, including 'sci' are going with empty root password and no ssh server installed.
92 1 Dmitry Chernyak
You should first log in to the instance using @gnt-instance console INSTANCE@ command, then set
93 1 Dmitry Chernyak
root's password using @passwd@ command and install ssh server using
94 1 Dmitry Chernyak
<pre>
95 1 Dmitry Chernyak
apt-get install openssh-server
96 1 Dmitry Chernyak
</pre>
97 1 Dmitry Chernyak
98 1 Dmitry Chernyak
h2. PUPPET
99 1 Dmitry Chernyak
100 1 Dmitry Chernyak
Puppet http://www.puppetlabs.com/) is the open source platform for enterprise systems management.
101 1 Dmitry Chernyak
Puppet is used to deploy the configuration to the cluster instances.
102 1 Dmitry Chernyak
Documentation can be found at http://docs.puppetlabs.com/
103 1 Dmitry Chernyak
104 1 Dmitry Chernyak
Puppet master is installed on the instance 'sci'.
105 1 Dmitry Chernyak
106 1 Dmitry Chernyak
h2. DNS
107 1 Dmitry Chernyak
108 1 Dmitry Chernyak
DNS is configured on the instance 'sci' via puppet.
109 1 Dmitry Chernyak
110 1 Dmitry Chernyak
The zone file is stored as a template at @/etc/puppet/modules/bind9/templates/sci/zone.erb@
111 1 Dmitry Chernyak
On each update you should set new (growing) zone serial number, initially
112 1 Dmitry Chernyak
<pre>
113 1 Dmitry Chernyak
0000000001 ; Serial
114 1 Dmitry Chernyak
</pre>
115 1 Dmitry Chernyak
to the new growing value. YYYYMMDDNN is recommended (NN - is the change number in one day).
116 1 Dmitry Chernyak
Feel free to modify it to adjust your system.
117 1 Dmitry Chernyak
118 1 Dmitry Chernyak
New names should be placed below the string
119 1 Dmitry Chernyak
<pre>
120 1 Dmitry Chernyak
; here you can put any other records
121 1 Dmitry Chernyak
</pre>
122 1 Dmitry Chernyak
123 1 Dmitry Chernyak
To apply your changes quickly you should issue
124 1 Dmitry Chernyak
<pre>
125 1 Dmitry Chernyak
/etc/init.d/puppet restart
126 1 Dmitry Chernyak
</pre>
127 1 Dmitry Chernyak
128 1 Dmitry Chernyak
h2. Apt
129 1 Dmitry Chernyak
130 1 Dmitry Chernyak
Apt is configured on the instance 'sci' via puppet.
131 1 Dmitry Chernyak
132 1 Dmitry Chernyak
h3. sources.list
133 1 Dmitry Chernyak
134 1 Dmitry Chernyak
Global distributed sources.list template is resided in @/etc/puppet/modules/approx/templates/sources.list.erb@
135 1 Dmitry Chernyak
136 1 Dmitry Chernyak
h3. Approx
137 1 Dmitry Chernyak
138 1 Dmitry Chernyak
Approx is configured in @/etc/puppet/modules/approx/templates/approx.conf.erb@
139 1 Dmitry Chernyak
To apply your changes quickly you should issue
140 1 Dmitry Chernyak
<pre>
141 1 Dmitry Chernyak
/etc/init.d/puppet restart
142 1 Dmitry Chernyak
</pre>