equal
deleted
inserted
replaced
1 .. -*- coding: utf-8 -*- |
|
2 |
|
3 Migrating cubicweb instances - benefits from a distributed architecture |
|
4 ======================================================================= |
|
5 |
|
6 Migrate apache & cubicweb |
|
7 ------------------------- |
|
8 |
|
9 **Aim** : do the migration for N cubicweb instances hosted on a server to another with no downtime. |
|
10 |
|
11 **Prerequisites** : have an explicit definition of the database host (not default or localhost). In our case, the database is hosted on another host. |
|
12 |
|
13 **Steps** : |
|
14 |
|
15 1. *on new machine* : install your environment (*pseudocode*) :: |
|
16 |
|
17 apt-get install cubicweb cubicweb-applications apache2 |
|
18 |
|
19 2. *on old machine* : copy your cubicweb and apache configuration to the new machine :: |
|
20 |
|
21 scp /etc/cubicweb.d/ newmachine:/etc/cubicweb.d/ |
|
22 scp /etc/apache2/sites-available/ newmachine:/etc/apache2/sites-available/ |
|
23 |
|
24 3. *on new machine* : start your instances :: |
|
25 |
|
26 cubicweb start |
|
27 |
|
28 4. *on new machine* : enable sites and modules for apache and start it, test it using by modifying your /etc/host file. |
|
29 |
|
30 5. change dns entry from your oldmachine to newmachine |
|
31 |
|
32 6. shutdown your *old machine* (if it doesn't host other services or your database) |
|
33 |
|
34 7. That's it. |
|
35 |
|
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. |
|
37 |
|
38 |
|