Проект

Общее

Профиль

Failover management » История » Версия 3

Версия 2 (Владимир Ипатов, 24.10.2012 20:53) → Версия 3/6 (Владимир Ипатов, 24.10.2012 21:13)

.

{{>toc}}

h1. FAILOVER management

designations:
<pre>
gnt# - command exec on master node
gntX# - command exec on ordinary node
gntY# - command exec on other node
# - command exec on any node
</pre>

h2. Start instances on one node where other is down

When node starts and can't find other node, cluster management daemon ganeti-masterd don't start automatically, even on a master-node.
It is because of not able to find out if second node down or there is a link problem when instances on other node is still running.
Cluster management daemon start:
<pre>
gnt# ganeti-masterd --no-voting
</pre>

h2. Master Normal change master node change in normal mode

Both of the nodes are online, master node changing is in normal mode
On master-candidate (gntX):
<pre>
gntX# gnt-cluster master-failover
</pre>

h2. Failure of master node

Master node(in this example gnt1) is down by hardware failure.

Start management daemon on master-candidate(gntX):
<pre>
gntX# ganeti-masterd --no-voting
</pre>

Activate new master node:
<pre>
gntX# gnt-cluster master-failover --no-voting
</pre>

+*Set broken node to offline so master node don't try to connect it.*+
-С = master-candidate
-O = offline
<pre>
gnt# gnt-node modify -C no -O yes gntY
</pre>

Start all instances from broken node on backup node: Запустить все виртуалки отключенного узла на резервном:
<pre>
gnt# gnt-node failover --ignore-consistency gnt1
</pre>

h2. Set broken node to online Возврат основного узла в строй

Old master node will not start management daemon on boot: Старый основной узел не будет автоматически запускать управляющего демона.
* if it will not find other node, если не найдет парного узла,
* if it will find other node that is in master mode. если найдет парный узел и узнает, что он стал новым master-ом.

If data on this node is ok then to readd it in claster: Если на узле сохранились данные, то для включения его обратно в кластер:

Скопировать на него свежую конфигурацию с нового master-а

Copy new configuration on it from new master node:
<pre>
gnt# gnt-cluster redist-conf
</pre>

Restart ganeti daemons: Запустить на нем ganeti-демоны
<pre>
gntX# /etc/init.d/ganeti restart
</pre>

h2. Planned node turning off for maintenance Плановый вывод узла из эксплуатации

Migrate all instances from this node to another Мигрируем виртуальные машины:
<pre>
gnt# gnt-instance migrate INSTANCE имя_машины
</pre>

If turning off node is Если выводимый узел - мастер, то нужно назначить нового мастера(см. выше *Штатное переключение master then you must to assign new cluster master(see above *Master node change in normal mode*) узла*).

Set node to Вывести узел из списка кандидатов на мастера и перевести его в режим offline and not master-candidate: (это предотвратит появление сообщений об &quot;аварии&quot;):
<pre>
gnt# gnt-node modify -C no -O yes УЗЕЛ
</pre>

Now you can simply turn off this node Далее узел можно просто выключить.

h3. Returning node to online Возврат узла в кластер

After boot set node online and master-candidate: После включения узла нужно сообщить кластеру, что узел вернулся в строй:
<pre>
gnt# gnt-node modify -C yes -O no УЗЕЛ
</pre>

However, if you have any doubt about node's health, you would rather exec this: Однако, если у вас имеются сомнения в том, что узел остался в рабочем состоянии, то лучше выполнить:
<pre>
gnt# gnt-node add --readd УЗЕЛ
</pre>

Anyway, you must wait about В любом случае, после этого нужно подождать около 5 minutes until минут, чтобы демон watcher daemon set up drbd resources or initiate set up by hand: поднял drbd, либо инициировать процесс вручную:
<pre>
gnt# gnt-cluster verify-disks
</pre>

h2. Node replace to new Замена узла на новый

Add node to cluster: Добавить узел в кластер
<pre>
gnt# gnt-node add --readd gntX
</pre>

For all instances which new node is secondary: Для всех виртуалок, которые имеют secondary на подключенном узле:
<pre>
gnt# gnt-instance replace-disks --submit -s INSTANCE
</pre>

Readd node to puppet: Перерегистрировать узел в puppet
<pre>
gnt# gnt-instance console sci
sci# puppetca --clean gnt1.fqdn
</pre>

<pre>
gntX# /var/lib/puppet/ssl/*
gntX# /etc/init.d/puppet restart
</pre>

h2. Hard disk replace Замена жесткого диска

Copy partitions from existent hdd(allowed only for same mode disks): Скопировать разметку с существующего (только для дисков одной модели!)
<pre>
# sfdisk -d /dev/sda|sfdisk /dev/sdX
</pre>
Check: Проверить
<pre>
# fdisk -l
</pre>
add to RAID: Добавить в RAID
<pre>
# mdadm --manage /dev/md0 --add /dev/sdX1
# mdadm --manage /dev/md1 --add /dev/sdX2
# mdadm --manage /dev/md2 --add /dev/sdX3
</pre>
Check: Проверить
<pre>
cat /proc/mdstat
</pre>