Revision 9b659162
b/docs/admin-guide.rst | ||
---|---|---|
236 | 236 |
to be able to handle thousand of user requests, Cyclades and Ganeti communicate |
237 | 237 |
asynchronously. Briefly, requests are submitted to Ganeti, and asynchronous |
238 | 238 |
notifications about the progress of jobs is received from the backends. The |
239 |
architecture and communication with a Ganeti backend is shown in Figure?. |
|
239 |
architecture and communication with a Ganeti backend is shown the below graph. |
|
240 |
|
|
241 |
.. image:: images/cyclades-ganeti-communication.png |
|
242 |
:width: 50% |
|
243 |
:target: _images/cyclades-ganeti-communication.png |
|
240 | 244 |
|
241 | 245 |
Cyclades API server is responsible for handling user requests. Read-only |
242 | 246 |
requests are directly served by looking up the Cyclades DB. If the request |
... | ... | |
263 | 267 |
Prereqs |
264 | 268 |
------- |
265 | 269 |
|
266 |
RabbitMQ |
|
267 |
~~~~~~~~ |
|
268 |
|
|
269 |
RabbitMQ is used as a generic message broker for Cyclades. It should be |
|
270 |
installed on two seperate :ref:`QUEUE <QUEUE_NODE>` nodes in a high |
|
271 |
availability configuration as described here: |
|
272 |
|
|
273 |
http://www.rabbitmq.com/pacemaker.html |
|
274 |
|
|
275 |
The values set for the user and password must be mirrored in the ``RABBIT_*`` |
|
276 |
variables in your settings, as managed by :ref:`snf-common <snf-common>`. |
|
277 |
|
|
278 |
.. todo:: Document an active-active configuration based on the latest version |
|
279 |
of RabbitMQ. |
|
280 |
|
|
281 | 270 |
Installation |
282 | 271 |
------------ |
283 | 272 |
|
... | ... | |
498 | 487 |
------------------------------- |
499 | 488 |
|
500 | 489 |
|
501 |
.. _mail-server: |
|
502 |
|
|
503 |
Configure mail server |
|
504 |
--------------------- |
|
505 |
|
|
506 |
In order to be able to send email (for example activation emails), |
|
507 |
synnefo needs access to a running mail server. Your mail server should |
|
508 |
be defined in the ``/etc/synnefo/00-snf-common-admins.conf`` |
|
509 |
related constants. At least: |
|
510 |
|
|
511 |
.. code-block:: console |
|
512 |
|
|
513 |
EMAIL_HOST = "my_mail_server.example.com" |
|
514 |
EMAIL_PORT = "25" |
|
515 |
|
|
516 | 490 |
The "kamaki" API client |
517 | 491 |
======================= |
518 | 492 |
|
... | ... | |
594 | 568 |
Miscellaneous |
595 | 569 |
============= |
596 | 570 |
|
571 |
.. RabbitMQ |
|
572 |
RabbitMQ Broker |
|
573 |
--------------- |
|
574 |
|
|
575 |
Queue nodes run the RabbitMQ sofware, which provides AMQP functionality. To |
|
576 |
guarantee high-availability, more than one Queue nodes should be deployed, each |
|
577 |
of them belonging to the same `RabbitMQ cluster |
|
578 |
<http://www.rabbitmq.com/clustering.html>`_. Synnefo uses RabbitMQ |
|
579 |
active/active `High Available Queues <http://www.rabbitmq.com/ha.html>`_ that |
|
580 |
are mirrored on nodes within a RabbitMQ cluster. |
|
581 |
|
|
582 |
The RabbitMQ nodes that form the cluster, are declared to Synnefo through |
|
583 |
the `AMQP_HOSTS` setting. Each time a Synnefo component needs to connect |
|
584 |
RabbitMQ, one of this nodes is chosen in a random way. The client that |
|
585 |
synnefo uses to connect with RabbitMQ, silently handles connection failures |
|
586 |
and tries to reconnect to a different node. As long as one of these nodes |
|
587 |
are up and running, functionality of synnefo should no be downgraded by |
|
588 |
RabbitMQ node failures. |
|
589 |
|
|
590 |
All the queues that are being used are declared as durable, meaning that |
|
591 |
messages are persistently stored to RabbitMQ until are successfully processed |
|
592 |
by a client. |
|
593 |
|
|
594 |
Currently, RabbitMQ is used by the following components: |
|
595 |
|
|
596 |
* snf-ganeti-eventd, snf-ganeti-hook and snf-progress-monitor: |
|
597 |
These components send messages concerning the status and progress of |
|
598 |
jobs in the Ganeti backend. |
|
599 |
* snf-dispatcher: This daemon, consumes the messages that are send from |
|
600 |
the above components, and updates the Cyclades DB. |
|
601 |
|
|
602 |
Installation |
|
603 |
```````````` |
|
604 |
|
|
605 |
Please check RabbitMQ documentation which covers extensively the `installation |
|
606 |
of RabbitMQ server <http://www.rabbitmq.com/download.html>`_ and the setup of a |
|
607 |
`RabbitMQ cluster <http://www.rabbitmq.com/clustering.html>`_. Also, check out |
|
608 |
the `web management plugin <http://www.rabbitmq.com/management.html>`_ that can |
|
609 |
be useful for managing and monitoring RabbitMQ. |
|
610 |
|
|
611 |
For a basic installation of RabbitMQ on two nodes (node1 and node2) you can do |
|
612 |
the follow steps: |
|
613 |
|
|
614 |
On both nodes, install rabbitmq-server and create a synnefo user: |
|
615 |
|
|
616 |
.. code-block:: console |
|
617 |
|
|
618 |
$ apt-get install rabbitmq-server |
|
619 |
$ rabbitmqctl add_user synnefo "example_pass" |
|
620 |
$ rabbitmqctl set_permissions synnefo ".*" ".*" ".*" |
|
621 |
|
|
622 |
Also guarantee that two nodes share the same cookie, by running |
|
623 |
|
|
624 |
.. code-block:: console |
|
625 |
|
|
626 |
$ scp node1:/var/lib/rabbitmq/.erlang.cookie node2:/var/lib/rabbitmq/.erlang.cookie |
|
627 |
|
|
628 |
and restart the nodes: |
|
629 |
|
|
630 |
.. code-block:: console |
|
631 |
|
|
632 |
$ /etc/init.d/rabbitmq-server restart |
|
633 |
|
|
634 |
|
|
635 |
To setup the RabbitMQ cluster run: |
|
636 |
|
|
637 |
.. code-block:: console |
|
638 |
|
|
639 |
root@node2: rabbitmqctl stop_app |
|
640 |
root@node2: rabbitmqctl reset |
|
641 |
root@node2: rabbitmqctl cluster rabbit@node1 rabbit@node2 |
|
642 |
root@node2: rabbitmqctl start_app |
|
643 |
|
|
644 |
You can verify that the cluster is set up correctly by running: |
|
645 |
|
|
646 |
.. code-block:: console |
|
647 |
|
|
648 |
root@node2: rabbitmqctl cluster_status |
|
649 |
|
|
650 |
|
|
651 |
|
|
652 |
|
|
653 |
|
|
654 |
|
|
655 |
|
|
597 | 656 |
Admin tool: snf-manage |
598 | 657 |
---------------------- |
599 | 658 |
|
Also available in: Unified diff