Giter Site home page Giter Site logo

iris-mirroring-samples's Introduction

IRIS Mirroring samples

In this repository we can find a sample to create mirroring fully scripted without manual intervention.

We use IRIS, ZPM Package manager and docker.

Prerequisites

Prepare your system

Get an IRIS License

If you don't have a valid Docker License for IRIS yet connect to Worldwide Respnse Center (WRC) with your credentials.
Click "Actions" --> "Online distribtion", then "Evaluations" button and select "Evaluation License", fill the form.
Copy the iris.key to this repository directory.

Create users and groups

This sample use a local directory as a volume to share database file IRIS.DAT between containers.
We need to set security settings to ./backup directory.
If irisowner, irisuser groups and users does not exists yet on your system, create them.

sudo useradd --uid 51773 --user-group irisowner
sudo useradd --uid 52773 --user-group irisuser
sudo groupmod --gid 51773 irisowner
sudo groupmod --gid 52773 irisuser
sudo chgrp irisowner ./backup

Login to Intersystems Containers Registry

Our docker-compose.yml uses references to containers.intersystems.com.
So you need to login to Intersystems Containers Registry to pull the used images.
If you don't remember your password for the docker login to ICR, open this page https://login.intersystems.com/login/SSO.UI.User.ApplicationTokens.cls and you can retrieve your docker token.

docker login -u="YourWRCLogin" -p="YourPassWord" containers.intersystems.com

Generate certificates

# sudo is needed due chown, chgrp, chmod ...
sudo ./gen-certificates.sh

Generated certficates will be in ./certificates directory for IRIS instances.

Certficates files overview :

File Container Description
./certificates/CA_Server.cer webgateway,master,backup,report Authority server certificate
./certificates/master_server.cer master Certificate for IRIS master instance (used for mirror and wegateway communication encryption)
./certificates/master_server.key master Related private key
./certificates/backup_server.cer backup Certificate for IRIS backup instance (used for mirror and wegateway communication encryption)
./certificates/backup_server.key backup Related private key
./certificates/report_server.cer report Certificate for IRIS report instance (used for mirror and wegateway communication encryption)
./certificates/report_server.key report Related private key

Build and run containers

docker-compose build --no-cache
docker-compose up

Wait each instance has the good mirror status. It takes a while... You should see theses messages in docker logs :

mirror-demo-master | 01/09/22-11:02:08:227 (684) 1 [Utility.Event] Becoming primary mirror server
...
mirror-demo-backup | 01/09/22-11:03:06:398 (801) 0 [Utility.Event] Found MASTER as primary, becoming backup
...
mirror-demo-report | 01/09/22-11:03:10:745 (736) 0 [Generic.Event] MirrorClient: Connected to primary: MASTER (ver 4)

Test

See the mirror monitor (management portal, this is the default user and password.) : http://localhost:81/csp/sys/op/%25CSP.UI.Portal.Mirror.Monitor.zen
Mirror-Monitor

See the mirror settings : http://localhost:81/csp/sys/mgr/%25CSP.UI.Portal.Mirror.EditFailover.zen?$NAMESPACE=%25SYS

Mirror-Configuration

We can test by simply set a global starting by demo.

Open a terminal session on primary server :

docker exec -it mirror-demo-master irissession iris
s ^demo.test = $zdt($h,3,1)

Check if the data is available on backup node :

docker exec -it mirror-demo-backup irissession iris
W ^demo.test

Check if the data is available on report node :

docker exec -it mirror-demo-report irissession iris
W ^demo.test

Access to portals

Master : http://localhost:81/csp/sys/utilhome.csp
Failover backup member : http://localhost:82/csp/sys/utilhome.csp
Read-Write report async member : http://localhost:83/csp/sys/utilhome.csp

iris-mirroring-samples's People

Contributors

lscalese avatar

Watchers

 avatar  avatar

iris-mirroring-samples's Issues

AddVirtualAddress Failed - could not assign IP to interface, error: Need root privileges to run this script

A root privilege issue occurs with the IRIS image iris:2021.2.0.617.0 :

mirror-demo-master | 02/06/22-09:50:00:545 (749) 0 [Utility.Event] Manager initialized for DEMO
mirror-demo-master | 02/06/22-09:50:00:545 (749) 0 [Utility.Event] No other mirror members configured, becoming primary mirror server
mirror-demo-master | 02/06/22-09:50:03:018 (647) 0 [Database.MountedRW] Mounted database /usr/irissys/mgr/myappdata/ (SFN 5) read-write.
mirror-demo-master | 02/06/22-09:50:03:188 (749) 2 [Utility.Event] AddVirtualAddress failed, cannot become primary: AddVirtualAddress Failed - could not assign

A repository to reproduce the problem is available here and a WRC is open.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.