ganeti-watcher.rst 3.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
ganeti-watcher(8) Ganeti | Version @GANETI_VERSION@
===================================================

Name
----

ganeti-watcher - Ganeti cluster watcher

Synopsis
--------

12 13
**ganeti-watcher** [\--debug] [\--job-age=*age* ] [\--ignore-pause]
[\--rapi-ip=*IP*]
14 15 16 17 18 19 20 21 22 23 24

DESCRIPTION
-----------

The **ganeti-watcher** is a periodically run script which is
responsible for keeping the instances in the correct status. It has
two separate functions, one for the master node and another one
that runs on every node.

If the watcher is disabled at cluster level (via the
**gnt-cluster watcher pause** command), it will exit without doing
Iustin Pop's avatar
Iustin Pop committed
25
anything. The cluster-level pause can be overridden via the
26 27 28 29 30 31 32
``--ignore-pause`` option, for example if during a maintenance the
watcher needs to be disabled in general, but the administrator
wants to run it just once.

The ``--debug`` option will increase the verbosity of the watcher
and also activate logging to the standard error.

33 34 35 36 37
The ``--rapi-ip`` option needs to be set if the RAPI daemon was
started with a particular IP (using the ``-b`` option). The two
options need to be exactly the same to ensure that the watcher
can reach the RAPI interface.

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
Master operations
~~~~~~~~~~~~~~~~~

Its primary function is to try to keep running all instances which
are marked as *up* in the configuration file, by trying to start
them a limited number of times.

Another function is to "repair" DRBD links by reactivating the
block devices of instances which have secondaries on nodes that
have been rebooted.

The watcher will also archive old jobs (older than the age given
via the ``--job-age`` option, which defaults to 6 hours), in order
to keep the job queue manageable.

Node operations
~~~~~~~~~~~~~~~

The watcher will restart any down daemons that are appropriate for
the current node.

In addition, it will execute any scripts which exist under the
"watcher" directory in the Ganeti hooks directory
(``@SYSCONFDIR@/ganeti/hooks``). This should be used for lightweight
actions, like starting any extra daemons.

If the cluster parameter ``maintain_node_health`` is enabled, then the
watcher will also shutdown instances and DRBD devices if the node is
declared as offline by known master candidates.

The watcher does synchronous queries but will submit jobs for
executing the changes. Due to locking, it could be that the jobs
execute much later than the watcher submits them.

FILES
-----

75 76 77 78 79 80 81 82 83 84 85
The command has a set of state files (one per group) located at
``@LOCALSTATEDIR@/lib/ganeti/watcher.GROUP-UUID.data`` (only used on the
master) and a log file at
``@LOCALSTATEDIR@/log/ganeti/watcher.log``. Removal of either file(s)
will not affect correct operation; the removal of the state file will
just cause the restart counters for the instances to reset to zero, and
mark nodes as freshly rebooted (so for example DRBD minors will be
re-activated).

In some cases, it's even desirable to reset the watcher state, for
example after maintenance actions, or when you want to simulate the
86 87
reboot of all nodes, so in this case, you can remove all state files:

88
.. code-block:: bash
89 90 91 92 93 94

    rm -f @LOCALSTATEDIR@/lib/ganeti/watcher.*.data
    rm -f @LOCALSTATEDIR@/lib/ganeti/watcher.*.instance-status
    rm -f @LOCALSTATEDIR@/lib/ganeti/instance-status

And then re-run the watcher.
95 96 97 98 99 100

.. vim: set textwidth=72 :
.. Local Variables:
.. mode: rst
.. fill-column: 72
.. End: