doc/book/admin/migration.rst
author Denis Laxalde <denis.laxalde@logilab.fr>
Tue, 22 Dec 2015 09:23:00 +0100
changeset 11144 fd8bf29ed00e
parent 10491 c67bcee93248
permissions -rw-r--r--
[tox] Generate test environments for Python 2.7 and 3.4 Test commands for each environment are written down explicitly since I could not find a way to extract the "package" name (e.g. "hooks") from the environment name (e.g. "py34-hooks"). For Python 3.4 interpreter, only environments (subpackages) that do not depend on cubes for their tests are listed since those test dependency cubes are not yet installable with Python 3.x. etwist is also not included since the Python 3 port is not complete at the moment. From local testing, py34 tests pass for the following subpackages: - dataimport - entities - ext - hooks - wsgi
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