Layer7 API Management

Provision Container Gateway v9.3 with OTK 4.2 in Minutes 

Mar 02, 2018 01:11 PM

Background:

 

I have been work with docker heavily recently and I really love it. It make it super easy and light weight while setting up demo or POC environment. Gateway 9.3 offers a lightweight docker form factor, and I took it a step further. With some customization effort, now I could provision a gateway 9.3 container with OTK 4.2 installed and functioning in minutes. It speed up my work at a very large scale. Here is my github repository:

https://github-isl-01.ca.com/huafa01/ssg93-w-otk42 

 

For those of you who don't have github access, I also have my project attached in this document, as well as the README I published on github, as shown down below.

Usage 

Job #1: start the gateway with OTK installed

Step1: Copy your gateway license to ./config/ and rename it to SSG_LICENSE.xml
Step2: Start the gateway

# docker-compose up --build

Step3: Waiting until OTK intallation completed successfully

You will see something like down below from the console, means your gateway started and OTK installation was successful. Note that the gateway will be restarted as part of the customization after otk installation.

api-gateway_1 | Gateway not started yet, keep waiting...

api-gateway_1 | Gateway not started yet, keep waiting...

api-gateway_1 | Gateway started. Continuing.

api-gateway_1 | Installing OTK in background...

api-gateway_1 | JDBC connection created for OTK installation. Continuing.

api-gateway_1 | Cassandra connection created for OTK installation. Continuing.

api-gateway_1 | HTTP/1.1 100 Continue

api-gateway_1 |

api-gateway_1 | HTTP/1.1 200 OK

api-gateway_1 | Server: Apache-Coyote/1.1

api-gateway_1 | Content-Type: text/plain

api-gateway_1 | Content-Length: 32

api-gateway_1 | Date: Sat, 13 Jan 2018 00:28:58 GMT

api-gateway_1 |

api-gateway_1 | Request completed successfully.

api-gateway_1 | OTK installed successfully. Done.

Job #2: clean up and start all over from scratch

# docker-compose down --volume; rm -rf data

# docker images | grep otk42

# rmi DOCKER_IMAGE_ID

This command set will give you a clean start from scratch.

 

Troubleshooting Guide 

#1: Docker version compatibility

The compose file of this project is version 2.1. If you are using a newer version of docker, and prefer to use compose file v3.x, you may need to adjust CPU and memory setting of all 3 containers enclosed in this project.

#2: Failed to enroll the docker gateway with the portal

This could happen if you didn't allocate enough memory to the docker gateway. Without enough RAM, the gateway process would crash during OTK installation, and thus the OTK process will be partially installed. In my customization, the docker gateway container actually runs 2 processes, and the gateway process is not the dominate process, that's why this situation could be very unnoticeable. 

To restart the project, you would need to run the following command and then start it again.

# docker-compose down --volume; rm -rf data

#3: Ssg database is only partially available.

I saw this symptom once on one laptop of my customer. When this happens the gateway database (ssg) is only partially initialized therefore gateway startup will fail. I don't have a solution for this but based on my research it has something to do with environment variables that eventually affects container mysql. If you find a solution please add a comment to this article, thank you!

mysql-ssg_1 | 2018-03-16T20:26:16.181528Z 0 [Note] Shutting down plugin 'ngram'
mysql-ssg_1 | 2018-03-16T20:26:16.181594Z 0 [Note] Shutting down plugin 'partition'
mysql-ssg_1 | 2018-03-16T20:26:16.181616Z 0 [Note] Shutting down plugin 'BLACKHOLE'
mysql-ssg_1 | 2018-03-16T20:26:16.181723Z 0 [Note] Shutting down plugin 'ARCHIVE'
mysql-ssg_1 | 2018-03-16T20:26:16.181801Z 0 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
mysql-ssg_1 | 2018-03-16T20:26:16.181921Z 0 [Note] Shutting down plugin 'MRG_MYISAM'
mysql-ssg_1 | 2018-03-16T20:26:16.181970Z 0 [Note] Shutting down plugin 'MyISAM'
mysql-ssg_1 | 2018-03-16T20:26:16.182097Z 0 [Note] Shutting down plugin 'INNODB_SYS_VIRTUAL'
mysql-ssg_1 | 2018-03-16T20:26:16.182125Z 0 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
mysql-ssg_1 | 2018-03-16T20:26:16.182133Z 0 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
mysql-ssg_1 | 2018-03-16T20:26:16.182141Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
mysql-ssg_1 | 2018-03-16T20:26:16.182149Z 0 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
mysql-ssg_1 | 2018-03-16T20:26:16.182157Z 0 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
mysql-ssg_1 | 2018-03-16T20:26:16.182164Z 0 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
mysql-ssg_1 | 2018-03-16T20:26:16.182172Z 0 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
......
api-gateway_1 | Unexpected error running Liquibase: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
api-gateway_1 |
api-gateway_1 |
api-gateway_1 | ERROR - Failed to create or update the Gateway's database
ssg93otk42master_api-gateway_1 exited with code 1

Statistics
0 Favorited
17 Views
1 Files
0 Shares
10 Downloads
Attachment(s)
gz file
ssg93otk42.tar.gz   8.42 MB   1 version
Uploaded - May 29, 2019

Related Entries and Links

No Related Resource entered.