Configure Insights with AWS RDS (Postgres)

RDS Postgres configuration

  • Log in to AWS Management Console and search with the keyword 'RDS'. You will be redirected to the RDS Home Page

  • Click on the Create Database and Select Postgres and required version

  • DB Instance Settings – select type and set username and password also specify Instance Size and Storage.

  • In Additional Configuration we can add initial database.

  • Click On Create Database you will see the resource creation progress.

  • It will take some time to provision the resources and return the Endpoint along with a few more details.

Refer: AWS RDS with Postgres Configuration

Connectivity

  • PgAdmin4 – RDS Postgres

    • On the Dashboard tab, choose Add New Server.

    • In the Create

      • Server dialog box, type a name on the General tab.

    • On the Connection tab, type the details of the DB instance:

      • Enter the Host as the endpoint name.

      • Type the username and password that you entered when you created the DB instance.

      • For Port, type the assigned port: 5432.

  • Grafana – RDS Postgres

    • Create user in the PgAdmin for grafana and create a database in the AWS Postgres server.

    • Open defaults.ini in grafana config folder.

    • Update the host with the RDS endpoint and add user and password in Database section.

Eg:

[database]

type = postgres

host = postgres.xxxxxxxxxxxxxxxxx.rds.amazonaws.com

name = grafana

user = postgres

password =<DB password>

  • Insights – RDS Postgres

    • The Insights database was created during the DB instance creation we can check that in the PgAdmin.

    • Open server-config.json in Insights-Home.

    • In the Postgres section update the username and password.

    • Also update the insightsDBUrl and grafanaDBUrl using the end point.

    • Restart the Platform service and it will generate the required table we can check that in PgAdmin.

Eg:

"postgre": {

"userName": "postgres",

"password": <DB password>,

"insightsDBUrl": "jdbc:postgresql://postgres.xxx.rds.amazonaws.com:5432/insight",

"grafanaDBUrl": "jdbc:postgresql://postgres.xxx.rds.amazonaws.com:5432/grafana"

}

Postgres backup

  • We can take backup of the database in our system by creating dump.sql.

  • Command to create dump.sql:

    • pg_dump -h <end_point> -U <my username> -f dump.sql <db name>

    • Eg: pg_dump -h postgres.xxx.rds.amazonaws.com -U postgres -f dump.sql insight

 

Cost Analysis

Instance type: db.t2.large | vCPU: 2 | Memory: 8 GiB | Region: US East (N.Virginia)

 

 

©2021 Cognizant, all rights reserved. US Patent 10,410,152