Statistics
| Branch: | Tag: | Revision:

root / man / ganeti-masterd.rst @ e715a6d6

History | View | Annotate | Download (3.3 kB)

1 4e53d886 Iustin Pop
ganeti-masterd(8) Ganeti | Version @GANETI_VERSION@
2 4e53d886 Iustin Pop
===================================================
3 4e53d886 Iustin Pop
4 4e53d886 Iustin Pop
Name
5 4e53d886 Iustin Pop
----
6 4e53d886 Iustin Pop
7 4e53d886 Iustin Pop
ganeti-masterd - Ganeti master daemon
8 4e53d886 Iustin Pop
9 4e53d886 Iustin Pop
Synopsis
10 4e53d886 Iustin Pop
--------
11 4e53d886 Iustin Pop
12 f624fa95 Iustin Pop
**ganeti-masterd** [-f] [-d] [\--no-voting]
13 4e53d886 Iustin Pop
14 4e53d886 Iustin Pop
DESCRIPTION
15 4e53d886 Iustin Pop
-----------
16 4e53d886 Iustin Pop
17 4e53d886 Iustin Pop
The **ganeti-masterd** is the daemon which is responsible for the
18 4e53d886 Iustin Pop
overall cluster coordination. Without it, no change can be
19 4e53d886 Iustin Pop
performed on the cluster.
20 4e53d886 Iustin Pop
21 4e53d886 Iustin Pop
For testing purposes, you can give the ``-f`` option and the
22 4e53d886 Iustin Pop
program won't detach from the running terminal.
23 4e53d886 Iustin Pop
24 4e53d886 Iustin Pop
Debug-level message can be activated by giving the ``-d`` option.
25 4e53d886 Iustin Pop
26 4e53d886 Iustin Pop
ROLE
27 4e53d886 Iustin Pop
~~~~
28 4e53d886 Iustin Pop
29 4e53d886 Iustin Pop
The role of the master daemon is to coordinate all the actions that
30 4e53d886 Iustin Pop
change the state of the cluster. Things like accepting new jobs,
31 4e53d886 Iustin Pop
coordinating the changes on nodes (via RPC calls to the respective
32 4e53d886 Iustin Pop
node daemons), maintaining the configuration and so on are done via
33 4e53d886 Iustin Pop
this daemon.
34 4e53d886 Iustin Pop
35 4e53d886 Iustin Pop
The only action that can be done without the master daemon is the
36 4e53d886 Iustin Pop
failover of the master role to another node in the cluster, via the
37 4e53d886 Iustin Pop
**gnt-cluster master-failover** command.
38 4e53d886 Iustin Pop
39 4e53d886 Iustin Pop
If the master daemon is stopped, the instances are not affected,
40 4e53d886 Iustin Pop
but they won't be restarted automatically in case of failure.
41 4e53d886 Iustin Pop
42 4e53d886 Iustin Pop
STARTUP
43 4e53d886 Iustin Pop
~~~~~~~
44 4e53d886 Iustin Pop
45 4e53d886 Iustin Pop
At startup, the master daemon will confirm with the node daemons
46 4e53d886 Iustin Pop
that the node it is running is indeed the master node of the
47 4e53d886 Iustin Pop
cluster. It will abort if it doesn't get half plus one positive
48 4e53d886 Iustin Pop
answers (offline nodes are queried too, just in case our
49 4e53d886 Iustin Pop
configuration is stale).
50 4e53d886 Iustin Pop
51 4e53d886 Iustin Pop
For small clusters with a number of nodes down, and especially for
52 4e53d886 Iustin Pop
two-node clusters where the other has gone done, this creates a
53 4e53d886 Iustin Pop
problem. In this case the ``--no-voting`` option can be used to
54 4e53d886 Iustin Pop
skip this process. The option requires interactive confirmation, as
55 4e53d886 Iustin Pop
having two masters on the same cluster is a very dangerous
56 4e53d886 Iustin Pop
situation and will most likely lead to data loss.
57 4e53d886 Iustin Pop
58 fe8f80bd Michael Hanselmann
SHUTDOWN
59 fe8f80bd Michael Hanselmann
~~~~~~~~
60 fe8f80bd Michael Hanselmann
61 fe8f80bd Michael Hanselmann
When the master daemon receives a ``SIGINT`` (Ctrl-C) or ``SIGTERM``
62 fe8f80bd Michael Hanselmann
signal, it stops accepting new jobs and prepares to shut down shortly
63 fe8f80bd Michael Hanselmann
after jobs running at the time finish. Meanwhile it still responds to
64 fe8f80bd Michael Hanselmann
LUXI requests. Pending jobs are re-queued after the daemon is started
65 fe8f80bd Michael Hanselmann
again. When a second signal is received, the master daemon terminates
66 fe8f80bd Michael Hanselmann
without waiting (it might still need to wait for some threads to
67 fe8f80bd Michael Hanselmann
finish). Note that the latter, as well as sending ``SIGKILL``, may leave
68 fe8f80bd Michael Hanselmann
the cluster in an inconsistent state.
69 fe8f80bd Michael Hanselmann
70 4e53d886 Iustin Pop
JOB QUEUE
71 4e53d886 Iustin Pop
~~~~~~~~~
72 4e53d886 Iustin Pop
73 4e53d886 Iustin Pop
The master daemon maintains a job queue (located under the directory
74 4e53d886 Iustin Pop
``@LOCALSTATEDIR@/lib/ganeti/queue``) in which all current jobs are
75 4e53d886 Iustin Pop
stored, one job per file serialized in JSON format; in this directory
76 4e53d886 Iustin Pop
a subdirectory called ``archive`` holds archived job files.
77 4e53d886 Iustin Pop
78 4e53d886 Iustin Pop
The moving of jobs from the current to the queue directory is done
79 4e53d886 Iustin Pop
via a request to the master; this can be accomplished from the
80 4e53d886 Iustin Pop
command line with the **gnt-job archive** or
81 4e53d886 Iustin Pop
**gnt-job autoarchive** commands. In case of problems with the
82 4e53d886 Iustin Pop
master, a job file can simply be moved away or deleted (but this
83 4e53d886 Iustin Pop
might leave the cluster inconsistent).
84 4e53d886 Iustin Pop
85 4e53d886 Iustin Pop
COMMUNICATION PROTOCOL
86 4e53d886 Iustin Pop
~~~~~~~~~~~~~~~~~~~~~~
87 4e53d886 Iustin Pop
88 4e53d886 Iustin Pop
The master accepts commands over a Unix socket, using JSON
89 4e53d886 Iustin Pop
serialized messages separated by a specific byte sequence. For more
90 4e53d886 Iustin Pop
details, see the design documentation supplied with Ganeti.
91 9ff4f2c0 Michael Hanselmann
92 9ff4f2c0 Michael Hanselmann
.. vim: set textwidth=72 :
93 9ff4f2c0 Michael Hanselmann
.. Local Variables:
94 9ff4f2c0 Michael Hanselmann
.. mode: rst
95 9ff4f2c0 Michael Hanselmann
.. fill-column: 72
96 9ff4f2c0 Michael Hanselmann
.. End: