BBahmni 한국어 매뉴얼검색
한국어 번역 완료
한국어English

Install Bahmni on CentOS (Advanced Installation Options)

Introduction

To install Bahmni, you require to now install the "bahmni" command line tool, which provides various options for installing / configuring Bahmni. This command line tool uses Ansible under-the-hoods to setup a Bahmni server on a local machine, or across multiple machines. This page documents the various options available to you – from choosing your own implementation config, to setup of passive secondary servers, to choosing specific databases, etc.

Bahmni Advanced Installation

Step 1: Setup fresh CentOS

For production purposes, of Bahmni version 0.92, CentOS 7.6 64bit is the recommended & tested platform for running the Bahmni server. Create a fresh CentOS V6.x box. Please refer for additional details. For other purposes, for instance to evaluate and install Bahmni on Windows or Ubuntu, one can install the .관련 문서: System RequirementsBahmni Virtual Box

For Bahmni version 0.91 or earlier, we recommend CentOS6.9 64 bit.

Step 2: Download and setup the bahmni installer

The bahmni-installer rpm will install a command line utility called 'bahmni'. Use the steps mentioned here to install the bahmni command line tool.

# Become root user
sudo su

# Please see prerequisites section in the release notes and install any dependencies
# Install the bahmni command
# yum install https://repo.mybahmni.org/releases/bahmni-installer-<major_verion>-<minor_version>.noarch.rpm
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.93-219.noarch.rpm #version 0.93.2
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.93-215.noarch.rpm #version 0.93.1
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.93-197.noarch.rpm #version 0.93
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.92-155.noarch.rpm #version 0.92 
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.91-89.noarch.rpm  #version 0.91
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.90-308.noarch.rpm  #version 0.90
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.89-193.noarch.rpm  #version 0.89
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.88-101.noarch.rpm  #version 0.88
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.87-81.noarch.rpm #version 0.87
yum install https://repo.mybahmni.org/releases/bahmni-installer-0.86-70.noarch.rpm  #version 0.86


# To know about the commands and options available as part of 'bahmni' command line utility
# the following command can be used after installing the bahmni-installer rpm:
bahmni --help

Step 3: Copy app config and base database dump

  • Copy OpenMRS mysql dump to&nbsp;/etc/bahmni-installer/deployment-artifacts. The dump file should be named "openmrs_backup.sql"For versions prior to 0.82, the file is actually the entire mysql databases dump and named as 'mysql_dump.sql'.
  • LAB (OpenELIS) - openelis_backup.sql
  • ERP (Odoo) for Bahmni 0.92 and above - odoo_backup.sql
  • ERP (OpenERP 7) for Bahmni v 0.91 or earlier&nbsp;- openerp_backup.sql.
  • For versions prior to 0.82, the file is the entire postgres databases dump and named 'pgsql_dump.sql'. NOTE: These steps are not needed if databases already exists.&nbsp;

Example: If implementation_name is 'jss', then app config will be picked up from the /etc/bahmni-installer/deployment-artifacts/jss_config folder

Step 4: Setup Installation variables

  • Please refer to this&nbsp;, for the&nbsp;installation variables that can be overriden.&nbsp;It is strongly recommended to change default user passwords for better security of your Bahmni server.관련 문서: List Of Configurable Installation Variables
  • Create an override file for the properties at /etc/bahmni-installer/setup.yml as detailed below
Sample setup.yml file
# To see the list of valid variables in Bahmni please refer to: 
# https://bahmni.atlassian.net/wiki/display/BAH/List+Of+Configurable+Installation+Variables

timezone: Asia/Kolkata
implementation_name: default
selinux_state: disabled

# specifying the postgres repo is only applicable for Bahmni 0.91 or earlier
postgres_repo_rpm_name: pgdg-centos92-9.2-7.noarch.rpm

# Specifying the RPM release repo, for Bahmni 0.92 or earlier
bahmni_repo_url: https://repo.mybahmni.org/releases/

Step 5: Setup deployment Configuration

The bahmni installer uses Ansible under-the-covers to perform installation. We need to provide an Inventory file to the installer to tell which all bahmni sub-systems need to be installed, and on which servers / IP should bahmni sub-components get installed. If you do not specify the inventory file, it defaults to a local setup with all the bahmni components (mrs, elis, erp, pacs) installed as part of setup. You can see the default local inventory file in /etc/bahmni-installer/local.관련 문서: &nbsp;Inventory file

You are free to create a new inventory file at /etc/bahmni-installer/<inventory_file_name>. If you create a new inventory file, then you will need to always use the "-i <filename>" option while invoking the bahmni command. Use the attached sample_inventory_file as reference. Or you can see one here on github.

To install only specific components, please add the host entry only in respective groups of the inventory file. For example, to install only bahmni-emr and bahmni-reports components, the host entry should be present only in the bahmni-emr and bahmni-reports group.

Step 6: Trigger Installation

To start the installation, execute the following command if custom inventory file is added:

# (from v0.89 onwards)
bahmni install 

# (from v0.83 onwards) 
bahmni -i <inventory_file_name> install

When there is no custom inventory file to be used, the following command can be used which will default to single machine local installation.

# (from v0.83 onwards)
bahmni -i local install 

# (for v0.82)
bahmni install

Step 7: Verify Installation

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

Access the OpenMRS app at https://<ip_address>/openmrs

Access Bahmni Lab (openelis) app at https://<ip_address>/openelis

Access Odoo/OpenERP app at https://<ip_address>:8069

Step 8: Starting and stopping of all services related to Bahmni

To start all the services related to Bahmni, one can use the following command.This command is available from 0.82 version of Bahmni.

bahmni -i <inventoryfile> start

To stop all the services related to Bahmni, use the following command. This command is available from 0.82 version of Bahmni.

bahmni -i <inventoryfile> stop

When there is no custom inventory file to be used, the following command can be used which will default to single machine local installation.

# (from v0.83 onwards)
bahmni -i local start/stop 

# (for v0.82)
bahmni start/stop

To check more about individual service statuses refer to the following documentaion:

Remote setup / Multi machine setup

  1. Ensure ssh access to remote server from the provisioning machine. That means ssh-ing into the machines at least once using the ansible_ssh_user specified in the inventory file to create known_hosts entry (since Ansible works out of ssh).
  2. The ssh user should have sudoer permissions.
  3. Ensure the inventory does not use localhost/127.0.0.1. The exact public IP address should be specified.&nbsp;This is because one host has to talk to the other host with multi machine setup.&nbsp;For example, the app server should communicate with the db server. &nbsp;When localhost is given, it will try to communicate with itself, rather than the other server.

An inventory file with remote setup should look something like this: https://github.com/Bahmni/bahmni-playbooks/blob/master/dev/dev

Then trigger the installation, using the "bahmni" command with -i option.

Install and update specific components

To update only specific components of Bahmni, the following command can be used:

Upgrade specific components
bahmni -i  <inventory_file_name> --only <components name seperated by comma>  install


#Examples:
bahmni -i local --only bahmni-lab,bahmni-reports install
bahmni -i local --only bahmni-reports install

Ideally, the above command should be used for patch release in which only specific component is changed and others are not. Please note that the version to which a specific component is to be upgraded should be compatible with other component versions.

To update all the components except specific components, the following command can be used:

Upgrade all component except specific one
bahmni -i <inventory_file_name> —skip <components name seperated by comma>  install


#Examples:
bahmni -i local --skip bahmni-lab,bahmni-reports install
bahmni -i local --skip bahmni-reports install

Migration from the older sh based installation to an RPM based installation

Certain manual steps have to be done if you are migrating from an old sh based installation to a rpm based installation.

The link to the documentation is available here:관련 문서: Migrating to bahmni-installer rpm based installation

Passive Server Setup

Step 1: Configuration

  1. &nbsp;Passive app servers can be setup by adding passive host IP to respective app-server groups in the inventory file. Passive host can be added to following app-server groups: &nbsp;bahmni-emr, bahmni-reports, bahmni-lab, bahmni-erp, pacs-integration.
  2. Tag passive host with 'passive=yes'&nbsp;Note:&nbsp; During failover, to make passive server as active, remove the active host from inventory and remove 'passive=yes' tag from the passive host and trigger installation as in step 2.&nbsp; &nbsp;Example:Inventory file with active/passive setup
    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

Step 2: Trigger Installation

bahmni -i <inventory_file_name> install

Database Replication Setup

Known Issues in Postgres replication

When DCM4CHEE passive app server and slave DB server are same, postgres replication would not work.

Inventory file with dcm4chee setup which would not work
[dcm4chee]
192.168.33.10
192.168.33.11 passive=yes
 
[dcm4chee-db-slave]
192.168.33.11

The workaround that is available is, before setting up postgres-replication, the passive server entry has to be removed in dcm4chee group and can be proceeded with postgres replication setup. Once the replication is setup, the passive server entry has to be added back in dcm4chee group.

Step 1: Configuration

  1. &nbsp;Add slave host ip to [*-slave] group in the inventory file.&nbsp; Example:Inventory file with master/slave setup
    Inventory file with master/slave setup
    [bahmni-emr-db]
    192.168.33.10
     
    [bahmni-emr-db-slave]
    192.168.33.11
     
    [bahmni-lab]
    192.168.33.10
     
    [bahmni-lab-db-slave]
    192.168.33.11
     
    [bahmni-erp-db]
    192.168.33.10
     
    [bahmni-erp-db-slave]
    192.168.33.11
    
    [bahmni-reports-db]
    192.168.33.10
     
    [bahmni-reports-db-slave]
    192.168.33.11

Step 2: Trigger Installation

To setup replication, separate command needs to be triggered for the mysql database and postgres database.

  • To setup mysql replication, following command needs to be executed: bash setup-mysql-replication ]]>&nbsp;
    bahmni -i <inventory_file_name> setup-mysql-replication
  • To setup postgres replication, following command needs to be executed: bash setup-postgres-replication]]>
    bahmni -i <inventory_file_name> setup-postgres-replication

Switch mysql and postgres slave to master

Step 1: Configuration

  1. &nbsp;Move slave host from [bahmni-emr-db-slave] group to &nbsp;[bahmni-emr-db] group&nbsp;in the inventory file. (mysql)
  2. &nbsp;Move slave host from [bahmni-lab-db-slave] group to&nbsp;&nbsp;[bahmni-lab-db] group, [bahmni-erp-db-slave] &nbsp;to [bahmni-erp-db] group, [pacs-integration-db-slave] to [pacs-integration-db] group in the inventory file. (postgres)

Step 2: Trigger Installation

bahmni -i <inventory_file_name> install

Update Implementation Configuration

To update just the implementation config without triggering the entire installation, replace the old <implementation_name>_config folder present in /etc/bahmni-installer/deployment-artifacts with new one and trigger update-config command like below:

bahmni -i <inventory_file_name> update-config

Setup Nagios

To setup nagios, add the nagios server host in inventory file like below:

Inventory file with nagios-server setup
[nagios-server]
192.168.33.10

Now add below email configuration in the "setup.yml" on path /etc/bahmni-installer/setup.yml

Setup.yml file with nagios-server setup
nagios_contact_email: Email id to which nagios should send notifications
ssmtp_auth_user: Email id from which nagios should send notifications
ssmtp_auth_pass: Password for email id from which nagios should send notifications (in cleartext)

Now, run the installer.

bahmni -i <inventory_file_name> install-nagios

Setup HTTPS for OpenERP

Bahmni bundles OpenERP with HTTP by default. It runs on 8069 port with plain HTTP. The Bahmni landing page will have url to access the OpenERP with this port.

To enable HTTPS:

We need subdomain for OpenERP to enable HTTPS and this is mandatory to do that. The openerp_url configuration is used for enabling HTTPS.

(Location of setup.yml is /etc/bahmni-installer)

This will be updated in the Bahmni landing page and rules will be updated in Apache so that it will redirect the requests to https.

Known issues in OpenERP setup

There are couple of issues:

  1. If the machine has multiple network interfaces (multiple IP address), there is a possibility that during installation it might pick up a wrong IP address to show on the Bahmni landing page.
  2. If you are installing OpenERP in a separate machine or multi machine setup in cloud, it is possible that the machine in which OpenERP is installed is not publicly accessible.

Setup SSL certificate for Bahmni using LetsEncrypt

LetsEncrypt is a free and automated Certificate Authority. You can read more about it here. Currently Bahmni supports DNS challenge based certificate generation. This eliminates the need of hosting the server on the Internet using a public IP address. Please note that, you still need an internet connection to run the process, except that there is no need to have a public IP address for your server.

Prerequisites:

  1. You must own a domain name.
  2. Active internet connection.

Installation:

The command must be run on the server which is present in the [bahmni-emr] group in inventory file. If you have passive machine setup, please run the command again in the passive machine.

bahmni -i <inventory_file_name> install-certs -e <email_address> -d <domain_name>

Example: bahmni -i inventory install-certs -e steve@jobs.com -d stevejobs.me

Things to note:

  1. This command will backup the current certificate and private key.
  2. This command needs manual interaction as DNS records have to be updated.
  3. The command will ask you to add TXT record for your domain in your DNS settings.
  4. You'll get a prompt like the below one. You have to manually update the given NAME and VALUE in your DNS settings. After you are done, press ENTER to continue. text and VALUE = as DNS TXT record. Wait for sometime to let the TXT records sync with other DNS servers. Press ENTER after you are done]]>
Add NAME = <acme_challege_key> and VALUE = <random_generated_value> as DNS TXT record. Wait for sometime to let the TXT records sync with other DNS servers. Press ENTER after you are done

하위 문서

원문 정보

Bahmni Wiki · CC BY-SA 4.0

원문 보기 ↗