Skip to main content

Version: 2.13.2304

Docker Installation

This guide will walk you through the rapid deployment of all essential components of API7 Enterprise on a single machine for PoC feature verification. Once the deployment is complete, the address of this machine will serve as the API7 Gateway address.

info

For production use, high availability is essential, so all components should be deployed in a cluster configuration rather than on a single machine. Please contact us for production environment deployment support.

Prerequisites

  • Install Docker and use version 20.10.7 or later.
  • Operating system CentOS uses version 7.6 or later.
  • Use an instance with a minimum of 2 cores and 4GB of memory.
  • Make sure the following Open Ports have been added to the security group or firewall allow list:
ComponentListen PortsOpen Ports
api7-dashboard90009000
etcd2379,23802379
api7-gateway80,443,9091,909280,443
opensearch9200-
confd--
prometheus90909090
alertmanager90939093
grafana30003000

Create Network


docker network create api7-ee

Get Docker Image


docker pull api7/api7-ee:2.13.2304

Install API7 Enterprise in Quickstart Mode


curl download.apiseven.com/api7-ee/quickstart@2.13.2304 | sudo bash

Login to API7 Enterprise Dashboard

Navigate to http://<API7_GATEWAY_ADDRESS>:9000 and login to API7 Enterprise Dashboard.Default username and password are both admin.

API7 Enterprise Login

During the installation, the first cluster poc, the first etcd resource default, and the first gateway node (data plane node) will be automatically created.

Activate License

Refer to the documentation on Get License,then upload and activate the license.

Activate License

Start Control Plane Dependencies

Control Plane dependencies refer to the following components:

  • OpenSearch 1.3.7
  • Grafana 7.3.7
  • Prometheus 2.25.0
  • confd 0.16.0
  • AlertManager 0.22.2

Start confd


echo 'backend = "etcdv3"
confdir = "/etc/confd"
nodes = [
"http://api7-ee:2379",
]
watch = true' > ./confd.toml


docker run -d --network=api7-ee --name confd \
-v $(pwd)/confd.toml:/etc/confd/confd.toml \
-v $(pwd)/prometheus_conf:/root/prometheus \
-v $(pwd)/alertmanager_conf:/root/alertmanager \
api7/api7-confd:0.16.0

Check the status of the container to ensure it is Up:


docker ps | grep confd

Start Prometheus


docker run -d --name prometheus --network api7-ee \
-p 9090:9090 \
-v $(pwd)/prometheus_conf:/etc/prometheus \
--hostname prometheus \
--restart always prom/prometheus:latest \
--config.file=/etc/prometheus/prometheus.yml --web.enable-lifecycle

Check the status of the container to ensure it is Up:


docker ps | grep prometheus

Navigate to http://<API7_GATEWAY_ADDRESS>:9090 and check Prometheus Console.

Prometheus Console

Start AlertManager


docker run -d --name alertmanager --network=api7-ee \
-p 9093:9093 \
-v $(pwd)/alertmanager_conf:/etc/alertmanager \
--restart always prom/alertmanager:latest \
--log.level=debug --config.file=/etc/alertmanager/alertmanager.yml


Check the status of the container to ensure it is Up:


docker ps | grep alertmanager

Navigate to http://<API7_GATEWAY_ADDRESS>:9093/#/alerts and check AlertManager Console.

AlertManager Console

Start OpenSearch


docker run -d --name opensearch --network api7-ee \
-p 9200:9200 \
--hostname opensearch \
--restart always \
--env discovery.type=single-node \
--env plugins.security.disabled=true \
--env cluster.routing.allocation.disk.threshold_enabled=true \
--env ES_JAVA_OPTS="-Xmx4g -Xms4g" \
opensearchproject/opensearch:2.3.0

Check the status of the container to ensure it is Up:


docker ps | grep opensearch

Test OpenSearch:


curl http://localhost:9200 -v

Get response:


< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 567
<
{
"name" : "node-1",
"cluster_name" : "opensearch-cluster",
"cluster_uuid" : "PrNDIhRuSOamdu-fs0WfKw",
"version" : {
"distribution" : "opensearch",
"number" : "1.3.7",
"build_type" : "tar",
"build_hash" : "db18a0d5a08b669fb900c00d81462e221f4438ee",
"build_date" : "2022-12-07T22:59:20.186520Z",
"build_snapshot" : false,
"lucene_version" : "8.10.1",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}

Start Grafana


mkdir grafana_conf

echo "[security]
allow_embedding = true" > ./grafana_conf/grafana.ini


docker run -d --name grafana --network api7-ee \
-p 3000:3000 \
-v $(pwd)/grafana_conf/grafana.ini:/etc/grafana/grafana.ini \
--hostname grafana \
--restart always \
grafana/grafana:7.3.7

Check the status of the container to ensure it is Up:


docker ps | grep grafana

Navigate to http://<API7_GATEWAY_ADDRESS>:3000 and loginto Grafana Console.Default username and password are both admin.

Grafana Console

Grafana Homepage

Configure Grafana

On the left menu,select Configuration > Data Sources:

Grafana Choose Data Source

Click Add data source:

Grafana Add Data Source

Select Prometheus:

Grafana Select Prometheus

Modify HTTP > URL to Prometheus address http://prometheus:9090 then click Save & Test.

Grafana Docker

on the left menu, select Create > Import:

Import Grafana Dashboard

Eneter 18384 as Grafana.com dashboard id, then click the Load button on the right:

Grafana 18384

Confirm the "APISEVEN Grafana Dashboard" details, select Prometheus data source, then click Import:

Grafana Preview

Preview Grafana dashboard:

Grafana Dashbaord

Click the Share icon, turn off all switches, then click Copy to get Grafana dashboard URL:

Grafana Copy

API7 Enterprise System Settings

  1. Access the API7 Enterprise dashboard, select System Management in the top menu, and then choose Settings in the left menu. Go to the Grafana URL tab. Fill in the copied Grafana dashboard address from the previous step and click Save.
  2. Switch to the Prometheus tab and enter http://prometheus:9090 in the Hosts field. Click Save.
  3. Switch to the OpenSearch tab and enter http://opensearch:9200 in the Hosts field. Click Save.

Validate Metrics

Navigate to the poc cluster and select Metrics from the left menu. The embedded Grafana dashboard will be displayed here:

Metrics

Validate Gateway Nodes

Navigate to the poc cluster and select Gateway Nodes from the left menu. Confirm that there is one node and its status is Synced.

Gateway Node


API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation