root / README.admin @ a1dbcae1
History | View | Annotate | Download (3 kB)
1 | 03353341 | Vangelis Koukis | README.admin - Administration notes |
---|---|---|---|
2 | 03353341 | Vangelis Koukis | |
3 | 03353341 | Vangelis Koukis | This file contains notes related to administration of a working Synnefo |
4 | 03353341 | Vangelis Koukis | deployment. This document should be read *after* README.deploy, which contains |
5 | 03353341 | Vangelis Koukis | step-by-step Synnefo deployment instructions. |
6 | 03353341 | Vangelis Koukis | |
7 | 03353341 | Vangelis Koukis | |
8 | 96b635d9 | Vangelis Koukis | Database |
9 | 96b635d9 | Vangelis Koukis | ======== |
10 | 96b635d9 | Vangelis Koukis | |
11 | 96b635d9 | Vangelis Koukis | MySQL: manage.py dbshell seems to ignore the setting of 'init_command' |
12 | 96b635d9 | Vangelis Koukis | in settings.DATABASES |
13 | 96b635d9 | Vangelis Koukis | |
14 | 3b40590c | Vangelis Koukis | |
15 | 03353341 | Vangelis Koukis | Reconciliation mechanism |
16 | 03353341 | Vangelis Koukis | ======================== |
17 | 03353341 | Vangelis Koukis | |
18 | 03353341 | Vangelis Koukis | On certain occasions, such as a Ganeti or RabbitMQ failure, the VM state in the |
19 | 03353341 | Vangelis Koukis | system's database may differ from that in the Ganeti installation. The |
20 | 03353341 | Vangelis Koukis | reconciliation process is designed to bring the system's database in sync with |
21 | 3b40590c | Vangelis Koukis | what Ganeti knows about each VM, and is able to detect the following three |
22 | 3b40590c | Vangelis Koukis | conditions: |
23 | 03353341 | Vangelis Koukis | |
24 | 3b40590c | Vangelis Koukis | * Stale DB servers without corresponding Ganeti instances |
25 | 3b40590c | Vangelis Koukis | * Orphan Ganeti instances, without corresponding DB entries |
26 | 3b40590c | Vangelis Koukis | * Out-of-sync operstate for DB entries wrt to Ganeti instances |
27 | 03353341 | Vangelis Koukis | |
28 | 3b40590c | Vangelis Koukis | The reconciliation mechanism runs as a management command, e.g., as follows: |
29 | 3b40590c | Vangelis Koukis | [PYTHONPATH needs to contain the parent of the synnefo Django project |
30 | 3b40590c | Vangelis Koukis | directory]: |
31 | 03353341 | Vangelis Koukis | |
32 | 3b40590c | Vangelis Koukis | /srv/synnefo$ export PYTHONPATH=/srv:$PYTHONPATH |
33 | 3b40590c | Vangelis Koukis | vkoukis@dev67:~/synnefo [reconc]$ ./manage.py reconcile --detect-all -v 2 |
34 | 03353341 | Vangelis Koukis | |
35 | 3b40590c | Vangelis Koukis | Please see ./manage.py reconcile --help for all the details. |
36 | 03353341 | Vangelis Koukis | |
37 | 3b40590c | Vangelis Koukis | The administrator can also trigger reconciliation of operating state manually, |
38 | 3b40590c | Vangelis Koukis | by issuing a Ganeti OP_INSTANCE_QUERY_DATA command on a Synnefo VM, using |
39 | 3b40590c | Vangelis Koukis | gnt-instance info. |
40 | 03353341 | Vangelis Koukis | |
41 | 03353341 | Vangelis Koukis | |
42 | 3a4e3bac | Georgios Gousios | Logging |
43 | 3a4e3bac | Georgios Gousios | ======= |
44 | 3a4e3bac | Georgios Gousios | |
45 | 3a4e3bac | Georgios Gousios | Logging in Synnefo is using Python's logging module. The module is configured |
46 | 3a4e3bac | Georgios Gousios | using a configuration file, whose format is described here: |
47 | 3a4e3bac | Georgios Gousios | |
48 | 3a4e3bac | Georgios Gousios | http://docs.python.org/library/logging.config.html |
49 | 3a4e3bac | Georgios Gousios | |
50 | 3a4e3bac | Georgios Gousios | By default, the log initialization code will look for the logging.conf file |
51 | 3a4e3bac | Georgios Gousios | in the following locations in order: |
52 | 3a4e3bac | Georgios Gousios | |
53 | 3a4e3bac | Georgios Gousios | 1. /etc/synnefo/logging.conf |
54 | 3a4e3bac | Georgios Gousios | 2. os.getcwd()/logging.conf |
55 | 3a4e3bac | Georgios Gousios | 3. synnefo.logic.__path__[0]/logging.conf (<-- this is the default) |
56 | 3a4e3bac | Georgios Gousios | |
57 | 3a4e3bac | Georgios Gousios | The default configuration is using Linux conventions: it logs to /dev/log for |
58 | 3a4e3bac | Georgios Gousios | all loggers. The default configuration can be changed by copying the default |
59 | 3a4e3bac | Georgios Gousios | file to any of the above mentioned locations and changing it appropriately. |
60 | 3a4e3bac | Georgios Gousios | |
61 | 3a4e3bac | Georgios Gousios | * Logging and demonization: If the logging is configured to print to the console |
62 | 3a4e3bac | Georgios Gousios | (using the consoleHandler handler) then daemon processes (notably, the |
63 | 3a4e3bac | Georgios Gousios | dispatcher) will not work as it should. This only happens after the daemon |
64 | 3a4e3bac | Georgios Gousios | has lost its controlling terminal (e.g. because the terminal was closed); |
65 | 3a4e3bac | Georgios Gousios | in this case the dispatcher does not know where to log to and depending on |
66 | 3a4e3bac | Georgios Gousios | the system it either crashes or stalls. This can be avoided if the logging |
67 | 3b40590c | Vangelis Koukis | module is not configured to output to the console. |
68 | 9999b451 | Giorgos Verigakis | |
69 | 9999b451 | Giorgos Verigakis | |
70 | 9999b451 | Giorgos Verigakis | Admin Tools |
71 | 9999b451 | Giorgos Verigakis | =========== |
72 | 9999b451 | Giorgos Verigakis | |
73 | 9999b451 | Giorgos Verigakis | snf-admin is a tool used to perform various administrative tasks. It needs to |
74 | 9999b451 | Giorgos Verigakis | be able to access the django database, so the following should be able to import |
75 | 9999b451 | Giorgos Verigakis | the Django settings. |
76 | 9999b451 | Giorgos Verigakis | |
77 | 9999b451 | Giorgos Verigakis | Additionally, administrative tasks can be performed via the admin web interface |
78 | 9999b451 | Giorgos Verigakis | located in /admin. Only users of type ADMIN can access the admin pages. To change |
79 | 9999b451 | Giorgos Verigakis | the type of a user to ADMIN, snf-admin can be used: |
80 | 9999b451 | Giorgos Verigakis | |
81 | 9999b451 | Giorgos Verigakis | snf-admin user modify 42 --type ADMIN |