Statistics
| Branch: | Tag: | Revision:

root / docs / quick-install-admin-guide.rst @ dad708b4

History | View | Annotate | Download (29.9 kB)

1 bdb83fd6 cven
.. _quick-install-admin-guide:
2 bdb83fd6 cven
3 bdb83fd6 cven
Administrator's Quick Installation Guide
4 a96ec00f Constantinos Venetsanopoulos
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 a96ec00f Constantinos Venetsanopoulos
6 a96ec00f Constantinos Venetsanopoulos
This is the Administrator's quick installation guide.
7 a96ec00f Constantinos Venetsanopoulos
8 a96ec00f Constantinos Venetsanopoulos
It describes how to install the whole synnefo stack on two (2) physical nodes,
9 a96ec00f Constantinos Venetsanopoulos
with minimum configuration. It installs synnefo from Debian packages, and
10 a96ec00f Constantinos Venetsanopoulos
assumes the nodes run Debian Squeeze. After successful installation, you will
11 a96ec00f Constantinos Venetsanopoulos
have the following services running:
12 a96ec00f Constantinos Venetsanopoulos
13 a96ec00f Constantinos Venetsanopoulos
 * Identity Management (Astakos)
14 dad708b4 Antony Chazapis
 * Object Storage Service (Pithos+)
15 a96ec00f Constantinos Venetsanopoulos
 * Compute Service (Cyclades)
16 a96ec00f Constantinos Venetsanopoulos
 * Image Registry Service (Plankton)
17 a96ec00f Constantinos Venetsanopoulos
18 a96ec00f Constantinos Venetsanopoulos
and a single unified Web UI to manage them all.
19 a96ec00f Constantinos Venetsanopoulos
20 a96ec00f Constantinos Venetsanopoulos
The Volume Storage Service (Archipelago) and the Billing Service (Aquarium) are
21 a96ec00f Constantinos Venetsanopoulos
not released yet.
22 a96ec00f Constantinos Venetsanopoulos
23 dad708b4 Antony Chazapis
If you just want to install the Object Storage Service (Pithos+), follow the guide
24 a96ec00f Constantinos Venetsanopoulos
and just stop after the "Testing of Pithos+" section.
25 a96ec00f Constantinos Venetsanopoulos
26 a96ec00f Constantinos Venetsanopoulos
27 a96ec00f Constantinos Venetsanopoulos
Installation of Synnefo / Introduction
28 a96ec00f Constantinos Venetsanopoulos
======================================
29 a96ec00f Constantinos Venetsanopoulos
30 a96ec00f Constantinos Venetsanopoulos
We will install the services with the above list's order. Cyclades and Plankton
31 a96ec00f Constantinos Venetsanopoulos
will be installed in a single step (at the end), because at the moment they are
32 a96ec00f Constantinos Venetsanopoulos
contained in the same software component. Furthermore, we will install all
33 a96ec00f Constantinos Venetsanopoulos
services in the first physical node, except Pithos+ which will be installed in
34 a96ec00f Constantinos Venetsanopoulos
the second, due to a conflict between the snf-pithos-app and snf-cyclades-app
35 a96ec00f Constantinos Venetsanopoulos
component (scheduled to be fixed in the next version).
36 a96ec00f Constantinos Venetsanopoulos
37 a96ec00f Constantinos Venetsanopoulos
For the rest of the documentation we will refer to the first physical node as
38 a96ec00f Constantinos Venetsanopoulos
"node1" and the second as "node2". We will also assume that their domain names
39 a96ec00f Constantinos Venetsanopoulos
are "node1.example.com" and "node2.example.com" and their IPs are "4.3.2.1" and
40 a96ec00f Constantinos Venetsanopoulos
"4.3.2.2" respectively.
41 a96ec00f Constantinos Venetsanopoulos
42 a96ec00f Constantinos Venetsanopoulos
43 a96ec00f Constantinos Venetsanopoulos
General Prerequisites
44 a96ec00f Constantinos Venetsanopoulos
=====================
45 a96ec00f Constantinos Venetsanopoulos
46 a96ec00f Constantinos Venetsanopoulos
These are the general synnefo prerequisites, that you need on node1 and node2
47 a96ec00f Constantinos Venetsanopoulos
and are related to all the services (Astakos, Pithos+, Cyclades, Plankton).
48 a96ec00f Constantinos Venetsanopoulos
49 a96ec00f Constantinos Venetsanopoulos
To be able to download all synnefo components you need to add the following
50 a96ec00f Constantinos Venetsanopoulos
lines in your ``/etc/apt/sources.list`` file:
51 a96ec00f Constantinos Venetsanopoulos
52 a96ec00f Constantinos Venetsanopoulos
| ``deb http://apt.dev.grnet.gr squeeze main``
53 a96ec00f Constantinos Venetsanopoulos
| ``deb-src http://apt.dev.grnet.gr squeeze main``
54 a96ec00f Constantinos Venetsanopoulos
55 a96ec00f Constantinos Venetsanopoulos
| ``deb http://apt.noc.grnet.gr experimental main``
56 a96ec00f Constantinos Venetsanopoulos
| ``deb-src http://apt.noc.grnet.gr experimental main``
57 a96ec00f Constantinos Venetsanopoulos
58 a96ec00f Constantinos Venetsanopoulos
| ``deb http://apt.noc.grnet.gr squeeze backports``
59 a96ec00f Constantinos Venetsanopoulos
| ``deb-src http://apt.noc.grnet.gr squeeze backports``
60 a96ec00f Constantinos Venetsanopoulos
61 a96ec00f Constantinos Venetsanopoulos
You also need a shared directory visible by both nodes. Pithos+ will save all
62 a96ec00f Constantinos Venetsanopoulos
data inside this directory. By 'all data', we mean files, images, and pithos
63 a96ec00f Constantinos Venetsanopoulos
specific mapping data. If you plan to upload more than one basic image, this
64 a96ec00f Constantinos Venetsanopoulos
directory should have at least 50GB of free space. During this guide, we will
65 a96ec00f Constantinos Venetsanopoulos
assume that node1 acts as an NFS server and serves the directory ``/srv/pithos``
66 a96ec00f Constantinos Venetsanopoulos
to node2. Node2 has this directory mounted under ``/srv/pithos``, too.
67 a96ec00f Constantinos Venetsanopoulos
68 a96ec00f Constantinos Venetsanopoulos
Before starting the synnefo installation, you will need basic third party
69 a96ec00f Constantinos Venetsanopoulos
software to be installed and configured on the physical nodes. We will describe
70 a96ec00f Constantinos Venetsanopoulos
each node's general prerequisites separately. Any additional configuration,
71 a96ec00f Constantinos Venetsanopoulos
specific to a synnefo service for each node, will be described at the service's
72 a96ec00f Constantinos Venetsanopoulos
section.
73 a96ec00f Constantinos Venetsanopoulos
74 a96ec00f Constantinos Venetsanopoulos
Node1
75 a96ec00f Constantinos Venetsanopoulos
-----
76 a96ec00f Constantinos Venetsanopoulos
77 a96ec00f Constantinos Venetsanopoulos
General Synnefo dependencies
78 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79 a96ec00f Constantinos Venetsanopoulos
80 a96ec00f Constantinos Venetsanopoulos
 * apache (http server)
81 a96ec00f Constantinos Venetsanopoulos
 * gunicorn (WSGI http server)
82 a96ec00f Constantinos Venetsanopoulos
 * postgresql (database)
83 a96ec00f Constantinos Venetsanopoulos
 * rabbitmq (message queue)
84 a96ec00f Constantinos Venetsanopoulos
85 a96ec00f Constantinos Venetsanopoulos
You can install the above by running:
86 a96ec00f Constantinos Venetsanopoulos
87 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
88 a96ec00f Constantinos Venetsanopoulos
89 a96ec00f Constantinos Venetsanopoulos
   # apt-get install apache2 gunicorn postgresql
90 a96ec00f Constantinos Venetsanopoulos
91 a96ec00f Constantinos Venetsanopoulos
Make sure you have installed gunicorn >= v0.12.2. On node1, we will create our
92 a96ec00f Constantinos Venetsanopoulos
databases, so you will also need the python-psycopg2 package:
93 a96ec00f Constantinos Venetsanopoulos
94 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
95 a96ec00f Constantinos Venetsanopoulos
96 a96ec00f Constantinos Venetsanopoulos
   # apt-get install python-psycopg2
97 a96ec00f Constantinos Venetsanopoulos
98 a96ec00f Constantinos Venetsanopoulos
Database setup
99 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~
100 a96ec00f Constantinos Venetsanopoulos
101 a96ec00f Constantinos Venetsanopoulos
On node1, we create a database called ``snf_apps``, that will host all django
102 a96ec00f Constantinos Venetsanopoulos
apps related tables. We also create the user ``synnefo`` and grant him all
103 a96ec00f Constantinos Venetsanopoulos
privileges on the database. We do this by running:
104 a96ec00f Constantinos Venetsanopoulos
105 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
106 a96ec00f Constantinos Venetsanopoulos
107 a96ec00f Constantinos Venetsanopoulos
   root@node1:~ # su - postgres
108 a96ec00f Constantinos Venetsanopoulos
   postgres@node1:~ $ psql
109 a96ec00f Constantinos Venetsanopoulos
   postgres=# CREATE DATABASE snf_apps WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
110 a96ec00f Constantinos Venetsanopoulos
   postgres=# CREATE USER synnefo WITH PASSWORD 'example_passw0rd';
111 a96ec00f Constantinos Venetsanopoulos
   postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_apps TO synnefo;
112 a96ec00f Constantinos Venetsanopoulos
113 a96ec00f Constantinos Venetsanopoulos
We also create the database ``snf_pithos`` needed by the pithos+ backend and
114 a96ec00f Constantinos Venetsanopoulos
grant the ``synnefo`` user all privileges on the database. This database could
115 a96ec00f Constantinos Venetsanopoulos
be created on node2 instead, but we do it on node1 for simplicity. We will
116 a96ec00f Constantinos Venetsanopoulos
create all needed databases on node1 and then node2 will connect to them.
117 a96ec00f Constantinos Venetsanopoulos
118 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
119 a96ec00f Constantinos Venetsanopoulos
120 a96ec00f Constantinos Venetsanopoulos
   postgres=# CREATE DATABASE snf_pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C'
121 a96ec00f Constantinos Venetsanopoulos
   postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_pithos TO synnefo;
122 a96ec00f Constantinos Venetsanopoulos
123 a96ec00f Constantinos Venetsanopoulos
Configure the database to listen to all network interfaces. You can do this by
124 a96ec00f Constantinos Venetsanopoulos
editting the file ``/etc/postgresql/8.4/main/postgresql.conf`` and change
125 a96ec00f Constantinos Venetsanopoulos
``listen_addresses`` to ``'*'`` :
126 a96ec00f Constantinos Venetsanopoulos
127 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
128 a96ec00f Constantinos Venetsanopoulos
129 a96ec00f Constantinos Venetsanopoulos
   listen_addresses = '*'
130 a96ec00f Constantinos Venetsanopoulos
131 a96ec00f Constantinos Venetsanopoulos
Furthermore, edit ``/etc/postgresql/8.4/main/pg_hba.conf`` to allow node1 and
132 a96ec00f Constantinos Venetsanopoulos
node2 to connect to the database. Add the following lines under ``#IPv4 local
133 a96ec00f Constantinos Venetsanopoulos
connections:`` :
134 a96ec00f Constantinos Venetsanopoulos
135 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
136 a96ec00f Constantinos Venetsanopoulos
137 a96ec00f Constantinos Venetsanopoulos
   host		all	all	4.3.2.1/32	md5
138 a96ec00f Constantinos Venetsanopoulos
   host		all	all	4.3.2.2/32	md5
139 a96ec00f Constantinos Venetsanopoulos
140 a96ec00f Constantinos Venetsanopoulos
Make sure to substitute "4.3.2.1" and "4.3.2.2" with node1's and node2's
141 a96ec00f Constantinos Venetsanopoulos
actual IPs. Now, restart the server to apply the changes:
142 a96ec00f Constantinos Venetsanopoulos
143 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
144 a96ec00f Constantinos Venetsanopoulos
145 a96ec00f Constantinos Venetsanopoulos
   # /etc/init.d/postgresql restart
146 a96ec00f Constantinos Venetsanopoulos
147 a96ec00f Constantinos Venetsanopoulos
Gunicorn setup
148 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~
149 a96ec00f Constantinos Venetsanopoulos
150 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo`` under ``/etc/gunicorn.d/`` containing the following:
151 a96ec00f Constantinos Venetsanopoulos
152 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
153 a96ec00f Constantinos Venetsanopoulos
154 a96ec00f Constantinos Venetsanopoulos
   CONFIG = {
155 a96ec00f Constantinos Venetsanopoulos
    'mode': 'django',
156 a96ec00f Constantinos Venetsanopoulos
    'environment': {
157 a96ec00f Constantinos Venetsanopoulos
      'DJANGO_SETTINGS_MODULE': 'synnefo.settings',
158 a96ec00f Constantinos Venetsanopoulos
    },
159 a96ec00f Constantinos Venetsanopoulos
    'working_dir': '/etc/synnefo',
160 a96ec00f Constantinos Venetsanopoulos
    'user': 'www-data',
161 a96ec00f Constantinos Venetsanopoulos
    'group': 'www-data',
162 a96ec00f Constantinos Venetsanopoulos
    'args': (
163 a96ec00f Constantinos Venetsanopoulos
      '--bind=127.0.0.1:8080',
164 a96ec00f Constantinos Venetsanopoulos
      '--workers=4',
165 a96ec00f Constantinos Venetsanopoulos
      '--log-level=debug',
166 a96ec00f Constantinos Venetsanopoulos
    ),
167 a96ec00f Constantinos Venetsanopoulos
   }
168 a96ec00f Constantinos Venetsanopoulos
169 a96ec00f Constantinos Venetsanopoulos
!!! Warning: Do NOT start the server yet, because it won't find the
170 a96ec00f Constantinos Venetsanopoulos
``synnefo.settings`` module. We will start the server after successful
171 a96ec00f Constantinos Venetsanopoulos
installation of astakos. If the server is running:
172 a96ec00f Constantinos Venetsanopoulos
173 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
174 a96ec00f Constantinos Venetsanopoulos
175 a96ec00f Constantinos Venetsanopoulos
   # /etc/init.d/gunicorn stop
176 a96ec00f Constantinos Venetsanopoulos
177 a96ec00f Constantinos Venetsanopoulos
Apache2 setup
178 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~
179 a96ec00f Constantinos Venetsanopoulos
180 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo`` under ``/etc/apache2/sites-available/`` containing
181 a96ec00f Constantinos Venetsanopoulos
the following:
182 a96ec00f Constantinos Venetsanopoulos
183 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
184 a96ec00f Constantinos Venetsanopoulos
185 a96ec00f Constantinos Venetsanopoulos
   <VirtualHost *:80>
186 a96ec00f Constantinos Venetsanopoulos
     ServerName node1.example.com
187 a96ec00f Constantinos Venetsanopoulos
188 a96ec00f Constantinos Venetsanopoulos
     RewriteEngine On
189 a96ec00f Constantinos Venetsanopoulos
     RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
190 a96ec00f Constantinos Venetsanopoulos
   </VirtualHost>
191 a96ec00f Constantinos Venetsanopoulos
192 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo-ssl`` under ``/etc/apache2/sites-available/``
193 a96ec00f Constantinos Venetsanopoulos
containing the following:
194 a96ec00f Constantinos Venetsanopoulos
195 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
196 a96ec00f Constantinos Venetsanopoulos
197 a96ec00f Constantinos Venetsanopoulos
   <IfModule mod_ssl.c>
198 a96ec00f Constantinos Venetsanopoulos
   <VirtualHost _default_:443>
199 a96ec00f Constantinos Venetsanopoulos
     ServerName node1.example.com
200 a96ec00f Constantinos Venetsanopoulos
201 a96ec00f Constantinos Venetsanopoulos
     Alias /static "/usr/share/synnefo/static"
202 a96ec00f Constantinos Venetsanopoulos
203 a96ec00f Constantinos Venetsanopoulos
   #  SetEnv no-gzip
204 a96ec00f Constantinos Venetsanopoulos
   #  SetEnv dont-vary
205 a96ec00f Constantinos Venetsanopoulos
206 a96ec00f Constantinos Venetsanopoulos
     RequestHeader set X-Forwarded-Protocol "https"
207 a96ec00f Constantinos Venetsanopoulos
208 a96ec00f Constantinos Venetsanopoulos
     <Proxy * >
209 a96ec00f Constantinos Venetsanopoulos
       Order allow,deny
210 a96ec00f Constantinos Venetsanopoulos
       Allow from all
211 a96ec00f Constantinos Venetsanopoulos
     </Proxy>
212 a96ec00f Constantinos Venetsanopoulos
213 a96ec00f Constantinos Venetsanopoulos
     SetEnv                proxy-sendchunked
214 a96ec00f Constantinos Venetsanopoulos
     SSLProxyEngine        off
215 a96ec00f Constantinos Venetsanopoulos
     ProxyErrorOverride    off
216 a96ec00f Constantinos Venetsanopoulos
217 a96ec00f Constantinos Venetsanopoulos
     ProxyPass        /static !
218 a96ec00f Constantinos Venetsanopoulos
     ProxyPass        / http://localhost:8080/ retry=0
219 a96ec00f Constantinos Venetsanopoulos
     ProxyPassReverse / http://localhost:8080/
220 a96ec00f Constantinos Venetsanopoulos
221 a96ec00f Constantinos Venetsanopoulos
     RewriteEngine On
222 a96ec00f Constantinos Venetsanopoulos
     RewriteRule ^/login(.*) /im/login/redirect$1 [PT,NE]
223 a96ec00f Constantinos Venetsanopoulos
224 a96ec00f Constantinos Venetsanopoulos
     SSLEngine on
225 a96ec00f Constantinos Venetsanopoulos
     SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
226 a96ec00f Constantinos Venetsanopoulos
     SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
227 a96ec00f Constantinos Venetsanopoulos
   </VirtualHost>
228 a96ec00f Constantinos Venetsanopoulos
   </IfModule>
229 a96ec00f Constantinos Venetsanopoulos
230 a96ec00f Constantinos Venetsanopoulos
Now enable sites and modules by running:
231 a96ec00f Constantinos Venetsanopoulos
232 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
233 a96ec00f Constantinos Venetsanopoulos
234 a96ec00f Constantinos Venetsanopoulos
   # a2enmod ssl
235 a96ec00f Constantinos Venetsanopoulos
   # a2enmod rewrite
236 a96ec00f Constantinos Venetsanopoulos
   # a2dissite default
237 a96ec00f Constantinos Venetsanopoulos
   # a2ensite synnefo
238 a96ec00f Constantinos Venetsanopoulos
   # a2ensite synnefo-ssl
239 a96ec00f Constantinos Venetsanopoulos
   # a2enmod headers
240 a96ec00f Constantinos Venetsanopoulos
   # a2enmod proxy_http
241 a96ec00f Constantinos Venetsanopoulos
242 a96ec00f Constantinos Venetsanopoulos
!!! Warning: Do NOT start/restart the server yet. If the server is running:
243 a96ec00f Constantinos Venetsanopoulos
244 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
245 a96ec00f Constantinos Venetsanopoulos
246 a96ec00f Constantinos Venetsanopoulos
   # /etc/init.d/apache2 stop
247 a96ec00f Constantinos Venetsanopoulos
248 a96ec00f Constantinos Venetsanopoulos
Pithos+ data directory setup
249 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250 a96ec00f Constantinos Venetsanopoulos
251 a96ec00f Constantinos Venetsanopoulos
As mentioned in the General Prerequisites section, there is a directory called
252 a96ec00f Constantinos Venetsanopoulos
``/srv/pithos`` visible by both nodes. We create and setup the ``data``
253 a96ec00f Constantinos Venetsanopoulos
directory inside it:
254 a96ec00f Constantinos Venetsanopoulos
255 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
256 a96ec00f Constantinos Venetsanopoulos
257 a96ec00f Constantinos Venetsanopoulos
   # cd /srv/pithos
258 a96ec00f Constantinos Venetsanopoulos
   # mkdir data
259 a96ec00f Constantinos Venetsanopoulos
   # chown www-data:www-data data
260 a96ec00f Constantinos Venetsanopoulos
   # chmod g+ws data
261 a96ec00f Constantinos Venetsanopoulos
262 a96ec00f Constantinos Venetsanopoulos
You are now ready with all general prerequisites concerning node1. Let's go to
263 a96ec00f Constantinos Venetsanopoulos
node2.
264 a96ec00f Constantinos Venetsanopoulos
265 a96ec00f Constantinos Venetsanopoulos
Node2
266 a96ec00f Constantinos Venetsanopoulos
-----
267 a96ec00f Constantinos Venetsanopoulos
268 a96ec00f Constantinos Venetsanopoulos
General Synnefo dependencies
269 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270 a96ec00f Constantinos Venetsanopoulos
271 a96ec00f Constantinos Venetsanopoulos
 * apache (http server)
272 a96ec00f Constantinos Venetsanopoulos
 * gunicorn (WSGI http server)
273 a96ec00f Constantinos Venetsanopoulos
 * postgresql (database)
274 a96ec00f Constantinos Venetsanopoulos
 * rabbitmq (message queue)
275 a96ec00f Constantinos Venetsanopoulos
276 a96ec00f Constantinos Venetsanopoulos
You can install the above by running:
277 a96ec00f Constantinos Venetsanopoulos
278 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
279 a96ec00f Constantinos Venetsanopoulos
280 a96ec00f Constantinos Venetsanopoulos
   # apt-get install apache2 gunicorn postgresql
281 a96ec00f Constantinos Venetsanopoulos
282 a96ec00f Constantinos Venetsanopoulos
Make sure you have installed the same package versions as in node1. Node2 will
283 a96ec00f Constantinos Venetsanopoulos
connect to the databases on node1, so you will also need the python-psycopg2
284 a96ec00f Constantinos Venetsanopoulos
package:
285 a96ec00f Constantinos Venetsanopoulos
286 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
287 a96ec00f Constantinos Venetsanopoulos
288 a96ec00f Constantinos Venetsanopoulos
   # apt-get install python-psycopg2
289 a96ec00f Constantinos Venetsanopoulos
290 a96ec00f Constantinos Venetsanopoulos
Database setup
291 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~
292 a96ec00f Constantinos Venetsanopoulos
293 a96ec00f Constantinos Venetsanopoulos
All databases have been created and setup on node1, so we do not need to take
294 a96ec00f Constantinos Venetsanopoulos
any action here. From node2, we will just connect to them. When you get familiar
295 a96ec00f Constantinos Venetsanopoulos
with the software you may choose to run different databases on different nodes,
296 a96ec00f Constantinos Venetsanopoulos
for performance/scalability/redundancy reasons, but those kind of setups are out
297 a96ec00f Constantinos Venetsanopoulos
of the purpose of this guide.
298 a96ec00f Constantinos Venetsanopoulos
299 a96ec00f Constantinos Venetsanopoulos
Gunicorn setup
300 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~~
301 a96ec00f Constantinos Venetsanopoulos
302 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo`` under ``/etc/gunicorn.d/`` containing the following
303 a96ec00f Constantinos Venetsanopoulos
(same contents as in node1; you can just copy/paste the file):
304 a96ec00f Constantinos Venetsanopoulos
305 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
306 a96ec00f Constantinos Venetsanopoulos
307 a96ec00f Constantinos Venetsanopoulos
   CONFIG = {
308 a96ec00f Constantinos Venetsanopoulos
    'mode': 'django',
309 a96ec00f Constantinos Venetsanopoulos
    'environment': {
310 a96ec00f Constantinos Venetsanopoulos
      'DJANGO_SETTINGS_MODULE': 'synnefo.settings',
311 a96ec00f Constantinos Venetsanopoulos
    },
312 a96ec00f Constantinos Venetsanopoulos
    'working_dir': '/etc/synnefo',
313 a96ec00f Constantinos Venetsanopoulos
    'user': 'www-data',
314 a96ec00f Constantinos Venetsanopoulos
    'group': 'www-data',
315 a96ec00f Constantinos Venetsanopoulos
    'args': (
316 a96ec00f Constantinos Venetsanopoulos
      '--bind=127.0.0.1:8080',
317 a96ec00f Constantinos Venetsanopoulos
      '--workers=4',
318 a96ec00f Constantinos Venetsanopoulos
      '--log-level=debug',
319 a96ec00f Constantinos Venetsanopoulos
    ),
320 a96ec00f Constantinos Venetsanopoulos
   }
321 a96ec00f Constantinos Venetsanopoulos
322 a96ec00f Constantinos Venetsanopoulos
!!! Warning: Do NOT start the server yet, because it won't find the
323 a96ec00f Constantinos Venetsanopoulos
``synnefo.settings`` module. We will start the server after successful
324 a96ec00f Constantinos Venetsanopoulos
installation of astakos. If the server is running:
325 a96ec00f Constantinos Venetsanopoulos
326 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
327 bdb83fd6 cven
328 a96ec00f Constantinos Venetsanopoulos
   # /etc/init.d/gunicorn stop
329 bdb83fd6 cven
330 a96ec00f Constantinos Venetsanopoulos
Apache2 setup
331 a96ec00f Constantinos Venetsanopoulos
~~~~~~~~~~~~~
332 5b6feb88 Vangelis Koukis
333 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo`` under ``/etc/apache2/sites-available/`` containing
334 a96ec00f Constantinos Venetsanopoulos
the following:
335 5b6feb88 Vangelis Koukis
336 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
337 a96ec00f Constantinos Venetsanopoulos
338 a96ec00f Constantinos Venetsanopoulos
   <VirtualHost *:80>
339 a96ec00f Constantinos Venetsanopoulos
     ServerName node2.example.com
340 a96ec00f Constantinos Venetsanopoulos
341 a96ec00f Constantinos Venetsanopoulos
     RewriteEngine On
342 a96ec00f Constantinos Venetsanopoulos
     RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
343 a96ec00f Constantinos Venetsanopoulos
   </VirtualHost>
344 a96ec00f Constantinos Venetsanopoulos
345 a96ec00f Constantinos Venetsanopoulos
Create the file ``synnefo-ssl`` under ``/etc/apache2/sites-available/``
346 a96ec00f Constantinos Venetsanopoulos
containing the following:
347 a96ec00f Constantinos Venetsanopoulos
348 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
349 a96ec00f Constantinos Venetsanopoulos
350 a96ec00f Constantinos Venetsanopoulos
   <IfModule mod_ssl.c>
351 a96ec00f Constantinos Venetsanopoulos
   <VirtualHost _default_:443>
352 a96ec00f Constantinos Venetsanopoulos
     ServerName node2.example.com
353 a96ec00f Constantinos Venetsanopoulos
354 a96ec00f Constantinos Venetsanopoulos
     Alias /static "/usr/share/synnefo/static"
355 a96ec00f Constantinos Venetsanopoulos
356 a96ec00f Constantinos Venetsanopoulos
     SetEnv no-gzip
357 a96ec00f Constantinos Venetsanopoulos
     SetEnv dont-vary
358 a96ec00f Constantinos Venetsanopoulos
359 a96ec00f Constantinos Venetsanopoulos
     RequestHeader set X-Forwarded-Protocol "https"
360 a96ec00f Constantinos Venetsanopoulos
361 a96ec00f Constantinos Venetsanopoulos
     <Proxy * >
362 a96ec00f Constantinos Venetsanopoulos
       Order allow,deny
363 a96ec00f Constantinos Venetsanopoulos
       Allow from all
364 a96ec00f Constantinos Venetsanopoulos
     </Proxy>
365 a96ec00f Constantinos Venetsanopoulos
366 a96ec00f Constantinos Venetsanopoulos
     SetEnv                proxy-sendchunked
367 a96ec00f Constantinos Venetsanopoulos
     SSLProxyEngine        off
368 a96ec00f Constantinos Venetsanopoulos
     ProxyErrorOverride    off
369 a96ec00f Constantinos Venetsanopoulos
370 a96ec00f Constantinos Venetsanopoulos
     ProxyPass        /static !
371 a96ec00f Constantinos Venetsanopoulos
     ProxyPass        / http://localhost:8080/ retry=0
372 a96ec00f Constantinos Venetsanopoulos
     ProxyPassReverse / http://localhost:8080/
373 a96ec00f Constantinos Venetsanopoulos
374 a96ec00f Constantinos Venetsanopoulos
     SSLEngine on
375 a96ec00f Constantinos Venetsanopoulos
     SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
376 a96ec00f Constantinos Venetsanopoulos
     SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
377 a96ec00f Constantinos Venetsanopoulos
   </VirtualHost>
378 a96ec00f Constantinos Venetsanopoulos
   </IfModule>
379 a96ec00f Constantinos Venetsanopoulos
380 a96ec00f Constantinos Venetsanopoulos
As in node1, enable sites and modules by running:
381 a96ec00f Constantinos Venetsanopoulos
382 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
383 a96ec00f Constantinos Venetsanopoulos
384 a96ec00f Constantinos Venetsanopoulos
   # a2enmod ssl
385 a96ec00f Constantinos Venetsanopoulos
   # a2enmod rewrite
386 a96ec00f Constantinos Venetsanopoulos
   # a2dissite default
387 a96ec00f Constantinos Venetsanopoulos
   # a2ensite synnefo
388 a96ec00f Constantinos Venetsanopoulos
   # a2ensite synnefo-ssl
389 a96ec00f Constantinos Venetsanopoulos
   # a2enmod headers
390 a96ec00f Constantinos Venetsanopoulos
   # a2enmod proxy_http
391 a96ec00f Constantinos Venetsanopoulos
392 a96ec00f Constantinos Venetsanopoulos
!!! Warning: Do NOT start/restart the server yet. If the server is running:
393 a96ec00f Constantinos Venetsanopoulos
394 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
395 a96ec00f Constantinos Venetsanopoulos
396 a96ec00f Constantinos Venetsanopoulos
   # /etc/init.d/apache2 stop
397 a96ec00f Constantinos Venetsanopoulos
398 a96ec00f Constantinos Venetsanopoulos
We are now ready with all general prerequisites for node2. Now that we have
399 a96ec00f Constantinos Venetsanopoulos
finished with all general prerequisites for both nodes, we can start installing
400 a96ec00f Constantinos Venetsanopoulos
the services. First, let's install Astakos on node1.
401 a96ec00f Constantinos Venetsanopoulos
402 a96ec00f Constantinos Venetsanopoulos
403 a96ec00f Constantinos Venetsanopoulos
Installation of Astakos on node1
404 a96ec00f Constantinos Venetsanopoulos
================================
405 a96ec00f Constantinos Venetsanopoulos
406 a96ec00f Constantinos Venetsanopoulos
To install astakos, grab the package from our repository (make sure  you made
407 a96ec00f Constantinos Venetsanopoulos
the additions needed in your ``/etc/apt/sources.list`` file, as described
408 a96ec00f Constantinos Venetsanopoulos
previously), by running:
409 a96ec00f Constantinos Venetsanopoulos
410 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
411 a96ec00f Constantinos Venetsanopoulos
412 a96ec00f Constantinos Venetsanopoulos
   # apt-get install snf-astakos-app
413 a96ec00f Constantinos Venetsanopoulos
414 a96ec00f Constantinos Venetsanopoulos
After successful installation of snf-astakos-app, make sure that also
415 a96ec00f Constantinos Venetsanopoulos
snf-webproject has been installed (marked as "Recommended" package). By default
416 a96ec00f Constantinos Venetsanopoulos
Debian installs "Recommended" packages, but if you have changed your
417 a96ec00f Constantinos Venetsanopoulos
configuration and the package didn't install automatically, you should
418 a96ec00f Constantinos Venetsanopoulos
explicitly install it manually running:
419 a96ec00f Constantinos Venetsanopoulos
420 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
421 a96ec00f Constantinos Venetsanopoulos
422 a96ec00f Constantinos Venetsanopoulos
   # apt-get install snf-webproject
423 a96ec00f Constantinos Venetsanopoulos
424 a96ec00f Constantinos Venetsanopoulos
The reason snf-webproject is "Recommended" and not a hard dependency, is to give
425 a96ec00f Constantinos Venetsanopoulos
the experienced administrator the ability to install synnefo in a custom made
426 a96ec00f Constantinos Venetsanopoulos
django project. This corner case concerns only very advanced users that know
427 a96ec00f Constantinos Venetsanopoulos
what they are doing and want to experiment with synnefo.
428 a96ec00f Constantinos Venetsanopoulos
429 a96ec00f Constantinos Venetsanopoulos
430 a96ec00f Constantinos Venetsanopoulos
Configuration of Astakos
431 a96ec00f Constantinos Venetsanopoulos
========================
432 a96ec00f Constantinos Venetsanopoulos
433 a96ec00f Constantinos Venetsanopoulos
Conf Files
434 a96ec00f Constantinos Venetsanopoulos
----------
435 a96ec00f Constantinos Venetsanopoulos
436 a96ec00f Constantinos Venetsanopoulos
After astakos is successfully installed, you will find the directory
437 a96ec00f Constantinos Venetsanopoulos
``/etc/synnefo`` and some configuration files inside it. The files contain
438 a96ec00f Constantinos Venetsanopoulos
commented configuration options, which are the default options. While installing
439 a96ec00f Constantinos Venetsanopoulos
new snf-* components, new configuration files will appear inside the directory.
440 a96ec00f Constantinos Venetsanopoulos
In this guide (and for all services), we will edit only the minimum necessary
441 a96ec00f Constantinos Venetsanopoulos
configuration options, to reflect our setup. Everything else will remain as is.
442 a96ec00f Constantinos Venetsanopoulos
443 a96ec00f Constantinos Venetsanopoulos
After getting familiar with synnefo, you will be able to customize the software
444 a96ec00f Constantinos Venetsanopoulos
as you wish and fits your needs. Many options are available, to empower the
445 a96ec00f Constantinos Venetsanopoulos
administrator with extensively customizable setups.
446 a96ec00f Constantinos Venetsanopoulos
447 a96ec00f Constantinos Venetsanopoulos
For the snf-webproject component (installed as an astakos dependency), we
448 a96ec00f Constantinos Venetsanopoulos
need the following:
449 a96ec00f Constantinos Venetsanopoulos
450 a96ec00f Constantinos Venetsanopoulos
Edit ``/etc/synnefo/10-snf-webproject-database.conf``. You will need to
451 a96ec00f Constantinos Venetsanopoulos
uncomment and edit the ``DATABASES`` block to reflect our database:
452 a96ec00f Constantinos Venetsanopoulos
453 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
454 a96ec00f Constantinos Venetsanopoulos
455 a96ec00f Constantinos Venetsanopoulos
   DATABASES = {
456 a96ec00f Constantinos Venetsanopoulos
    'default': {
457 a96ec00f Constantinos Venetsanopoulos
        # 'postgresql_psycopg2', 'postgresql','mysql', 'sqlite3' or 'oracle'
458 a96ec00f Constantinos Venetsanopoulos
        'ENGINE': 'postgresql_psycopg2',
459 a96ec00f Constantinos Venetsanopoulos
         # ATTENTION: This *must* be the absolute path if using sqlite3.
460 a96ec00f Constantinos Venetsanopoulos
         # See: http://docs.djangoproject.com/en/dev/ref/settings/#name
461 a96ec00f Constantinos Venetsanopoulos
        'NAME': 'snf_apps',
462 a96ec00f Constantinos Venetsanopoulos
        'USER': 'synnefo',                      # Not used with sqlite3.
463 a96ec00f Constantinos Venetsanopoulos
        'PASSWORD': 'examle_passw0rd',          # Not used with sqlite3.
464 a96ec00f Constantinos Venetsanopoulos
        # Set to empty string for localhost. Not used with sqlite3.
465 a96ec00f Constantinos Venetsanopoulos
        'HOST': '4.3.2.1',
466 a96ec00f Constantinos Venetsanopoulos
        # Set to empty string for default. Not used with sqlite3.
467 a96ec00f Constantinos Venetsanopoulos
        'PORT': '5432',
468 a96ec00f Constantinos Venetsanopoulos
    }
469 a96ec00f Constantinos Venetsanopoulos
   }
470 a96ec00f Constantinos Venetsanopoulos
471 a96ec00f Constantinos Venetsanopoulos
Edit ``/etc/synnefo/10-snf-webproject-deploy.conf``. Uncomment and edit
472 a96ec00f Constantinos Venetsanopoulos
``SECRET_KEY``. This is a django specific setting which is used to provide a
473 a96ec00f Constantinos Venetsanopoulos
seed in secret-key hashing algorithms. Set this to a random string of your
474 a96ec00f Constantinos Venetsanopoulos
choise and keep it private:
475 a96ec00f Constantinos Venetsanopoulos
476 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
477 a96ec00f Constantinos Venetsanopoulos
478 a96ec00f Constantinos Venetsanopoulos
   SECRET_KEY = 'sy6)mw6a7x%n)-example_secret_key#zzk4jo6f2=uqu!1o%)'
479 a96ec00f Constantinos Venetsanopoulos
480 a96ec00f Constantinos Venetsanopoulos
For astakos specific configuration, edit the following options in
481 a96ec00f Constantinos Venetsanopoulos
``/etc/synnefo/20-snf-astakos-setting.conf`` :
482 a96ec00f Constantinos Venetsanopoulos
483 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
484 a96ec00f Constantinos Venetsanopoulos
485 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_IM_MODULES = ['local']
486 a96ec00f Constantinos Venetsanopoulos
487 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_COOKIE_DOMAIN = '.example.com'
488 a96ec00f Constantinos Venetsanopoulos
489 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_BASEURL = 'https://node1.example.com'
490 a96ec00f Constantinos Venetsanopoulos
491 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_SITENAME = '~okeanos demo example'
492 a96ec00f Constantinos Venetsanopoulos
493 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_CLOUD_SERVICES = (
494 a96ec00f Constantinos Venetsanopoulos
           { 'url':'https://node1.example.com/im/', 'name':'~okeanos home', 'id':'cloud', 'icon':'home-icon.png' },
495 a96ec00f Constantinos Venetsanopoulos
           { 'url':'https://node1.example.com/ui/', 'name':'cyclades', 'id':'cyclades' },
496 a96ec00f Constantinos Venetsanopoulos
           { 'url':'https://node2.example.com/ui/', 'name':'pithos+', 'id':'pithos' })
497 a96ec00f Constantinos Venetsanopoulos
498 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_RECAPTCHA_PUBLIC_KEY = 'example_recaptcha_public_key!@#$%^&*('
499 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_RECAPTCHA_PRIVATE_KEY = 'example_recaptcha_private_key!@#$%^&*('
500 5b6feb88 Vangelis Koukis
501 a96ec00f Constantinos Venetsanopoulos
   ASTAKOS_RECAPTCHA_USE_SSL = True
502 5b6feb88 Vangelis Koukis
503 a96ec00f Constantinos Venetsanopoulos
``ASTAKOS_IM_MODULES`` refers to the astakos login methods. For now only local
504 a96ec00f Constantinos Venetsanopoulos
is supported. The ``ASTAKOS_COOKIE_DOMAIN`` should be the base url of our
505 a96ec00f Constantinos Venetsanopoulos
domain (for all services). ``ASTAKOS_BASEURL`` is the astakos home page.
506 a96ec00f Constantinos Venetsanopoulos
``ASTAKOS_CLOUD_SERVICES`` contains all services visible to and served by
507 a96ec00f Constantinos Venetsanopoulos
astakos. The first element of the dictionary is used to point to a generic
508 a96ec00f Constantinos Venetsanopoulos
landing page for your services (cyclades, pithos). If you don't have such a
509 a96ec00f Constantinos Venetsanopoulos
page it can be omitted. The second and third element point to our services
510 a96ec00f Constantinos Venetsanopoulos
themselves (the apps) and should be set as above.
511 5b6feb88 Vangelis Koukis
512 a96ec00f Constantinos Venetsanopoulos
For the ``ASTAKOS_RECAPTCHA_PUBLIC_KEY`` and ``ASTAKOS_RECAPTCHA_PRIVATE_KEY``
513 a96ec00f Constantinos Venetsanopoulos
go to https://www.google.com/recaptcha/admin/create and create your own pair.
514 5b6feb88 Vangelis Koukis
515 a96ec00f Constantinos Venetsanopoulos
Servers Initialization
516 a96ec00f Constantinos Venetsanopoulos
----------------------
517 5b6feb88 Vangelis Koukis
518 a96ec00f Constantinos Venetsanopoulos
After configuration is done, we initialize the servers on node1:
519 5b6feb88 Vangelis Koukis
520 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
521 a96ec00f Constantinos Venetsanopoulos
522 a96ec00f Constantinos Venetsanopoulos
   root@node1:~ # /etc/init.d/gunicorn restart
523 a96ec00f Constantinos Venetsanopoulos
   root@node1:~ # /etc/init.d/apache2 restart
524 a96ec00f Constantinos Venetsanopoulos
525 a96ec00f Constantinos Venetsanopoulos
Database Initialization
526 a96ec00f Constantinos Venetsanopoulos
-----------------------
527 a96ec00f Constantinos Venetsanopoulos
528 a96ec00f Constantinos Venetsanopoulos
Then, we initialize the database by running:
529 5b6feb88 Vangelis Koukis
530 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
531 a96ec00f Constantinos Venetsanopoulos
532 a96ec00f Constantinos Venetsanopoulos
   # snf-manage syncdb
533 a96ec00f Constantinos Venetsanopoulos
534 a96ec00f Constantinos Venetsanopoulos
At this example we don't need to create a django superuser, so we select
535 a96ec00f Constantinos Venetsanopoulos
``[no]`` to the question. After a successful sync, we run the migration needed
536 a96ec00f Constantinos Venetsanopoulos
for astakos:
537 5b6feb88 Vangelis Koukis
538 5b6feb88 Vangelis Koukis
.. code-block:: console
539 5b6feb88 Vangelis Koukis
540 a96ec00f Constantinos Venetsanopoulos
   # snf-manage migrate im
541 a96ec00f Constantinos Venetsanopoulos
542 a96ec00f Constantinos Venetsanopoulos
You have now finished the Astakos setup. Let's test it now.
543 a96ec00f Constantinos Venetsanopoulos
544 a96ec00f Constantinos Venetsanopoulos
545 a96ec00f Constantinos Venetsanopoulos
Testing of Astakos
546 a96ec00f Constantinos Venetsanopoulos
==================
547 a96ec00f Constantinos Venetsanopoulos
548 a96ec00f Constantinos Venetsanopoulos
Open your favorite browser and go to:
549 a96ec00f Constantinos Venetsanopoulos
550 a96ec00f Constantinos Venetsanopoulos
``http://node1.example.com/im``
551 a96ec00f Constantinos Venetsanopoulos
552 a96ec00f Constantinos Venetsanopoulos
If this redirects you to ``https://node1.example.com/im`` and you can see
553 a96ec00f Constantinos Venetsanopoulos
the "welcome" door of Astakos, then you have successfully setup Astakos.
554 a96ec00f Constantinos Venetsanopoulos
555 a96ec00f Constantinos Venetsanopoulos
Let's create our first user. At the homepage click the "CREATE ACCOUNT" button
556 a96ec00f Constantinos Venetsanopoulos
and fill all your data at the sign up form. Then click "SUBMIT". You should now
557 a96ec00f Constantinos Venetsanopoulos
see a green box on the top, which informs you that you made a successful request
558 a96ec00f Constantinos Venetsanopoulos
and the request has been sent to the administrators. So far so good.
559 a96ec00f Constantinos Venetsanopoulos
560 a96ec00f Constantinos Venetsanopoulos
Now we need to activate that user. Return to a command prompt at node1 and run:
561 a96ec00f Constantinos Venetsanopoulos
562 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
563 a96ec00f Constantinos Venetsanopoulos
564 a96ec00f Constantinos Venetsanopoulos
   root@node1:~ # snf-manage listusers
565 a96ec00f Constantinos Venetsanopoulos
566 a96ec00f Constantinos Venetsanopoulos
This command should show you a list with only one user; the one we just created.
567 a96ec00f Constantinos Venetsanopoulos
This user should have an id with a value of ``1``. It should also have an
568 a96ec00f Constantinos Venetsanopoulos
"active" status with the value of ``0`` (inactive). Now run:
569 a96ec00f Constantinos Venetsanopoulos
570 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
571 a96ec00f Constantinos Venetsanopoulos
572 a96ec00f Constantinos Venetsanopoulos
   root@node1:~ # snf-manage modifyuser --set-active 1
573 a96ec00f Constantinos Venetsanopoulos
574 a96ec00f Constantinos Venetsanopoulos
This modifies the active value to ``1``, and actually activates the user.
575 a96ec00f Constantinos Venetsanopoulos
When running in production, the activation is done automatically with different
576 a96ec00f Constantinos Venetsanopoulos
types of moderation, that Astakos supports. You can see the moderation methods
577 a96ec00f Constantinos Venetsanopoulos
(by invitation, whitelists, matching regexp, etc.) at the Astakos specific
578 a96ec00f Constantinos Venetsanopoulos
documentation.
579 a96ec00f Constantinos Venetsanopoulos
580 a96ec00f Constantinos Venetsanopoulos
Now let's go back to the homepage. Open ``http://node1.example.com/im`` with
581 a96ec00f Constantinos Venetsanopoulos
your browser again. Try to sign in using your new credentials. If the astakos
582 a96ec00f Constantinos Venetsanopoulos
menu appears and you can see your profile, then you have successfully setup
583 a96ec00f Constantinos Venetsanopoulos
Astakos.
584 a96ec00f Constantinos Venetsanopoulos
585 a96ec00f Constantinos Venetsanopoulos
Let's continue to install Pithos+ now.
586 a96ec00f Constantinos Venetsanopoulos
587 a96ec00f Constantinos Venetsanopoulos
588 a96ec00f Constantinos Venetsanopoulos
Installation of Pithos+ on node2
589 a96ec00f Constantinos Venetsanopoulos
================================
590 a96ec00f Constantinos Venetsanopoulos
591 138253bc Constantinos Venetsanopoulos
To install pithos+, grab the packages from our repository (make sure  you made
592 a96ec00f Constantinos Venetsanopoulos
the additions needed in your ``/etc/apt/sources.list`` file, as described
593 a96ec00f Constantinos Venetsanopoulos
previously), by running:
594 a96ec00f Constantinos Venetsanopoulos
595 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
596 a96ec00f Constantinos Venetsanopoulos
597 a96ec00f Constantinos Venetsanopoulos
   # apt-get install snf-pithos-app
598 a96ec00f Constantinos Venetsanopoulos
599 a96ec00f Constantinos Venetsanopoulos
After successful installation of snf-pithos-app, make sure that also
600 a96ec00f Constantinos Venetsanopoulos
snf-webproject has been installed (marked as "Recommended" package). Refer to
601 a96ec00f Constantinos Venetsanopoulos
the "Installation of Astakos on node1" section, if you don't remember why this
602 138253bc Constantinos Venetsanopoulos
should happen. Now, install the pithos web interface:
603 a96ec00f Constantinos Venetsanopoulos
604 138253bc Constantinos Venetsanopoulos
.. code-block:: console
605 138253bc Constantinos Venetsanopoulos
606 138253bc Constantinos Venetsanopoulos
   # apt-get install snf-pithos-webclient
607 138253bc Constantinos Venetsanopoulos
608 138253bc Constantinos Venetsanopoulos
This package provides the standalone pithos web client. The web client is the
609 138253bc Constantinos Venetsanopoulos
web UI for pithos+ and will be accessible by clicking "pithos+" on the Astakos
610 138253bc Constantinos Venetsanopoulos
interface's cloudbar, at the top of the Astakos homepage.
611 a96ec00f Constantinos Venetsanopoulos
612 a96ec00f Constantinos Venetsanopoulos
Configuration of Pithos+
613 a96ec00f Constantinos Venetsanopoulos
========================
614 a96ec00f Constantinos Venetsanopoulos
615 a96ec00f Constantinos Venetsanopoulos
Conf Files
616 a96ec00f Constantinos Venetsanopoulos
----------
617 a96ec00f Constantinos Venetsanopoulos
618 a96ec00f Constantinos Venetsanopoulos
After pithos+ is successfully installed, you will find the directory
619 a96ec00f Constantinos Venetsanopoulos
``/etc/synnefo`` and some configuration files inside it, as you did in node1
620 a96ec00f Constantinos Venetsanopoulos
after installation of astakos. Here, you will not have to change anything that
621 a96ec00f Constantinos Venetsanopoulos
has to do with snf-common or snf-webproject. Everything is set at node1. You
622 138253bc Constantinos Venetsanopoulos
only need to change settings that have to do with pithos+. Specifically:
623 a96ec00f Constantinos Venetsanopoulos
624 a96ec00f Constantinos Venetsanopoulos
Edit ``/etc/synnefo/20-snf-pithos-app-settings.conf``. There you need to set
625 a96ec00f Constantinos Venetsanopoulos
only the two options:
626 a96ec00f Constantinos Venetsanopoulos
627 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
628 a96ec00f Constantinos Venetsanopoulos
629 a96ec00f Constantinos Venetsanopoulos
   PITHOS_BACKEND_DB_CONNECTION = 'postgresql://synnefo:example_passw0rd@node1.example.com:5432/snf_pithos'
630 a96ec00f Constantinos Venetsanopoulos
631 a96ec00f Constantinos Venetsanopoulos
   PITHOS_BACKEND_BLOCK_PATH = '/srv/pithos/data'
632 a96ec00f Constantinos Venetsanopoulos
633 a96ec00f Constantinos Venetsanopoulos
The ``PITHOS_BACKEND_DB_CONNECTION`` option tells to the pithos+ backend where
634 a96ec00f Constantinos Venetsanopoulos
to find its database. Above we tell pithos+ that its database is ``snf_pithos``
635 a96ec00f Constantinos Venetsanopoulos
at node1 and to connect as user ``synnefo`` with password ``example_passw0rd``.
636 a96ec00f Constantinos Venetsanopoulos
All those settings where setup during node1's "Database setup" section.
637 a96ec00f Constantinos Venetsanopoulos
638 a96ec00f Constantinos Venetsanopoulos
The ``PITHOS_BACKEND_BLOCK_PATH`` option tells to the pithos+ backend where to
639 a96ec00f Constantinos Venetsanopoulos
store its data. Above we tell pithos+ to store its data under
640 a96ec00f Constantinos Venetsanopoulos
``/srv/pithos/data``, which is visible by both nodes. We have already setup this
641 a96ec00f Constantinos Venetsanopoulos
directory at node1's "Pithos+ data directory setup" section.
642 a96ec00f Constantinos Venetsanopoulos
643 138253bc Constantinos Venetsanopoulos
Then we need to setup the web UI and connect it to astakos. To do so, edit
644 138253bc Constantinos Venetsanopoulos
``/etc/synnefo/20-snf-pithos-webclient-settings.conf``:
645 138253bc Constantinos Venetsanopoulos
646 138253bc Constantinos Venetsanopoulos
.. code-block:: console
647 138253bc Constantinos Venetsanopoulos
648 138253bc Constantinos Venetsanopoulos
   PITHOS_UI_LOGIN_URL = "https://node1.example.com/im/login?next="
649 138253bc Constantinos Venetsanopoulos
   PITHOS_UI_FEEDBACK_URL = "https://node1.example.com/im/feedback"
650 138253bc Constantinos Venetsanopoulos
651 138253bc Constantinos Venetsanopoulos
The ``PITHOS_UI_LOGIN_URL`` option tells the client where to redirect you, if
652 138253bc Constantinos Venetsanopoulos
you are not logged in. The ``PITHOS_UI_FEEDBACK_URL`` option points at the
653 138253bc Constantinos Venetsanopoulos
pithos+ feedback form. Astakos already provides a generic feedback form for all
654 138253bc Constantinos Venetsanopoulos
services, so we use this one.
655 138253bc Constantinos Venetsanopoulos
656 138253bc Constantinos Venetsanopoulos
Then edit ``/etc/synnefo/20-snf-pithos-webclient-cloudbar.conf``, to connect the
657 138253bc Constantinos Venetsanopoulos
pithos+ web UI with the astakos web UI (through the top cloudbar):
658 138253bc Constantinos Venetsanopoulos
659 138253bc Constantinos Venetsanopoulos
.. code-block:: console
660 138253bc Constantinos Venetsanopoulos
661 138253bc Constantinos Venetsanopoulos
   CLOUDBAR_LOCATION = 'https://node1.example.com/static/im/cloudbar/'
662 138253bc Constantinos Venetsanopoulos
   CLOUDBAR_ACTIVE_SERVICE = 'pithos'
663 138253bc Constantinos Venetsanopoulos
   CLOUDBAR_SERVICES_URL = 'https://node1.example.com/im/get_services'
664 138253bc Constantinos Venetsanopoulos
   CLOUDBAR_MENU_URL = 'https://node1.example.com/im/get_menu'
665 138253bc Constantinos Venetsanopoulos
666 138253bc Constantinos Venetsanopoulos
The ``CLOUDBAR_LOCATION`` tells the client where to find the astakos common
667 138253bc Constantinos Venetsanopoulos
cloudbar.
668 138253bc Constantinos Venetsanopoulos
669 138253bc Constantinos Venetsanopoulos
The ``CLOUDBAR_ACTIVE_SERVICE`` registers the client as a new service served by
670 138253bc Constantinos Venetsanopoulos
astakos. It's name should be identical with the ``id`` name given at the
671 138253bc Constantinos Venetsanopoulos
astakos' ``ASTAKOS_CLOUD_SERVICES`` variable. Note that at the Astakos "Conf
672 138253bc Constantinos Venetsanopoulos
Files" section, we actually set the third item of the ``ASTAKOS_CLOUD_SERVICES``
673 138253bc Constantinos Venetsanopoulos
list, to the dictionary:
674 138253bc Constantinos Venetsanopoulos
``{ 'url':'https://nod...', 'name':'pithos+', 'id':'pithos }``. This item
675 138253bc Constantinos Venetsanopoulos
represents the pithos+ service. The ``id`` we set there, is the ``id`` we want
676 138253bc Constantinos Venetsanopoulos
here.
677 138253bc Constantinos Venetsanopoulos
678 138253bc Constantinos Venetsanopoulos
The ``CLOUDBAR_SERVICES_URL`` and ``CLOUDBAR_MENU_URL`` options are used by the
679 138253bc Constantinos Venetsanopoulos
pithos+ web client to get from astakos all the information needed to fill its
680 138253bc Constantinos Venetsanopoulos
own cloudbar.  So we put our astakos deployment urls there.
681 138253bc Constantinos Venetsanopoulos
682 a96ec00f Constantinos Venetsanopoulos
Servers Initialization
683 a96ec00f Constantinos Venetsanopoulos
----------------------
684 a96ec00f Constantinos Venetsanopoulos
685 a96ec00f Constantinos Venetsanopoulos
After configuration is done, we initialize the servers on node2:
686 a96ec00f Constantinos Venetsanopoulos
687 a96ec00f Constantinos Venetsanopoulos
.. code-block:: console
688 a96ec00f Constantinos Venetsanopoulos
689 a96ec00f Constantinos Venetsanopoulos
   root@node2:~ # /etc/init.d/gunicorn restart
690 a96ec00f Constantinos Venetsanopoulos
   root@node2:~ # /etc/init.d/apache2 restart
691 a96ec00f Constantinos Venetsanopoulos
692 a96ec00f Constantinos Venetsanopoulos
You have now finished the Pithos+ setup. Let's test it now.
693 a96ec00f Constantinos Venetsanopoulos
694 a96ec00f Constantinos Venetsanopoulos
695 a96ec00f Constantinos Venetsanopoulos
Testing of Pithos+
696 a96ec00f Constantinos Venetsanopoulos
==================
697 a96ec00f Constantinos Venetsanopoulos
698 a96ec00f Constantinos Venetsanopoulos
699 a96ec00f Constantinos Venetsanopoulos
Installation of Cyclades (and Plankton) on node1
700 a96ec00f Constantinos Venetsanopoulos
================================================
701 a96ec00f Constantinos Venetsanopoulos
702 bc055d09 Constantinos Venetsanopoulos
Installation of cyclades is a two step process:
703 bc055d09 Constantinos Venetsanopoulos
704 bc055d09 Constantinos Venetsanopoulos
1. install the external services (prerequisites) on which cyclades depends
705 bc055d09 Constantinos Venetsanopoulos
2. install the synnefo software components associated with cyclades
706 bc055d09 Constantinos Venetsanopoulos
707 bc055d09 Constantinos Venetsanopoulos
Prerequisites
708 bc055d09 Constantinos Venetsanopoulos
-------------
709 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-ganeti:
710 bc055d09 Constantinos Venetsanopoulos
711 bc055d09 Constantinos Venetsanopoulos
Ganeti installation
712 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~~~~~~~~~~~~
713 bc055d09 Constantinos Venetsanopoulos
714 bc055d09 Constantinos Venetsanopoulos
Synnefo requires a working Ganeti installation at the backend. Installation
715 bc055d09 Constantinos Venetsanopoulos
of Ganeti is not covered by this document, please refer to
716 bc055d09 Constantinos Venetsanopoulos
`ganeti documentation <http://docs.ganeti.org/ganeti/current/html>`_ for all the
717 bc055d09 Constantinos Venetsanopoulos
gory details. A successful Ganeti installation concludes with a working
718 bc055d09 Constantinos Venetsanopoulos
:ref:`GANETI-MASTER <GANETI_NODES>` and a number of :ref:`GANETI-NODEs <GANETI_NODES>`.
719 bc055d09 Constantinos Venetsanopoulos
720 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-db:
721 bc055d09 Constantinos Venetsanopoulos
722 bc055d09 Constantinos Venetsanopoulos
Database
723 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~
724 bc055d09 Constantinos Venetsanopoulos
725 bc055d09 Constantinos Venetsanopoulos
Database installation is done as part of the
726 bc055d09 Constantinos Venetsanopoulos
:ref:`snf-webproject <snf-webproject>` component.
727 bc055d09 Constantinos Venetsanopoulos
728 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-rabbitmq:
729 bc055d09 Constantinos Venetsanopoulos
730 bc055d09 Constantinos Venetsanopoulos
RabbitMQ
731 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~
732 bc055d09 Constantinos Venetsanopoulos
733 bc055d09 Constantinos Venetsanopoulos
RabbitMQ is used as a generic message broker for cyclades. It should be
734 bc055d09 Constantinos Venetsanopoulos
installed on two seperate :ref:`QUEUE <QUEUE_NODE>` nodes in a high availability
735 bc055d09 Constantinos Venetsanopoulos
configuration as described here:
736 bc055d09 Constantinos Venetsanopoulos
737 bc055d09 Constantinos Venetsanopoulos
    http://www.rabbitmq.com/pacemaker.html
738 bc055d09 Constantinos Venetsanopoulos
739 bc055d09 Constantinos Venetsanopoulos
After installation, create a user and set its permissions:
740 bc055d09 Constantinos Venetsanopoulos
741 bc055d09 Constantinos Venetsanopoulos
.. code-block:: console
742 bc055d09 Constantinos Venetsanopoulos
743 bc055d09 Constantinos Venetsanopoulos
    $ rabbitmqctl add_user <username> <password>
744 bc055d09 Constantinos Venetsanopoulos
    $ rabbitmqctl set_permissions -p / <username>  "^.*" ".*" ".*"
745 bc055d09 Constantinos Venetsanopoulos
746 bc055d09 Constantinos Venetsanopoulos
The values set for the user and password must be mirrored in the
747 bc055d09 Constantinos Venetsanopoulos
``RABBIT_*`` variables in your settings, as managed by
748 bc055d09 Constantinos Venetsanopoulos
:ref:`snf-common <snf-common>`.
749 bc055d09 Constantinos Venetsanopoulos
750 bc055d09 Constantinos Venetsanopoulos
.. todo:: Document an active-active configuration based on the latest version
751 bc055d09 Constantinos Venetsanopoulos
   of RabbitMQ.
752 bc055d09 Constantinos Venetsanopoulos
753 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-vncauthproxy:
754 bc055d09 Constantinos Venetsanopoulos
755 bc055d09 Constantinos Venetsanopoulos
vncauthproxy
756 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~~~~~
757 bc055d09 Constantinos Venetsanopoulos
758 bc055d09 Constantinos Venetsanopoulos
To support OOB console access to the VMs over VNC, the vncauthproxy
759 bc055d09 Constantinos Venetsanopoulos
daemon must be running on every :ref:`APISERVER <APISERVER_NODE>` node.
760 bc055d09 Constantinos Venetsanopoulos
761 bc055d09 Constantinos Venetsanopoulos
.. note:: The Debian package for vncauthproxy undertakes all configuration
762 bc055d09 Constantinos Venetsanopoulos
   automatically.
763 bc055d09 Constantinos Venetsanopoulos
764 bc055d09 Constantinos Venetsanopoulos
Download and install the latest vncauthproxy from its own repository,
765 bc055d09 Constantinos Venetsanopoulos
at `https://code.grnet.gr/git/vncauthproxy`, or a specific commit:
766 bc055d09 Constantinos Venetsanopoulos
767 bc055d09 Constantinos Venetsanopoulos
.. code-block:: console
768 bc055d09 Constantinos Venetsanopoulos
769 bc055d09 Constantinos Venetsanopoulos
    $ bin/pip install -e git+https://code.grnet.gr/git/vncauthproxy@INSERT_COMMIT_HERE#egg=vncauthproxy
770 bc055d09 Constantinos Venetsanopoulos
771 bc055d09 Constantinos Venetsanopoulos
Create ``/var/log/vncauthproxy`` and set its permissions appropriately.
772 bc055d09 Constantinos Venetsanopoulos
773 bc055d09 Constantinos Venetsanopoulos
Alternatively, build and install Debian packages.
774 bc055d09 Constantinos Venetsanopoulos
775 bc055d09 Constantinos Venetsanopoulos
.. code-block:: console
776 bc055d09 Constantinos Venetsanopoulos
777 bc055d09 Constantinos Venetsanopoulos
    $ git checkout debian
778 bc055d09 Constantinos Venetsanopoulos
    $ dpkg-buildpackage -b -uc -us
779 bc055d09 Constantinos Venetsanopoulos
    # dpkg -i ../vncauthproxy_1.0-1_all.deb
780 bc055d09 Constantinos Venetsanopoulos
781 bc055d09 Constantinos Venetsanopoulos
.. warning::
782 bc055d09 Constantinos Venetsanopoulos
    **Failure to build the package on the Mac.**
783 bc055d09 Constantinos Venetsanopoulos
784 bc055d09 Constantinos Venetsanopoulos
    ``libevent``, a requirement for gevent which in turn is a requirement for
785 bc055d09 Constantinos Venetsanopoulos
    vncauthproxy is not included in `MacOSX` by default and installing it with
786 bc055d09 Constantinos Venetsanopoulos
    MacPorts does not lead to a version that can be found by the gevent
787 bc055d09 Constantinos Venetsanopoulos
    build process. A quick workaround is to execute the following commands::
788 bc055d09 Constantinos Venetsanopoulos
789 bc055d09 Constantinos Venetsanopoulos
        $ cd $SYNNEFO
790 bc055d09 Constantinos Venetsanopoulos
        $ sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
791 bc055d09 Constantinos Venetsanopoulos
        <the above fails>
792 bc055d09 Constantinos Venetsanopoulos
        $ cd build/gevent
793 bc055d09 Constantinos Venetsanopoulos
        $ sudo python setup.py -I/opt/local/include -L/opt/local/lib build
794 bc055d09 Constantinos Venetsanopoulos
        $ cd $SYNNEFO
795 bc055d09 Constantinos Venetsanopoulos
        $ sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
796 bc055d09 Constantinos Venetsanopoulos
797 bc055d09 Constantinos Venetsanopoulos
.. todo:: Mention vncauthproxy bug, snf-vncauthproxy, inability to install using pip
798 bc055d09 Constantinos Venetsanopoulos
.. todo:: kpap: fix installation commands
799 bc055d09 Constantinos Venetsanopoulos
800 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-nfdhcpd:
801 bc055d09 Constantinos Venetsanopoulos
802 bc055d09 Constantinos Venetsanopoulos
NFDHCPD
803 bc055d09 Constantinos Venetsanopoulos
~~~~~~~
804 bc055d09 Constantinos Venetsanopoulos
805 bc055d09 Constantinos Venetsanopoulos
Setup Synnefo-specific networking on the Ganeti backend.
806 bc055d09 Constantinos Venetsanopoulos
This part is deployment-specific and must be customized based on the
807 bc055d09 Constantinos Venetsanopoulos
specific needs of the system administrators.
808 bc055d09 Constantinos Venetsanopoulos
809 bc055d09 Constantinos Venetsanopoulos
A reference installation will use a Synnefo-specific KVM ifup script,
810 bc055d09 Constantinos Venetsanopoulos
NFDHCPD and pre-provisioned Linux bridges to support public and private
811 bc055d09 Constantinos Venetsanopoulos
network functionality. For this:
812 bc055d09 Constantinos Venetsanopoulos
813 bc055d09 Constantinos Venetsanopoulos
Grab NFDHCPD from its own repository (https://code.grnet.gr/git/nfdhcpd),
814 bc055d09 Constantinos Venetsanopoulos
install it, modify ``/etc/nfdhcpd/nfdhcpd.conf`` to reflect your network
815 bc055d09 Constantinos Venetsanopoulos
configuration.
816 bc055d09 Constantinos Venetsanopoulos
817 bc055d09 Constantinos Venetsanopoulos
Install a custom KVM ifup script for use by Ganeti, as
818 bc055d09 Constantinos Venetsanopoulos
``/etc/ganeti/kvm-vif-bridge``, on GANETI-NODEs. A sample implementation is
819 bc055d09 Constantinos Venetsanopoulos
provided under ``/contrib/ganeti-hooks``. Set ``NFDHCPD_STATE_DIR`` to point
820 bc055d09 Constantinos Venetsanopoulos
to NFDHCPD's state directory, usually ``/var/lib/nfdhcpd``.
821 bc055d09 Constantinos Venetsanopoulos
822 bc055d09 Constantinos Venetsanopoulos
.. todo:: soc: document NFDHCPD installation, settle on KVM ifup script
823 bc055d09 Constantinos Venetsanopoulos
824 bc055d09 Constantinos Venetsanopoulos
.. _cyclades-install-snfimage:
825 bc055d09 Constantinos Venetsanopoulos
826 bc055d09 Constantinos Venetsanopoulos
snf-image
827 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~~
828 bc055d09 Constantinos Venetsanopoulos
829 bc055d09 Constantinos Venetsanopoulos
Install the :ref:`snf-image <snf-image>` Ganeti OS provider for image
830 bc055d09 Constantinos Venetsanopoulos
deployment.
831 bc055d09 Constantinos Venetsanopoulos
832 bc055d09 Constantinos Venetsanopoulos
For :ref:`cyclades <cyclades>` to be able to launch VMs from specified
833 bc055d09 Constantinos Venetsanopoulos
Images, you need the snf-image OS Provider installed on *all* Ganeti nodes.
834 bc055d09 Constantinos Venetsanopoulos
835 bc055d09 Constantinos Venetsanopoulos
Please see `https://code.grnet.gr/projects/snf-image/wiki`_
836 bc055d09 Constantinos Venetsanopoulos
for installation instructions and documentation on the design
837 bc055d09 Constantinos Venetsanopoulos
and implementation of snf-image.
838 bc055d09 Constantinos Venetsanopoulos
839 bc055d09 Constantinos Venetsanopoulos
Please see `https://code.grnet.gr/projects/snf-image/files`
840 bc055d09 Constantinos Venetsanopoulos
for the latest packages.
841 bc055d09 Constantinos Venetsanopoulos
842 bc055d09 Constantinos Venetsanopoulos
Images should be stored in ``extdump``, or ``diskdump`` format in a directory
843 bc055d09 Constantinos Venetsanopoulos
of your choice, configurable as ``IMAGE_DIR`` in
844 bc055d09 Constantinos Venetsanopoulos
:file:`/etc/default/snf-image`.
845 bc055d09 Constantinos Venetsanopoulos
846 bc055d09 Constantinos Venetsanopoulos
synnefo components
847 bc055d09 Constantinos Venetsanopoulos
------------------
848 bc055d09 Constantinos Venetsanopoulos
849 bc055d09 Constantinos Venetsanopoulos
You need to install the appropriate synnefo software components on each node,
850 bc055d09 Constantinos Venetsanopoulos
depending on its type, see :ref:`Architecture <cyclades-architecture>`.
851 bc055d09 Constantinos Venetsanopoulos
852 bc055d09 Constantinos Venetsanopoulos
Most synnefo components have dependencies on additional Python packages.
853 bc055d09 Constantinos Venetsanopoulos
The dependencies are described inside each package, and are setup
854 bc055d09 Constantinos Venetsanopoulos
automatically when installing using :command:`pip`, or when installing
855 bc055d09 Constantinos Venetsanopoulos
using your system's package manager.
856 bc055d09 Constantinos Venetsanopoulos
857 bc055d09 Constantinos Venetsanopoulos
Please see the page of each synnefo software component for specific
858 bc055d09 Constantinos Venetsanopoulos
installation instructions, where applicable.
859 bc055d09 Constantinos Venetsanopoulos
860 bc055d09 Constantinos Venetsanopoulos
Install the following synnefo components:
861 bc055d09 Constantinos Venetsanopoulos
862 bc055d09 Constantinos Venetsanopoulos
Nodes of type :ref:`APISERVER <APISERVER_NODE>`
863 bc055d09 Constantinos Venetsanopoulos
    Components
864 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-common <snf-common>`,
865 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-webproject <snf-webproject>`,
866 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-cyclades-app <snf-cyclades-app>`
867 bc055d09 Constantinos Venetsanopoulos
Nodes of type :ref:`GANETI-MASTER <GANETI_MASTER>` and :ref:`GANETI-NODE <GANETI_NODE>`
868 bc055d09 Constantinos Venetsanopoulos
    Components
869 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-common <snf-common>`,
870 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-cyclades-gtools <snf-cyclades-gtools>`
871 bc055d09 Constantinos Venetsanopoulos
Nodes of type :ref:`LOGIC <LOGIC_NODE>`
872 bc055d09 Constantinos Venetsanopoulos
    Components
873 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-common <snf-common>`,
874 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-webproject <snf-webproject>`,
875 bc055d09 Constantinos Venetsanopoulos
    :ref:`snf-cyclades-app <snf-cyclades-app>`.
876 bc055d09 Constantinos Venetsanopoulos
877 a96ec00f Constantinos Venetsanopoulos
878 a96ec00f Constantinos Venetsanopoulos
Configuration of Cyclades (and Plankton)
879 a96ec00f Constantinos Venetsanopoulos
========================================
880 5b6feb88 Vangelis Koukis
881 bc055d09 Constantinos Venetsanopoulos
This section targets the configuration of the prerequisites for cyclades,
882 bc055d09 Constantinos Venetsanopoulos
and the configuration of the associated synnefo software components.
883 bc055d09 Constantinos Venetsanopoulos
884 bc055d09 Constantinos Venetsanopoulos
synnefo components
885 bc055d09 Constantinos Venetsanopoulos
------------------
886 bc055d09 Constantinos Venetsanopoulos
887 bc055d09 Constantinos Venetsanopoulos
cyclades uses :ref:`snf-common <snf-common>` for settings.
888 bc055d09 Constantinos Venetsanopoulos
Please refer to the configuration sections of
889 bc055d09 Constantinos Venetsanopoulos
:ref:`snf-webproject <snf-webproject>`,
890 bc055d09 Constantinos Venetsanopoulos
:ref:`snf-cyclades-app <snf-cyclades-app>`,
891 bc055d09 Constantinos Venetsanopoulos
:ref:`snf-cyclades-gtools <snf-cyclades-gtools>` for more
892 bc055d09 Constantinos Venetsanopoulos
information on their configuration.
893 bc055d09 Constantinos Venetsanopoulos
894 bc055d09 Constantinos Venetsanopoulos
Ganeti
895 bc055d09 Constantinos Venetsanopoulos
~~~~~~
896 bc055d09 Constantinos Venetsanopoulos
897 bc055d09 Constantinos Venetsanopoulos
Set ``GANETI_NODES``, ``GANETI_MASTER_IP``, ``GANETI_CLUSTER_INFO`` based on
898 bc055d09 Constantinos Venetsanopoulos
your :ref:`Ganeti installation <cyclades-install-ganeti>` and change the
899 bc055d09 Constantinos Venetsanopoulos
`BACKEND_PREFIX_ID`` setting, using an custom ``PREFIX_ID``.
900 bc055d09 Constantinos Venetsanopoulos
901 bc055d09 Constantinos Venetsanopoulos
Database
902 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~
903 bc055d09 Constantinos Venetsanopoulos
904 bc055d09 Constantinos Venetsanopoulos
Once all components are installed and configured,
905 bc055d09 Constantinos Venetsanopoulos
initialize the Django DB:
906 bc055d09 Constantinos Venetsanopoulos
907 bc055d09 Constantinos Venetsanopoulos
.. code-block:: console
908 bc055d09 Constantinos Venetsanopoulos
909 bc055d09 Constantinos Venetsanopoulos
   $ snf-manage syncdb
910 bc055d09 Constantinos Venetsanopoulos
   $ snf-manage migrate
911 bc055d09 Constantinos Venetsanopoulos
912 bc055d09 Constantinos Venetsanopoulos
and load fixtures ``{users, flavors, images}``,
913 bc055d09 Constantinos Venetsanopoulos
which make the API usable by end users by defining a sample set of users,
914 bc055d09 Constantinos Venetsanopoulos
hardware configurations (flavors) and OS images:
915 bc055d09 Constantinos Venetsanopoulos
916 bc055d09 Constantinos Venetsanopoulos
.. code-block:: console
917 bc055d09 Constantinos Venetsanopoulos
918 bc055d09 Constantinos Venetsanopoulos
   $ snf-manage loaddata /path/to/users.json
919 bc055d09 Constantinos Venetsanopoulos
   $ snf-manage loaddata flavors
920 bc055d09 Constantinos Venetsanopoulos
   $ snf-manage loaddata images
921 bc055d09 Constantinos Venetsanopoulos
922 bc055d09 Constantinos Venetsanopoulos
.. warning::
923 bc055d09 Constantinos Venetsanopoulos
    Be sure to load a custom users.json and select a unique token
924 bc055d09 Constantinos Venetsanopoulos
    for each of the initial and any other users defined in this file.
925 bc055d09 Constantinos Venetsanopoulos
    **DO NOT LEAVE THE SAMPLE AUTHENTICATION TOKENS** enabled in deployed
926 bc055d09 Constantinos Venetsanopoulos
    configurations.
927 bc055d09 Constantinos Venetsanopoulos
928 bc055d09 Constantinos Venetsanopoulos
sample users.json file:
929 bc055d09 Constantinos Venetsanopoulos
930 bc055d09 Constantinos Venetsanopoulos
.. literalinclude:: ../../synnefo/db/fixtures/users.json
931 bc055d09 Constantinos Venetsanopoulos
932 bc055d09 Constantinos Venetsanopoulos
`download <../_static/users.json>`_
933 bc055d09 Constantinos Venetsanopoulos
934 bc055d09 Constantinos Venetsanopoulos
RabbitMQ
935 bc055d09 Constantinos Venetsanopoulos
~~~~~~~~
936 bc055d09 Constantinos Venetsanopoulos
937 bc055d09 Constantinos Venetsanopoulos
Change ``RABBIT_*`` settings to match your :ref:`RabbitMQ setup
938 bc055d09 Constantinos Venetsanopoulos
<cyclades-install-rabbitmq>`.
939 bc055d09 Constantinos Venetsanopoulos
940 bc055d09 Constantinos Venetsanopoulos
.. include:: ../../Changelog
941 bc055d09 Constantinos Venetsanopoulos
942 5b6feb88 Vangelis Koukis
943 a96ec00f Constantinos Venetsanopoulos
Testing of Cyclades (and Plankton)
944 a96ec00f Constantinos Venetsanopoulos
==================================
945 5b6feb88 Vangelis Koukis
946 5b6feb88 Vangelis Koukis
947 a96ec00f Constantinos Venetsanopoulos
General Testing
948 a96ec00f Constantinos Venetsanopoulos
===============
949 5b6feb88 Vangelis Koukis
950 5b6feb88 Vangelis Koukis
951 a96ec00f Constantinos Venetsanopoulos
Notes
952 a96ec00f Constantinos Venetsanopoulos
=====