Differences between revisions 4 and 5
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
The internal and external systems can be in the same computer on a development system. In that case the secondary system's '''app''', '''lib''' and '''cfg/.../site''' directories can be linked to the primary system's directories. The internal and external systems can be in the same computer on a development system.
Line 15: Line 15:
Create the '''instance''' settings for the two systems first, e.g. '''centos1.tibi1959.hu-dev1''' and '''centos1.tibi1959.hu-dev2'''. == Instance Setting of the Systems

Create the '''instance''' settings for the two systems first, e.g. '''centos1.tibi1959.hu-dev1''' and '''centos1.tibi1959.hu-dev2'''. See this instance settings in CVS branch V11_4_PROD-BRANCH.

The new settings for the internal system ('''centos1.tibi1959.hu-dev1'''):
 {{{
11a12,13
> $_CFG['SubSiteId'] = 1;
>
17a20
> include_once $_CFG['BaseDir']."/cfg/$_SITE/site/config/SubSiteSettings".$_CFG['SubSiteId'].".php";
20a24,30
> // -- Database mirroring
>
> $_CFG['Feature']['DbMirroring'] = true;
> $_CFG['EventDaemon']['EnableMap'][EventTypeRef_MirrorIn] = 1;
> $_CFG['EventDaemon']['EnableMap'][EventTypeRef_MirrorOut] = 1;
> $_CFG['SubSiteSettings']['RemoteBaseURL'] = 'http://localhost/dev/linthal114dev2/';
>
36c46
< $_CFG['HeaderTitle2'] = 'PSW Limmern Development System (dev), ' . $_CFG['CodeVersion'];
---
> $_CFG['HeaderTitle2'] = 'PSW Limmern Development System (dev1 - internal), ' . $_CFG['CodeVersion'];
}}}

The new settings for the shared system ('''centos1.tibi1959.hu-dev1'''):
 {{{
11a12,13
> $_CFG['SubSiteId'] = 2;
>
17a20
> include_once $_CFG['BaseDir']."/cfg/$_SITE/site/config/SubSiteSettings".$_CFG['SubSiteId'].".php";
20a24,27
> // -- Database mirroring
>
> $_CFG[ 'Feature' ][ 'DbMirroring' ] = true;
>
36c43
< $_CFG['HeaderTitle2'] = 'PSW Limmern Development System (dev), ' . $_CFG['CodeVersion'];
---
> $_CFG['HeaderTitle2'] = 'PSW Limmern Development System (dev2 - shared), ' . $_CFG['CodeVersion'];
}}}
Line 22: Line 63:
cd linthal114dev1/app/etc cd linthal114dev/app/etc          # go to an 11.4 or 12.x system
Line 26: Line 67:
Assumed that the secondary system is on the same machine, use the option '''-l dev1''', which creates links for '''app''', '''lib''' and '''cfg/.../site''' directories to the primary system instead of checkout them, to allow that you will be not confused with the question:'what was changed where?'. Omit the option '''-l''' If you install the secondary system on a separate computer. Checkout the secondary system similarly:
Line 28: Line 70:
cd linthal114dev2/app/etc cd linthal114dev1app/etc          # go to an 11.4 or 12.x system
Line 30: Line 72:
}}}

Note, that it is recommended to use onw system, e.g. the primary as master. That means, that every files in app, lib and cfg/.../site are edited in the primary system and the changes are copied to the shared system, to avoid that we are getting confused what should be checked in CVS and where. There is a small shell script, which can make the copy with rsync very quickly:

 {{{
cd linthal114dev1app/etc
./mirrorFiles.sh linthal114dev2 linthal
Line 34: Line 83:
Create the versioning, mirroring schema and trigger files, by calling '''app/etc/genMeta.pl -b''', however until '''BUG-1794''' is not solved you MUST use the browser version (http://centos1.tibi1959.hu/dev/linthal114dev1/lib/meta/index.php - Generate DB Business Object Classes) instead. Create the versioning, mirroring schema and trigger files, by calling '''app/etc/genMeta.pl -b'''.
Line 37: Line 86:
./genMeta.pl -b # use http://.../lib/meta/generator/index.php until BUG-1794 is not solved ./genMeta.pl -b
Line 45: Line 94:
./genMeta.pl -b # use http://.../lib/meta/generator/index.php until BUG-1794 is not solved ./genMeta.pl -b
Line 49: Line 98:

After these steps you will have two databases ('''linthal114dev1stg''', '''linthal114dev2stg''') as staging area with one table ('''MirrorRecords''').
Line 57: Line 108:
cd /var/www/html/dev/linthal114dev2/app/install
./setup.sh linthal centos1.tibi1959.hu-dev2 apache drawmgt
Line 58: Line 111:

== Setup Event Records ==

The the new event records ('''Resceduling Mirroring (in)''', '''Resceduling Mirroring (out)''') must be inserted manually into the database of the internal system:
 {{{
mysql -uroot -psqladmin linthal114dev1
mysql> insert into Events values( 3, 21, 0, 7, 3, 0, 2, 0, null, now(),now(),now(),now(), 60, 'Resceduling Mirroring (in)' );
mysql> insert into Events values( 4, 22, 0, 7, 3, 0, 2, 0, null, now(),now(),now(),now(), 60, 'Resceduling Mirroring (out)' );
}}}

== Start Event Dispatcher ==

The event dispatcher should be run every minutes from crontab or it can be started manually in test phase. All mirroring jobs will be done by the event dispatcher on the internal system. You can set the re-scheduling time smaller then 60sec, e.g. 5sec on the development system to allow to process records nearly immediately if you start the event dispatcher from the command line:

 {{{
cd linthal114dev1/app/etc
php app/event/lib/EventDispatcher.php
}}}

Setting Up a Dual DrawMGT System

Introduction

A dual DrawMGT system contains an internal (secure, primary) and and external (shared, secondary) systems. The systems are basically independent from each other, but synchronized.

Setting Up a Dual Development System

The internal and external systems can be in the same computer on a development system.

All of the examples below assumes that the primary and secondary instances are centos1.tibi1959.hu-dev1 and centos1.tibi1959.hu-dev2, and the primary and secondary main directories and databases are linthal114dev1 respectively linthal114dev2'.

== Instance Setting of the Systems

Create the instance settings for the two systems first, e.g. centos1.tibi1959.hu-dev1 and centos1.tibi1959.hu-dev2. See this instance settings in CVS branch V11_4_PROD-BRANCH.

The new settings for the internal system (centos1.tibi1959.hu-dev1):

  • 11a12,13
    >   $_CFG['SubSiteId']          = 1;
    > 
    17a20
    >   include_once $_CFG['BaseDir']."/cfg/$_SITE/site/config/SubSiteSettings".$_CFG['SubSiteId'].".php";
    20a24,30
    >   // -- Database mirroring
    > 
    >   $_CFG['Feature']['DbMirroring'] = true;
    >   $_CFG['EventDaemon']['EnableMap'][EventTypeRef_MirrorIn] = 1;
    >   $_CFG['EventDaemon']['EnableMap'][EventTypeRef_MirrorOut] = 1;
    >   $_CFG['SubSiteSettings']['RemoteBaseURL'] = 'http://localhost/dev/linthal114dev2/';
    > 
    36c46
    <   $_CFG['HeaderTitle2']       = 'PSW Limmern Development System (dev), ' . $_CFG['CodeVersion'];
    ---
    >   $_CFG['HeaderTitle2']       = 'PSW Limmern Development System (dev1 - internal), ' . $_CFG['CodeVersion'];

The new settings for the shared system (centos1.tibi1959.hu-dev1):

  • 11a12,13
    >   $_CFG['SubSiteId']          = 2;
    > 
    17a20
    >   include_once $_CFG['BaseDir']."/cfg/$_SITE/site/config/SubSiteSettings".$_CFG['SubSiteId'].".php";
    20a24,27
    >   // -- Database mirroring
    > 
    >   $_CFG[ 'Feature' ][ 'DbMirroring'  ] = true;
    > 
    36c43
    <   $_CFG['HeaderTitle2']       = 'PSW Limmern Development System (dev), ' . $_CFG['CodeVersion'];
    ---
    >   $_CFG['HeaderTitle2']       = 'PSW Limmern Development System (dev2 - shared), ' . $_CFG['CodeVersion'];

Checking Out The Development System

Checkout to primary system first as usual (assumed CVS user: ntibor, main development directory: /var/www/html/dev, apache user: apache, site: linthal, instance: centos1.tibi1959.hu-dev1):

  • cd linthal114dev/app/etc          # go to an 11.4 or 12.x system
    ./checkout.pl -v -r 114 -u tibor -d /var/www/html/dev -w apache linthal centos1.tibi1959.hu-dev1

Checkout the secondary system similarly:

  • cd linthal114dev1app/etc          # go to an 11.4 or 12.x system
    ./checkout.pl -v -l dev1 -r 114 -u tibor -d /var/www/html/dev -w apache linthal centos1.tibi1959.hu-dev2

Note, that it is recommended to use onw system, e.g. the primary as master. That means, that every files in app, lib and cfg/.../site are edited in the primary system and the changes are copied to the shared system, to avoid that we are getting confused what should be checked in CVS and where. There is a small shell script, which can make the copy with rsync very quickly:

  • cd linthal114dev1app/etc
    ./mirrorFiles.sh linthal114dev2 linthal

Migrating Database and Generate System Components

Create the versioning, mirroring schema and trigger files, by calling app/etc/genMeta.pl -b.

  • cd linthal114dev1/app/etc
    ./genMeta.pl -b
    ./loadSystem -v delta dev1
    ./genMeta.pl

The same for the secondary system:

  • cd linthal114dev2/app/etc
    ./genMeta.pl -b
    ./loadSystem -v delta dev1
    ./genMeta.pl

After these steps you will have two databases (linthal114dev1stg, linthal114dev2stg) as staging area with one table (MirrorRecords).

Setup Directories and Permissions

Run setup.sh for both systems as root as usual:

  • su
    cd /var/www/html/dev/linthal114dev1/app/install
    ./setup.sh linthal centos1.tibi1959.hu-dev1 apache drawmgt
    cd /var/www/html/dev/linthal114dev2/app/install
    ./setup.sh linthal centos1.tibi1959.hu-dev2 apache drawmgt

Setup Event Records

The the new event records (Resceduling Mirroring (in), Resceduling Mirroring (out)) must be inserted manually into the database of the internal system:

  • mysql -uroot -psqladmin linthal114dev1
    mysql> insert into Events values( 3, 21, 0, 7, 3, 0, 2, 0, null, now(),now(),now(),now(), 60, 'Resceduling Mirroring (in)' );
    mysql> insert into Events values( 4, 22, 0, 7, 3, 0, 2, 0, null, now(),now(),now(),now(), 60, 'Resceduling Mirroring (out)' );

Start Event Dispatcher

The event dispatcher should be run every minutes from crontab or it can be started manually in test phase. All mirroring jobs will be done by the event dispatcher on the internal system. You can set the re-scheduling time smaller then 60sec, e.g. 5sec on the development system to allow to process records nearly immediately if you start the event dispatcher from the command line:

  • cd linthal114dev1/app/etc
    php app/event/lib/EventDispatcher.php

SetupDualDrawMGTSystem (last edited 2011-05-10 11:44:30 by 195)

Copyright 2008-2014, SoftXS GmbH, Switzerland