doc/book/admin/migration.rst
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 06 Jun 2016 21:17:33 +0200
changeset 11347 b4dcfd734686
parent 10491 c67bcee93248
permissions -rw-r--r--
[server] some pep8 in rql2sql
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     1
.. -*- coding: utf-8 -*-
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     2
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     3
Migrating cubicweb instances - benefits from a distributed architecture
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     4
=======================================================================
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     5
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     6
Migrate apache & cubicweb
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     7
-------------------------
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     8
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
     9
**Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime.
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    10
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    11
**Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host.
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    12
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    13
**Steps** :
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    14
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    15
1. *on new machine* : install your environment (*pseudocode*) ::
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    16
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    17
     apt-get install cubicweb cubicweb-applications apache2
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    18
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    19
2. *on old machine* : copy your cubicweb and apache configuration to the new machine ::
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    20
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    21
    scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    22
    scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    23
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    24
3. *on new machine* : start your instances ::
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    25
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    26
     cubicweb start
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    27
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    28
4. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file.
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    29
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    30
5. change dns entry from your oldmachine to newmachine
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    31
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    32
6. shutdown your *old machine* (if it doesn't host other services or your database)
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    33
10235
684215aca046 Remove remote repository-access-through-pyro support
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents: 5371
diff changeset
    34
7. That's it.
5371
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    35
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    36
**Possible enhancements** : use right from the start a pound server behind your apache, that way you can add backends and smoothily migrate by shuting down backends that pound will take into account.
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    37
6d25b84ffd50 le patch some_admin_doc_for_migration a été importé
Arthur Lutz <arthur.lutz@logilab.fr>
parents:
diff changeset
    38