Installing Bahmni on CentOS - endTB specific

 

Steps

Step 1: Setup fresh CentOS v6.x 

For Production purposes, CentOS 6.x 64bit is the recommended & tested platform for running Bahmni server. Create a fresh CentOS V6.x box. Please refer System Requirements for additional details.

For other purposes, an alternative can be a CentOS VM setup using vagrant. Attaching the sample Vagrantfile that can be used to setup a fresh VM from the base CentOS box published here.

Step 2 :  Download and setup the bahmni installer

sudo su
yum install https://bahmni-repo.twhosted.com/rpm/bahmni/bahmni-installer-<major_verion>-<minor_version>.noarch.rpm
eg. yum install https://bahmni-repo.twhosted.com/rpm/bahmni/bahmni-installer-0.80-201.noarch.rpm

Step 3 :  Copy app config and base database dump

** This step is optional. If not specified, default configuration with sample demo data is installed.

copy mysql dump to /etc/bahmni-installer/deployment-artifacts. The dump file should be named 'mysql_dump.sql'.

copy app config folder to /etc/bahmni-installer/deployment-artifacts. The folder name should match <implementation_name>_config

Step 4 :  Setup deployment Configuration

  1. Setup Ansible Inventory file. If you do not specify the inventory file, it defaults to local setup with all the bahmni components (mrs, elis, erp, pacs)  installed as part of setup. 
    Any custom changes to inventory file can be made by creating new inventory file at /etc/bahmni-installer/<inventory_file_name>. Use the below provided sample inventory file as reference. 

    1. Local setup  
      To install only specific components, please add the host entry only in respective groups. 
      For example, to install only bahmni-emr and bahmni-reports components, host entry should be present only in bahmni-emr  and bahmni-reports group i.e. inventory file should be like below:

      local setup inventory file
      localhost ansible_connection=local
      
      [bahmni-emr-db-slave]
      
      [bahmni-emr-db]
      localhost
      
      [bahmni-emr]
      localhost
      
      [bahmni-erp-db]
      
      [bahmni-erp-db-slave]
      
      [bahmni-erp]
      
      [bahmni-lab-db]
      
      [bahmni-lab-db-slave]
      
      [bahmni-lab]
      
      [bahmni-reports]
      localhost
      
      [bahmni-pacs]
      
      [dcm4chee]
      
      [bahmni-event-log-service]
      
      [local:children]
      bahmni-emr
      bahmni-emr-db
      bahmni-emr-db-slave
      bahmni-lab
      bahmni-lab-db
      bahmni-lab-db-slave
      bahmni-erp
      bahmni-erp-db
      bahmni-erp-db-slave
      bahmni-reports
      bahmni-pacs
      dcm4chee
      bahmni-event-log-service
    2. Remote setup
      1. Ensure ssh access to remote server from the provisioning machine i.e. we should have ssh'ed into the machines atleast once using the ansible_ssh_user specified in inventory file to create known_hosts entry (since ansible works out of ssh).
      2. Ensure the inventory does not use localhost/127.0.0.1. The exact IP address should be specified.

      An inventory file with remote setup should look something like this

      192.168.33.10 ansible_ssh_user=vagrant ansible_ssh_pass=vagrant
      192.168.33.11 ansible_ssh_user=vagrant ansible_ssh_pass=vagrant
      
      [bahmni-emr]
      192.168.33.10
      192.168.33.11 passive=yes
      
      [bahmni-emr-db]
      192.168.33.10
      
      [bahmni-emr-db-slave]
      192.168.33.11
      [bahmni-erp]
      [bahmni-erp-db]
      [bahmni-erp-db-slave]
      [bahmni-lab]
      [bahmni-lab-db]
      [bahmni-lab-db-slave]
      [bahmni-reports]
      192.168.33.10
      192.168.33.11 passive=yes
      [pacs-integration]
      [pacs-integration-db]
      [pacs-integration-db-slave]
      [dcm4chee]
      [bahmni-event-log-service]
      [dev:children]
      bahmni-emr
      bahmni-emr-db
      bahmni-emr-db-slave
      bahmni-lab
      bahmni-lab-db
      bahmni-lab-db-slave
      bahmni-erp
      bahmni-erp-db
      bahmni-erp-db-slave
      bahmni-reports
      pacs-integration
      pacs-integration-db
      pacs-integration-db-slave
      dcm4chee
      bahmni-event-log-service

       

  2. Verify the default configuration properties  in /opt/bahmni-installer/bahmni-playbooks/group_vars/local
    1. create override file for the properties if required at /etc/bahmni-installer/setup.yml if required.
    2. 'implementation_name' should be specified in setup.yml if the app config is provided as described in Step 3.
    sample setup.yml
    implementation_name: endtb

Step 5 :  Trigger Installation

There is a command line tool that installs all the packages mentioned in the inventory file and starts respective services. 

bahmni install <inventory_file>

By default, this picks up the local inventory file. 

Step 6 :  Verify Installation

Access the emr app at  https://<ip_address>/home

 Vagrant file

Setup fail over box

Step 1: Configuration

    1. Add passive host to [bahmni-emr] and [bahmni-reports] group in the inventory file

    2. Tag passive host with 'passive=yes' 

     Example:

Inventory file with active/passive setup
[bahmni-emr]
192.168.33.10
192.168.33.11 passive=yes
 
[bahmni-reports]
192.168.33.10
192.168.33.11 passive=yes

Note: To switch passive to active, switch the tag and run step 2

 

Step 2: Trigger Installation

bahmni install <inventory_file_name>

Setup Replication

Step 1: Configuration

    1. Add slave host to [bahmni-emr-db-slave] group in the inventory file. To setup replication separate command needs to be triggered for the respective mysql database or postgres database.

     Example:

Inventory file with active/passive setup
[bahmni-emr-db]
192.168.33.10
 
[bahmni-emr-db-slave]
192.168.33.11

Step 2: Trigger Installation

bahmni setup-mysql-replication <inventory_file_name>
OR
bahmni setup-postgres-replication <inventory_file_name>

Switch slave to master

Step 1: Configuration

    1. Move slave host from [bahmni-emr-db-slave] group to  [bahmni-emr-db] group in the inventory file

Step 2: Trigger Installation

bahmni setup-replication <inventory_file_name>
bahmni install <inventory_file_name>


Update Config File

Step 1: Configuration

    1. Update the inventory file (which is present in /etc/bahmni-installer) and trigger update-config

Step 2: Trigger update-config

bahmni update-config <inventory_file_name>

The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)