Skip to content

Manage integrator service

Vivek Singh edited this page Dec 4, 2023 · 8 revisions

Start, stop service

systemctl [start/stop/restart] abi.service

Check errors in bugsnag

  • Login to https://app.bugsnag.com
  • Emails will also be sent to the email registered in above account

Check logs

  • Directory: /var/log/abi

Configuration of the background service

  • Check /root/source/abi-host/start-ab-integrator.sh
  • It contains schedule, server configuration, the tasks that are being run
  • New configurations since first release. It can be added to start-ab-integrator.sh for changing the value -- APP_HTTPCLIENT_TIMEOUT (numeric)

Integration tasks

  • AvniSubject for saving Avni subjects into Bahmni
  • AvniEnrolment for saving enrolments created in Avni into Bahmni
  • AvniProgramEncounter for saving program encounters created in Avni into Bahmni
  • AvniErrorRecords for processing any records which was in error earlier when saving Avni* tasks
  • BahmniErrorRecords for processing any records which was in error earlier when saving Bahmni* tasks
  • BahmniVisitDateFix for fixing visits and encounter dates in Bahmni. This is run everytime after the above finishes. The date fixing is required because OpenMRS doesn't allow creation of visits and encounters in the past.

Database

  • Under PostgreSQL find the database name bahmni_avni. It has user/role of bahmni_avni_admin.
  • Go to abi-host folder. Run make backup which would create a database backup file backup/backup.sql. Ensure that the size of file right, and the file is created (datetime) just now. You can use ls -l command to check this.

Finding sync status information

  • There are two tables which contain the sync status - avni_entity_status and bahmni_entity_status. The sync status is maintained for each entity type. The column read_upto provides the information about which id value the sync has run so far. When the sync scheduled job is active and is running the task this number will increase almost every second, provided there are more entities remaining to be processed.

Take complete backup of the service

  1. Check the database section above for taking db backup of the integration service.
  2. After complete 1, take a copy of complete abi-host folder.
  3. Take a copy of ashwini folder which is the peer folder of abi-host.
  4. Take a copy of jdk folder /usr/java/jdk-15.0.2+7

Restore backup on a new machine

  1. Make /root/source folder
  2. Restore two folders (ashwini, abi-host) in /root/source
  3. Restore jdk-15.0.2+7 folder in /usr/java/jdk-15.0.2+7
  4. Restore database backup by running make restore-backup from abi-host folder
  5. Run sh scripts/setup-as-restored-service.sh to create the service