Docker
Docker installation
Prerequisites
- Docker use 20.10.7 or higher.
- CentOS use 7.6 or higher.
# Check the current kernel version.
$ uname -a
Linux api7-highavailability1 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 x86_64 x86_64 x86_64 GNU/Linux
# Upgrade the kernel
yum update -y kernel
Create network
docker network create api7-ee
docker network connect api7-ee api7-ee
Pull Docker Image
# Please replace the version number in accordance with your downloaded files.
docker pull api7/api7-ee:2.13.2304
Run Docker Container
Including API7-Gateway,API7-Dashboard, and etcd.
# Please replace the version number in accordance with your downloaded files.
docker run -d -p 80:80 -p 443:443 -p 9000:9000 api7/api7-ee:2.13.2304
Start confd (Optional)
Enable the monitoring function.
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
Start Prometheus (Optional)
Enable the monitoring function. You can use your existing Prometheus instance.
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
Start AlertManager (Optional)
Enable the alarm function.You can use your existing AlertManager instance.
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
Start OpenSearch (Optional)
Enable the audit function.You can use your existing OpenSearch instance.
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
Start Grafana (Optional)
Enable the metrics function.You can use your existing Grafana instance.
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