特例情况1。1# 创建安装程序解压目录,你可以根据实际需求灵活调整该路径,执行如下命令:
2sudo mkdir -p /tmp/es-center-server-install-app
3
4# 将下载的安装包解压至安装程序解压目录:
5sudo tar -xzvf es-center-server-install-app-1.0.2-202505271541.tar.gz -C /tmp/es-center-server-install-app
6
7# 切换至安装程序解压目录
8cd /tmp/es-center-server-install-app
9
10# 接下来进行服务安装,各参数说明如下:
11# `service-root-dir`: 服务的安装目录。
12# `data-root-dir`: 用于存储服务器运行过程中产生的数据,如日志文件、数据库挂载等的数据存储目录。
13# `internal-eth-name`: 内网网卡的名称。
14# `internal-ip`: 内网 IP 地址。
15# `external-ip`: 公网 IP 地址,若没有公网 IP,可设为内网 IP。
16# `domain-name`: 域名,若未申请域名,可设为内网 IP 或公网 IP。
17sudo ./cli install-server \
18--service-root-dir /opt/es-center-server-service \
19--data-root-dir /var/lib/es-center-server-data \
20--internal-eth-name eth0 \
21--internal-ip 172.16.8.178 \
22--external-ip 120.26.124.232 \
23--domain-name zxs.netbodycamera.com执行命令
sudo docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}",查看并核对 Docker 容器的相关信息。以下是安装成功后的 Docker 容器信息示例:
1CONTAINER ID NAMES IMAGE STATUS
2b72e1edc6718 es-center-server-launcher docker:cli Up 18 hours
3264c73b18182 es-center-server-janus gt-janus-gateway:1.3.1 Up 18 hours
402975cecad79 es-center-server-nginx nginx:1.28.0-alpine Up 18 hours
54149459d6aa8 es-center-server-web-app es-center-server-web-app:1.0.2-20250527 Up 18 hours
6a6aff9e25882 es-center-server-device-service es-center-server-device-service:1.0.2-20250527 Up 18 hours
7780d5262aa32 es-center-server-main-service es-center-server-main-service:1.0.2-20250527 Up 18 hours
8214b2a864ed7 es-center-server-emqx emqx:5.8.6 Up 18 hours
98deb618a3b3e es-center-server-coturn coturn/coturn:4.6.3-alpine Up 18 hours
10387447f9fc96 es-center-server-activemq-artemis apache/activemq-artemis:2.41.0-alpine Up 18 hours
11ff88a7d39b7f es-center-server-redis bitnami/redis:7.4.3 Up 18 hours
12dd32f67e4de4 es-center-server-pg-0 bitnami/postgresql-repmgr:16.3.0 Up 18 hours
137966f28e902a es-center-server-pg-1 bitnami/postgresql-repmgr:16.3.0 Up 18 hours
14de2625988574 es-center-server-pg bitnami/pgpool:4.5.2 Up 18 hours (healthy)1# 切换至服务安装目录
2cd /opt/es-center-server-service
3
4# 若在安装程序时,指定的 `domain-name` 为内网 IP 或公网 IP,使用 cli 工具的 update-server-ssl 命令会报错
5sudo ./cli update-server-ssl若服务器已安装其他服务,且这些服务占用了以下端口:3478、61616、8161、18083、8883、1883、8083、8084、80、443、5433、6379、84、86、89,请在安装程序解压目录的配置文件 .env 中进行修改,修改完成后再执行安装命令。
1# 修改安装程序解压目录的配置文件
2sudo nano /tmp/es-center-server-install-app/es-center-server-service/.env
3
4# 切换至安装程序解压目录
5cd /tmp/es-center-server-install-app
6
7# 接下来进行服务安装,各参数说明如下:
8# `service-root-dir`: 服务的安装目录。
9# `data-root-dir`: 用于存储服务器运行过程中产生的数据,如日志文件、数据库挂载等的数据存储目录。
10# `internal-eth-name`: 内网网卡的名称。
11# `internal-ip`: 内网 IP 地址。
12# `external-ip`: 公网 IP 地址,若没有公网 IP,可设为内网 IP。
13# `domain-name`: 域名,若未申请域名,可设为内网 IP 或公网 IP。
14sudo ./cli install-server \
15--service-root-dir /opt/es-center-server-service \
16--data-root-dir /var/lib/es-center-server-data \
17--internal-eth-name eth0 \
18--internal-ip 172.16.8.178 \
19--external-ip 120.26.124.232 \
20--domain-name zxs.netbodycamera.com
21
22# 为查看当前运行的 Docker 实例信息,执行以下命令:
23sudo docker ps --format "table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}"若在服务安装完成后发现端口冲突,您可以通过修改服务安装目录下的配置文件 .env 来解决此问题。修改完成后,在服务安装目录下执行以下命令更新服务:
1# 修改服务安装目录下的配置文件 `.env`
2sudo nano /opt/es-center-server-service/.env
3
4# 切换至服务安装目录
5cd /opt/es-center-server-service
6
7# 依据 .env 配置更新服务的配置文件内容,并有序重启服务
8sudo ./cli update-server默认配置是针对 2 核 4G 服务器设计的。若您的服务器配置更高,可对性能参数进行调整,例如 ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS 和 ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS。
1# 修改服务安装目录下的配置文件 `.env`
2sudo nano /opt/es-center-server-service/.env
3
4# 切换至服务安装目录
5cd /opt/es-center-server-service
6
7# 依据 .env 配置更新服务的配置文件内容,并有序重启服务
8sudo ./cli update-server1# ####################################
2# ### es-center-server Basic Configuration
3# ####################################
4# Root directory for the es-center-server service
5ES_CENTER_SERVER_SERVICE_ROOT_DIR=/opt/es-center-server-service
6# Data root directory for the es-center-server
7ES_CENTER_SERVER_DATA_ROOT_DIR=/var/lib/es-center-server-data
8# Internal IP address of the es-center-server
9ES_CENTER_SERVER_INTERNAL_IP=192.168.0.1
10# External IP address of the es-center-server
11ES_CENTER_SERVER_EXTERNAL_IP=192.168.0.1
12# Domain name of the es-center-server
13ES_CENTER_SERVER_DOMAIN_NAME=example.com
14
15# ####################################
16# ### es-center-server-coturn WebRTC Traversal Service Configuration
17# ####################################
18# Docker image tag for the COTURN service
19ES_CENTER_SERVER_COTURN_DOCKER_IMAGE_TAG=4.6.3-alpine
20# Domain name for the COTURN service
21ES_CENTER_SERVER_COTURN_DOMAIN_NAME=example.com
22# Internal Ethernet interface name for the COTURN service
23ES_CENTER_SERVER_COTURN_INTERNAL_ETH_NAME=eth0
24# Internal IP address of the COTURN service
25ES_CENTER_SERVER_COTURN_INTERNAL_IP=192.168.0.1
26# External IP address of the COTURN service
27ES_CENTER_SERVER_COTURN_EXTERNAL_IP=192.168.0.1
28# Specifies the main listening port for the COTURN service.
29# This is the port on which the COTURN server listens for incoming connections.
30ES_CENTER_SERVER_COTURN_LISTENING_PORT=3478
31# Defines the minimum port number within the range used by the COTURN service.
32# COTURN may allocate ports starting from this value for certain operations.
33ES_CENTER_SERVER_COTURN_MIN_PORT=20000
34# Defines the maximum port number within the range used by the COTURN service.
35# COTURN will not allocate ports beyond this value for relevant operations.
36ES_CENTER_SERVER_COTURN_MAX_PORT=39999
37# TURN username for the COTURN service
38ES_CENTER_SERVER_COTURN_TURN_USERNAME=webrtc-1
39# TURN credential for the COTURN service
40ES_CENTER_SERVER_COTURN_TURN_CREDENTIAL=A7mKp2L9xQ4Zn3T8
41
42# ####################################
43# ### es-center-server-janus WebRTC Gateway Configuration
44# ####################################
45# Docker image tag for the Janus service
46ES_CENTER_SERVER_JANUS_DOCKER_IMAGE_TAG=1.3.1
47# Identifier for the Janus instance
48ES_CENTER_SERVER_JANUS_NO=janus-1
49# Internal Ethernet interface name for the Janus service
50ES_CENTER_SERVER_JANUS_INTERNAL_ETH_NAME=eth0
51# Internal IP address of the Janus service
52ES_CENTER_SERVER_JANUS_INTERNAL_IP=192.168.0.1
53# External IP address of the Janus service
54ES_CENTER_SERVER_JANUS_EXTERNAL_IP=192.168.0.1
55# Defines the range of ports that the Janus service will use for Real - Time Transport Protocol (RTP) traffic.
56# RTP is responsible for the actual transmission of audio and video data.
57# The Janus service will allocate ports from 40000 to 59999 for handling RTP streams during media communication.
58ES_CENTER_SERVER_JANUS_RTP_PORT_RANGE=40000-59999
59
60# ####################################
61# ### es-center-server-activemq-artemis Message Queue Configuration
62# ####################################
63# Docker image tag for the ActiveMQ Artemis service
64ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_DOCKER_IMAGE_TAG=2.41.0-alpine
65# Username for the ActiveMQ Artemis service
66ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_USER=artemis
67# Password for the ActiveMQ Artemis service
68ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_PASSWORD=abcd1234abcd
69# TCP port for the ActiveMQ Artemis service
70ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_TCP_PORT=61616
71# HTTP port for the ActiveMQ Artemis service
72ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_HTTP_PORT=8161
73
74# ####################################
75# ### es-center-server-emqx MQTT Message Broker Configuration
76# ####################################
77# Docker image tag for the EMQX service
78ES_CENTER_SERVER_EMQX_DOCKER_IMAGE_TAG=5.8.6
79# HTTP port for the EMQX service
80ES_CENTER_SERVER_EMQX_HTTP_PORT=18083
81# HTTPS port for the EMQX service
82ES_CENTER_SERVER_EMQX_HTTPS_PORT=8883
83# TCP port for the EMQX service
84ES_CENTER_SERVER_EMQX_TCP_PORT=1883
85# WebSocket port for the EMQX service
86ES_CENTER_SERVER_EMQX_WS_PORT=8083
87# Secure WebSocket port for the EMQX service
88ES_CENTER_SERVER_EMQX_WSS_PORT=8084
89# IP address of the EMQX service
90ES_CENTER_SERVER_EMQX_IP=192.168.0.1
91
92# ####################################
93# ### es-center-server-nginx Reverse Proxy Configuration
94# ####################################
95# Docker image tag for the Nginx service
96ES_CENTER_SERVER_NGINX_DOCKER_IMAGE_TAG=1.28.0-alpine
97# HTTP port for the Nginx service
98ES_CENTER_SERVER_NGINX_HTTP_PORT=80
99# HTTPS port for the Nginx service
100ES_CENTER_SERVER_NGINX_HTTPS_PORT=443
101
102# ####################################
103# ### es-center-server-pg Database Cluster Configuration
104# ####################################
105# Docker image tag for PostgreSQL instance 0
106ES_CENTER_SERVER_PG_0_DOCKER_IMAGE_TAG=16.3.0
107# Docker image tag for PostgreSQL instance 1
108ES_CENTER_SERVER_PG_1_DOCKER_IMAGE_TAG=16.3.0
109# Docker image tag for Pgpool service
110ES_CENTER_SERVER_PG_PGPOOL_DOCKER_IMAGE_TAG=4.5.2
111# Username for Repmgr in PostgreSQL
112ES_CENTER_SERVER_PG_REPMGR_USERNAME=repmgr
113# Password for Repmgr in PostgreSQL
114ES_CENTER_SERVER_PG_REPMGR_PASSWORD=abcd1234abcd
115# Password for the 'postgres' user in PostgreSQL
116ES_CENTER_SERVER_PG_POSTGRESQL_POSTGRES_PASSWORD=abcd1234abcd
117# Username for the application in PostgreSQL
118ES_CENTER_SERVER_PG_POSTGRESQL_USERNAME=es
119# Password for the application in PostgreSQL
120ES_CENTER_SERVER_PG_POSTGRESQL_PASSWORD=abcd1234abcd
121# Username for SR check in Pgpool
122ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_USER=repmgr
123# Password for SR check in Pgpool
124ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_PASSWORD=abcd1234abcd
125# Username for the 'postgres' user in Pgpool
126ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_USERNAME=postgres
127# Password for the 'postgres' user in Pgpool
128ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_PASSWORD=abcd1234abcd
129# Admin username for Pgpool
130ES_CENTER_SERVER_PG_PGPOOL_ADMIN_USERNAME=admin
131# Admin password for Pgpool
132ES_CENTER_SERVER_PG_PGPOOL_ADMIN_PASSWORD=abcd1234abcd
133# Custom usernames for PostgreSQL in Pgpool
134ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_USERS=es
135# Custom passwords for PostgreSQL in Pgpool
136ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_PASSWORDS=abcd1234abcd
137# Port for the PostgreSQL service
138ES_CENTER_SERVER_PG_PORT=5433
139
140# ####################################
141# ### es-center-server-redis Cache Service Configuration
142# ####################################
143# Docker image tag for the Redis service
144ES_CENTER_SERVER_REDIS_DOCKER_IMAGE_TAG=7.4.3
145# Port for the Redis service
146ES_CENTER_SERVER_REDIS_PORT=6379
147# Password for the Redis service
148ES_CENTER_SERVER_REDIS_PASSWORD=abcd1234abcd
149# Maximum memory limit for the Redis service
150ES_CENTER_SERVER_REDIS_MAXMEMORY=100mb
151# Memory eviction policy for the Redis service, using LRU
152ES_CENTER_SERVER_REDIS_MAXMEMORY_POLICY=allkeys-lru
153
154# ####################################
155# ### es-center-server-main-service Main Service Configuration
156# ####################################
157# Docker image tag for the main service
158ES_CENTER_SERVER_MAIN_SERVICE_DOCKER_IMAGE_TAG=1.0.2-20250527
159# Java options for the main service, setting memory limits
160ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
161# Commented-out alternative Java options for the main service with different memory limits
162# ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
163# HTTP port for the main service
164ES_CENTER_SERVER_MAIN_SERVICE_HTTP_PORT=84
165
166# ####################################
167# ### es-center-server-device-service Device Service Configuration
168# ####################################
169# Docker image tag for the device service
170ES_CENTER_SERVER_DEVICE_SERVICE_DOCKER_IMAGE_TAG=1.0.2-20250527
171# Java options for the device service, setting memory limits
172ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
173# Commented-out alternative Java options for the device service with different memory limits
174# ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=1 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
175# HTTP port for the device service
176ES_CENTER_SERVER_DEVICE_SERVICE_HTTP_PORT=86
177
178# ####################################
179# ### es-center-server-web-app Web Application Configuration
180# ####################################
181# Docker image tag for the web application
182ES_CENTER_SERVER_WEB_APP_DOCKER_IMAGE_TAG=1.0.2-20250527
183# HTTP port for the web application
184ES_CENTER_SERVER_WEB_APP_HTTP_PORT=89