Setup PostgreSQL RDS Backend with Mirth

(i) Create RDS public instance Postgresql database in Amazon AWS:

 

  1. Navigate to Services -> RDS.
  2. Select on the Databases menu on the left side.

  3. Select on the create database button on the right side of the above screen.
  4. Click on standard create  radio button on the next screen

  5. Determine the engine you would like to select for the RDS DB backend
  6. I have opted for the postgresql in my case. You can select any DB of your preference.

  7. Go with the latest version of postgresql 12.3-R1 in my case. You can choose any latest version of postgresql.
  8. Based on the use case choose anything of your option. In the initial development phase we can use the below free tier template.
  9. Provide the DB instance name of your choice and provide the username you wish. The default username will be postgres
  10. Setup the password. As mentioned in the portal, it needs  to be strong and minimum 8 characters long.
  11. For the free tier selection the db storage will be only db.t2.micro
  12. Provide the storage with these information
  13. Select on Additional connectivity configuration

    14. Do not change the port number of the RDS. Let it remain the same.
    15. In the additional configuration tab provide the initial database name as “mirthdb”.
    16. Scroll to the bottom of the page and click on create database.

(ii) PgAdmin Setting for RDS:

  1. Using RDS we cannot see the tables in the AWS console. We need an external DB client to visualise the tables in the RDS. For postgresql we need  to install the pgAdmin tool to connect and visualise the RDS DB.
  2. To Install pgAdmin use this link for step by step installation 
  3. Install the pgAdmin in your local system and then connect it with the RDS server.
  4. Connectionstring for the pgAdmin will look as below
  5. Right click on the servers of the pgAdmin and click on create server. Put the hostname, username and password for the DB
  6. Roles and service can be left empty. We don’t need to fill Role and Service boxes.

(iii) Connecting RDS with Mirth:

  1. Go to the mirth installed directory in the ubuntu/amazon AMI linux box.
  2. Go inside the conf folder of the mirth installed directory and we need to open mith.properties file.
  3. Do the command “sudo vim mirth.properties” to open the properties file in the vim editor.
  4. Make changes that are highlighted in the above with the respective database connection strings.
  5. Restart mirth by going into the Mirth installed directory. Cd /opt/mirthconnect/
  6. Sudo ./mcservice restart

Leave a Comment