Please refer to Install Bahmni on CentOS if you wish to install Bahmni. This document is for advanced installation scenarios when you wish you use a custom database, custom configuration, passive server setup, etc. The Install Bahmni on CentOS documents the "simple" install procedure. You are recommended to follow that if you are new to Bahmni. |
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 Release repo has been migrated out of Bintray. For installations, you will need to do the following for versions 0.92 or earlier
|
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 System Requirements for additional details. For other purposes, for instance to evaluate and install Bahmni on Windows or Ubuntu, one can install the Bahmni Virtual Box.
For Bahmni version 0.91 or earlier, we recommend CentOS6.9 64 bit.
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-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 |
If you get command not found error when trying to run the bahmni installer, have a look at the first comment on for a solution. You may need to redo the installation. |
This step is optional. If not specified, default configuration with sample demo data is installed if there is no existing database with name 'openmrs'. |
Example: If implementation_name is 'jss', then app config will be picked up from the /etc/bahmni-installer/deployment-artifacts/jss_config folder
For base and minimal configuration, one can choose to use https://github.com/Bahmni/minimal-config |
Please refer to this List Of Configurable Installation Variables, for the installation variables that can be overriden.
It is strongly recommended to change default user passwords for better security of your Bahmni server. |
# 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/ |
This step is optional. If not specified, default configuration for installing all components on « /etc/bahmni-installer/local -> /opt/bahmni-installer/bahmni-playbooks/local » will be used. |
Please enter IP addresses only in the inventory file. Domain names are not supported yet and are known to cause issues. |
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.
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.
If you are setting up inventory file - /etc/bahmni-installer/<inventory_file_name>, any command of bahmni command line utility that needs to be executed should provide '-i <inventory_file_name>' as option to use that inventory file. If it is not specified, it will use /etc/bahmni-installer/local inventory file.
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. |
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 |
To use "bahmni install", you need to set the <inventory_file_name> to BAHMNI_INVENTORY environment variable. If there is no custom inventory file to be used, assign local to BAHMNI_INVENTORY. Sample way to set the inventory_file_name is,
|
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 |
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
We got few reports that in few CentOS installations RPM signature check was set to mandatory and installation of Bahmni RPMs was failing. If you get any error regarding "package is not signed" please refer to this post https://talk.openmrs.org/t/package-bahmni-certs-1-0-36-noarch-rpm-is-not-signed for fixing it. |
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:
You may use this option to install Bahmni via the "bahmni" command onto remote servers. This is rare. Most administrators will install the bahmni command on the same machine that will act as bahmni server. But, you may still choose to install some sub-components, on a different machine using this option. |
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).
The ssh user should have sudoer permissions.
Ensure the inventory does not use localhost/127.0.0.1. The exact public IP address should be specified. This is because one host has to talk to the other host with multi machine setup. For example, the app server should communicate with the db server. 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.
To update only specific components of Bahmni, the following command can be used:
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:
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 |
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
In case you want to setup secondary passive servers (backup servers), then read this documentation. |
Tag passive host with 'passive=yes'
Note: 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. |
Example:
[bahmni-emr] 192.168.33.10 192.168.33.11 passive=yes [bahmni-reports] 192.168.33.10 192.168.33.11 passive=yes |
bahmni -i <inventory_file_name> install |
In case you want to setup a backup database as a replica server, so that any data / modification on main DB server, and also replicated to this backup DB server, then please read this section. |
When DCM4CHEE passive app server and slave DB server are same, postgres replication 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.
Add slave host ip to [*-slave] group in the inventory file.
Example:
[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 |
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:
bahmni -i <inventory_file_name> setup-mysql-replication |
To setup postgres replication, following command needs to be executed:
bahmni -i <inventory_file_name> setup-postgres-replication |
bahmni -i <inventory_file_name> install |
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 |
To setup nagios, add the nagios server host in inventory file like below:
[nagios-server] 192.168.33.10 |
Now add below email configuration in the "setup.yml" on path /etc/bahmni-installer/setup.yml
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 |
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.
In setup.yml, set openerp_url variable to a https url having a proper unique subdomain for OpenERP.
(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.
There are couple of issues:
We can use openerp_url configuration during installation to resolve these problems. You can setup it as for example, http://10.0.0.101:8069. |
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:
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:
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 |