root / docs / scale / i-db.rst @ 301294a9
History | View | Annotate | Download (1.9 kB)
1 |
.. _i-db: |
---|---|
2 |
|
3 |
Synnefo |
4 |
------- |
5 |
|
6 |
:ref:`synnefo <i-synnefo>` || |
7 |
:ref:`ns <i-ns>` || |
8 |
:ref:`apt <i-apt>` || |
9 |
:ref:`mq <i-mq>` || |
10 |
db || |
11 |
:ref:`gunicorn <i-gunicorn>` || |
12 |
:ref:`apache <i-apache>` || |
13 |
:ref:`webproject <i-webproject>` || |
14 |
:ref:`astakos <i-astakos>` || |
15 |
:ref:`cms <i-cms>` || |
16 |
:ref:`pithos <i-pithos>` || |
17 |
:ref:`cyclades <i-cyclades>` || |
18 |
:ref:`kamaki <i-kamaki>` || |
19 |
:ref:`backends <i-backends>` |
20 |
|
21 |
Database Setup |
22 |
++++++++++++++ |
23 |
|
24 |
The following apply to ``db`` node. For the rest of the sections we will |
25 |
refer to its IP as ``db.example.com`` . |
26 |
|
27 |
First install progresql: |
28 |
|
29 |
.. code-block:: console |
30 |
|
31 |
# apt-get install postgresql |
32 |
|
33 |
We create a database called ``snf_apps``, that will host all django |
34 |
apps related tables. We also create the user ``synnefo`` and grant him all |
35 |
privileges on the database. We do this by running: |
36 |
|
37 |
.. code-block:: console |
38 |
|
39 |
# su - postgres |
40 |
postgres:~$ psql |
41 |
postgres=# CREATE DATABASE snf_apps WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0; |
42 |
postgres=# CREATE USER synnefo WITH PASSWORD 'example_passw0rd'; |
43 |
postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_apps TO synnefo; |
44 |
|
45 |
We also create the database ``snf_pithos`` needed by the pithos+ backend and |
46 |
grant the ``synnefo`` user all privileges on the database. |
47 |
|
48 |
.. code-block:: console |
49 |
|
50 |
postgres=# CREATE DATABASE snf_pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0; |
51 |
postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_pithos TO synnefo; |
52 |
|
53 |
Configure the database to listen to all network interfaces. You can do this by |
54 |
editting the file `/etc/postgresql/8.4/main/postgresql.conf` with: |
55 |
|
56 |
| ``listen_addresses = '*'`` |
57 |
|
58 |
Furthermore, edit `/etc/postgresql/8.4/main/pg_hba.conf` to allow the nodes |
59 |
to connect to the database. Add the following line: |
60 |
|
61 |
| ``host all all 4.3.2.0/24 md5`` |
62 |
|
63 |
.. code-block:: console |
64 |
|
65 |
# /etc/init.d/postgresql restart |
66 |
|
67 |
|
68 |
Test your Setup: |
69 |
++++++++++++++++ |