doc/book/admin/migration.rst
author Denis Laxalde <denis.laxalde@logilab.fr>
Thu, 21 Mar 2019 14:33:54 +0100
changeset 12530 9d88e1177c35
parent 10491 c67bcee93248
permissions -rw-r--r--
Remove Twisted web server Twisted web server is not used anymore and has been superseded by pyramid many years ago. Furthermore, our usage is not compatible with Python 3. So we drop the "etwist" sub-package. As a consequence, "all-in-one" configuration type gets dropped as it was Twisted-specific. We resurrect it in cubicweb/pyramid/config.py by only keeping options used by the "pyramid". Similarly, we introduce a AllInOneCreateHandler in cubicweb/pyramid/pyramidctl.py that is basically the one that lived in cubicweb/etwist/twctl.py and is used to create the "all-in-one" instance. Added a TODO here about "pyramid.ini" that could be generated at the end of bootstrap() method. In cubicweb/devtools/httptest.py, CubicWebServerTC is now equivalent to CubicWebWsgiTC and the latter is dropped.
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