SIA-GateWay API Gateway Installation and Deployment Guide

Keywords: Programming Docker Maven Nginx Spring

SIA-GATEWAY is a distributed micro-service gateway system based on Spring Cloud micro-service ecosystem. It has the characteristics of easy to use, visualization, high scalability and high availability, and provides cloud native, complete and mature access service solutions. This paper introduces the installation and deployment of API gateway.

I. environment

1.1 Compiling Environment

  • Maven3+
  • nodejs
  • Jdk1.8+

1.2 Runtime Third Party Dependency

  • Mysql5.6+
  • elasticsearch 5.5.2
  • kibana-5.5.2
  • kafka 2.12-2.0.0
  • redis 3.2.11
  • eureka-server

1.3 Operating Environment

  • 64bit OS,Linux/Mac/Windows/docker
  • JDK1.8+

Source Download

git clone

2.1 The source code structure is as follows:

- ia-gateway-admin-build component gateway admin component set
 -sia-gateway-admin gateway admin monitoring system component
 -sia-gateway-synchspeed Gateway Real-time Sensing Component for Downstream Services
 -sia-gateway-stream gateway log component
 _-sia-gateway-service Gateway System Auxiliary Component
 -sia-gateway-monitor gateway monitoring and log components
│   │    ├── sia-gateway-reactive    
- sia-gateway-messaging basic dependencies 
│   │    ├── sia-gateway-sink
│   │    ├── sia-gateway-esclient
│   │    ├── sia-gateway-base
 - front-end code of sia-gateway-admin-display gateway system
 - sia-gateway-build component gateway core-build component
 -sia-gateway-core gateway Core node
│   │   ├── sia-gateway-base
 - sia-gateway-messaging basic dependencies
│   │   ├── sia-gateway-reactive
│   │   ├── sia-gateway-template

Initialization of API Gateway Database

1) The installation and configuration of MySQL are detailed in the official MySQL documentation.

2) Please download the project source code and decompress it to get the "API gateway database initialization SQL script" and execute it.

The location of "API Gateway Database Initialization SQL Script" is:


IV. Configuration of Gateway System

4.1 Gateway Profile Address

# Gateway admin center conf

# Gateway monitoring service conf

# Gateway Auxiliary Node conf

# Gateway Logging Service conf

# Gateway Real-time Perception Service Con

# Gateway Core Node conf







Description: is the gateway group name. Developers can modify this attribute and build a new gateway group.

4.2 maven Warehouse Address Configuration

		      <name>aliyun maven</name>

		    <id>spring plugins</id>  
		      <jdk>spring plugins</jdk>  
		        <id>spring plugins</id>  
		        <name>Spring plugins</name>  


V. Building Deployment Projects

5.1 Compilation Project

1) If the above configuration has been correctly implemented, the project can be compiled and packaged for deployment.

2) Operation steps:

	cd sia-gateway
	chmod +x *.sh

3) After successful packaging, the following annotation files will appear.

  • /sia-gateway/sia-gateway-admin-buildcomponent/target/

  • /sia-gateway/sia-gateway-buildcomponent/target/

  • /sia-gateway/sia-gateway-admin-display/dist/

Note: NoeJs is required for front-end packaging. If not installed, please refer to Noejs Installation Document.

5.2 Deployment Project

  • API gateway system deployment mode is distributed deployment centralized management mode, that is, gateway Core nodes can be divided into different gateway groups according to business lines. Gateway management terminal serves as the management center of the gateway for a unified management interface, where users can set up and maintain API, components, system basic information, collect and monitor. Log, generate various operation and maintenance management reports, automatic alarm, etc.
  • Sia-gateway-admin-build component is the component set of gateway management end, including admin, stream, service, synchspeed, monitor; the management end can deploy a single node (currently does not support cluster).
  • Sia-gateway-build component is a gateway Core component, which can be grouped according to business lines and deployed as a single node or cluster within the group.

5.3 Vmware deployment

1) Back-end Deployment


cd /gatewayadmin/bin

chmod +x *.sh 

#Start Gateway Management Services, including admin, stream, service, synchspeed, monitor.


cd /gateway/bin

chmod +x *.sh 

#Start Gateway Core Service

2) Front End Deployment

  • Modify the front-end site-map.js

  • The proxy configuration of nginx, enter the directory of nginx nginx.conf, add the following configuration:

    	    upstream { 
    		   #### sia-gateway-admin service IP
    	      server *******:8090 ; 
    	    server {
    	    	 # nginx listening port
    	        listen       18086;
    	        server_name  localhost;
    	        access_log  logs/host.access.log  main;
    	        #access_log  "pipe:rollback logs/host.access_log interval=1d baknum=7 maxsize=2G"  main;
    	        location / {
    	            #root   html;
    	            #index  index.html index.htm;
    	            root  /app/jar/ROOT/dist;
    	            index  index.html index.htm;
    	        # Backend service location 
    	        location ^~ /vv1/  {
    	                proxy_set_header   Host  $host; 
    	                proxy_set_header   X-Real-IP $http_x_forwarded_for; 
    	                proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for; 
    	                proxy_http_version 1.1;
    	        error_page   500 502 503 504  /50xcn.html;
    	        location = /50xcn.html {
    	            root   html/error_page;
    	            index 50xcn.html;
    	        location /check_status {
    	            vhost_traffic_status_display_format json;
  • Restart nginx

    	#Verify that the configuration is correct
    	./nginx -t
    	# Restart
    	./nginx -s reload

5.4 Docker Mirror Deployment

Note: If the docker environment and the compilation environment are on the same operating system, the following steps can be directly performed; conversely, the following files need to be uploaded to the server where the docker environment is located according to the original directory structure.

  • /sia-gateway/sia-gateway-admin-buildcomponent/target/
  • /sia-gateway/sia-gateway-buildcomponent/target/
  • /sia-gateway/sia-gateway-admin-display/dist/
  • /sia-gateway/third-libary
  • /sia-gateway/
  • /sia-gateway/
  • /sia-gateway/
  • /sia-gateway/Dockerfile


1) Configuration: Modify site-map.js, location: / dist/static/site-map.js

         * vmware Deployment: - > nginx ip address
         * docker Mirror Deployment: - > Host ip of docker container
        'CESHI_API_HOST': '',
         * ----> kibana ip address
        'CESHI_API_HOST_LOG': ''

2) Download the centos basic image, if it has been downloaded, this step is ignored.

3) Modify Docker file, FROM <font color='red'> mirror name: version number </font>

4) Configure the yum source. If the deployment machine can use the aliyum source, this step is ignored.

Modify the yum source file name to CentOS-Base.repo and replace it with / sia-gateway/third-libary/.

5) Build mirrors and start containers and services

	# Constructing mirrors
	cd /sia-gateway/ 
	# To grant authorization
	chmod +x *.sh
	# Constructing mirrors
	# Start Containers and Services
	# Check if the container started successfully
	docker ps 
	# Enter the container to see how the service works
	docker exec -it gateway-test:v1 bash

Access address: http://Host IP:18086/


  • Docker image deployment is an ALL-IN-ONE form of gateway deployment Demo, which is provided to facilitate developers to build gateway system based on docker environment simply and quickly. Gateway monitoring services, early warning, gateway core nodes and so on are all built in a docker image. Developers can be flexible according to the development environment conditions. The deployment scheme is chosen, and it is recommended to use the vmware+docker image deployment mode, that is, the gateway management service is deployed on vmware, and the gateway core node is deployed in the docker environment.

SIA Related Open Source Product Links

Source: Yixin Institute of Technology

Posted by Xpheyel on Tue, 10 Sep 2019 23:56:17 -0700