HOWTO INSTALL KONG API GATEWAY & ITS DATABASE i.e., POSTGRES ON VERITAS HA | ON INFOSCALE AVAILABILITY

Posted on July 18, 2018

0


ENVIRONMENT

Postgres = 9.6

Kong API Gateway = 0.11.2

OS = RHEL 7.3

InfoScale Availability | VCS version = 7.3.1

InfoScale Availability Nodes| VCS Nodes = 2

 

First use below link to install and configure KONG API Gateway & Postgres

HOWTO INSTALL KONG API GATEWAY & ITS DATABASE i.e., POSTGRES

https://zahidhaseeb.wordpress.com/2018/07/18/howto-install-kong-api-gateway-its-database-i-e-postgres/

  • Install ACC library, Agent and import resources defination

Download ACC Library

2018-07-18_103618

2018-07-18_103428

After download untar the file and go to rpms and install acc library rpm.

Download Agent

2018-07-18_103341.png

 

2018-07-18_103358

After download untar the file and go to rpms and install postgres database agent rpm.

Import Postgres database definition files

Defination

 

Defination2

Now you will be able to see and configure a Postgres resource

Defination3

Below are required attributes from VERITAS guide for Postgres database.

2018-07-13_154307

  • ONLINE POSTGRES RESOURCE

Now Postgres resource will be able to online. Must note that this resource will be online thru Postgres user instead of root user. Makesure that KONG service should be able to start/connect when Postgres database runs thru Postgres user.

WORKAROUND

Else start Postgres service(thru systemctl start postgres-9.6 thru root user via using postonline script of VCS | HA) before online Postgres database resource. Follow below link to use postonline script. This will start Postgres service thru root user as well and then KONG API GATEWAY will be able to start.

https://zahidhaseeb.wordpress.com/2012/11/26/howto-configure-postoffline-trigger-under-veritas-cluster-server/

 

  • CONFIGURE KONG API GATEWAY RESOURCE

To HA a KONG API gateway application, APPLICATION RESOURCE will be used. For this we need to configure start, stop and monitor process attributes under VCS|HA

CREATE Start Script

[Always/Must use absolute path : like “/usr/bin/pkill nginx” instead “pkill nginx”]

 

#!/bin/bash

/usr/bin/pkill nginx                                   #This will kill couple of occupied ports/seems bug

/usr/local/bin/kong start

#Now save this script like kong-start.sh

CREATE Stop Script         

#!/bin/bash

/usr/local/bin/kong quit

#Now save this script like kong-stop.sh

Monitor Process

Run KONG API GATEWAY and pick its process which resource to add under APPLICATION RESOURCE as attribute thru below command

ps -ef |grep kong

Put start, stop and monitor process under APPLICATION RESOURCE attributes like this:

start attribute                             /opt/HA/kong-start.sh start

stop attribute                              /opt/HA/kong-stop.sh stop

monitor process                        ngnix master xxxxxxxxxxxxxxx

 

Now KONG API GATEWAY resource will be able to online

Posted in: Linux