2.0.0

准备工作

  • 建议选用 Ubuntu Server 22.04 LTS 作为操作系统,已针对该系统开展了大量测试。若需使用其他操作系统,可根据客户需求进行定制化支持,并在充分测试后投入使用。
  • 系统配置要求:至少 3 核 CPU 及 6GB 内存。
  • 硬盘空间要求:可用空间需大于 20GB。
  • 端口开放:请开放以下端口 3478、61616、8161、18083、8883、1883、8083、8084、7700, 80、443、5433、6379、84、86、89、20000 - 60000,并确保防火墙或安全组允许这些端口的流量通过。其中,7700、5433、6379、84、86、89 为调试专用端口,调试完成后请及时关闭,以保障服务器安全。
  • 端口占用检查:请检查服务器中是否已安装其他服务并占用上述相关端口,具体处理方式可参考文中 特例情况1

快速安装

安装命令
1# 创建安装程序解压目录,你可以根据实际需求灵活调整该路径,执行如下命令:
2sudo mkdir -p /tmp/es-center-server-install-app
3
4# 将下载的安装包解压至安装程序解压目录:
5sudo tar -xzvf es-center-server-install-app-1.1.3-ge-1-202511111542.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 {{.Names}}\t{{.Image}}\t{{.Status}}",查看并核对 Docker 容器的相关信息。以下是安装成功后的 Docker 容器信息示例:

示例
1NAMES                               IMAGE                                                 STATUS
2es-center-server-emqx               emqx:5.8.8                                            Up 3 hours
3es-center-server-nginx              nginx:1.29.4-alpine                                   Up 3 hours
4es-center-server-launcher           docker:cli                                            Up 3 hours
5es-center-server-meilisearch        getmeili/meilisearch:v1.28.1                          Up 3 hours
6es-center-server-janus              gt-janus-gateway:1.3.1                                Up 3 hours
7es-center-server-web-app            es-center-server-web-app:2.0.0-cn-1-20260106          Up 3 hours
8es-center-server-device-service     es-center-server-device-service:2.0.0-cn-1-20260106   Up 3 hours
9es-center-server-main-service       es-center-server-main-service:2.0.0-cn-1-20260106     Up 3 hours
10es-center-server-nacos              qingpan/rnacos:v0.7.10-alpine                         Up 3 hours
11es-center-server-coturn             coturn/coturn:4.7.0-alpine                            Up 3 hours
12es-center-server-activemq-artemis   apache/activemq-artemis:2.44.0-alpine                 Up 3 hours
13es-center-server-redis              bitnami/redis:7.4.3                                   Up 3 hours
14es-center-server-pg-0               bitnami/postgresql-repmgr:16.3.0                      Up 3 hours
15es-center-server-pg-1               bitnami/postgresql-repmgr:16.3.0                      Up 3 hours
16es-center-server-pg                 bitnami/pgpool:4.5.2                                  Up 3 hours (healthy)

更新或申请 SSL 证书

更新或申请 SSL 证书命令
1# 切换至服务安装目录
2cd /opt/es-center-server-service
3
4# 若在安装程序时,指定的 `domain-name` 为内网 IP 或公网 IP,使用 cli 工具的 update-server-ssl 命令会报错
5sudo ./cli update-server-ssl

特例情况处理

特例情况1

若服务器已安装其他服务,且这些服务占用了以下端口: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

默认配置是针对 3 核 6G 服务器设计的。若您的服务器配置更高,可对性能参数进行调整,例如 ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTSES_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-server

.env 文件内容

.env
1# ####################################
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.7.0-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.44.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.8
79# HTTP port for the EMQX service
80ES_CENTER_SERVER_EMQX_HTTP_PORT=18083
81# SSL port for the EMQX service
82ES_CENTER_SERVER_EMQX_SSL_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# API username for the EMQX service
92ES_CENTER_SERVER_EMQX_API_KEY=api-key
93# API credential for the EMQX service
94ES_CENTER_SERVER_EMQX_API_SECRET=A7mKp2L9xQ4Zn3T8
95
96# ####################################
97# ### es-center-server-nginx Reverse Proxy Configuration
98# ####################################
99# Docker image tag for the Nginx service
100ES_CENTER_SERVER_NGINX_DOCKER_IMAGE_TAG=1.29.4-alpine
101# HTTP port for the Nginx service
102ES_CENTER_SERVER_NGINX_HTTP_PORT=80
103# HTTPS port for the Nginx service
104ES_CENTER_SERVER_NGINX_HTTPS_PORT=443
105
106# ####################################
107# ### es-center-server-pg Database Cluster Configuration
108# ####################################
109# Docker image tag for PostgreSQL instance 0
110ES_CENTER_SERVER_PG_0_DOCKER_IMAGE_TAG=16.3.0
111# Docker image tag for PostgreSQL instance 1
112ES_CENTER_SERVER_PG_1_DOCKER_IMAGE_TAG=16.3.0
113# Docker image tag for Pgpool service
114ES_CENTER_SERVER_PG_PGPOOL_DOCKER_IMAGE_TAG=4.5.2
115# Username for Repmgr in PostgreSQL
116ES_CENTER_SERVER_PG_REPMGR_USERNAME=repmgr
117# Password for Repmgr in PostgreSQL
118ES_CENTER_SERVER_PG_REPMGR_PASSWORD=abcd1234abcd
119# Extra flags for PostgreSQL
120ES_CENTER_SERVER_PG_POSTGRESQL_EXTRA_FLAGS=-c wal_level=logical -c max_wal_senders=10 -c max_replication_slots=10 -c max_slot_wal_keep_size=10GB -c wal_keep_size=4GB
121# Password for the 'postgres' user in PostgreSQL
122ES_CENTER_SERVER_PG_POSTGRESQL_POSTGRES_PASSWORD=abcd1234abcd
123# Username for the application in PostgreSQL
124ES_CENTER_SERVER_PG_POSTGRESQL_USERNAME=es
125# Password for the application in PostgreSQL
126ES_CENTER_SERVER_PG_POSTGRESQL_PASSWORD=abcd1234abcd
127# Username for SR check in Pgpool
128ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_USER=repmgr
129# Password for SR check in Pgpool
130ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_PASSWORD=abcd1234abcd
131# Username for the 'postgres' user in Pgpool
132ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_USERNAME=postgres
133# Password for the 'postgres' user in Pgpool
134ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_PASSWORD=abcd1234abcd
135# Admin username for Pgpool
136ES_CENTER_SERVER_PG_PGPOOL_ADMIN_USERNAME=admin
137# Admin password for Pgpool
138ES_CENTER_SERVER_PG_PGPOOL_ADMIN_PASSWORD=abcd1234abcd
139# Custom usernames for PostgreSQL in Pgpool
140ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_USERS=es
141# Custom passwords for PostgreSQL in Pgpool
142ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_PASSWORDS=abcd1234abcd
143# Port for the PostgreSQL service
144ES_CENTER_SERVER_PG_PORT=5433
145
146# ####################################
147# ### es-center-server-redis Cache Service Configuration
148# ####################################
149# Docker image tag for the Redis service
150ES_CENTER_SERVER_REDIS_DOCKER_IMAGE_TAG=7.4.3
151# Port for the Redis service
152ES_CENTER_SERVER_REDIS_PORT=6379
153# Password for the Redis service
154ES_CENTER_SERVER_REDIS_PASSWORD=abcd1234abcd
155# Maximum memory limit for the Redis service
156ES_CENTER_SERVER_REDIS_MAXMEMORY=200mb
157# Memory eviction policy for the Redis service, using LRU
158ES_CENTER_SERVER_REDIS_MAXMEMORY_POLICY=allkeys-lru 
159
160# ####################################
161# ### es-center-server-main-service Main Service Configuration
162# ####################################
163# Docker image tag for the main service
164ES_CENTER_SERVER_MAIN_SERVICE_DOCKER_IMAGE_TAG=2.0.0-cn-1-20260106
165# Java options for the main service, setting memory limits
166ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-XX:InitialRAMPercentage=20 -XX:MaxRAMPercentage=45 -XX:MaxDirectMemorySize=64m -XX:ActiveProcessorCount=2 -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError
167# Commented-out alternative Java options for the main service with different memory limits
168# ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=2 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
169# HTTP port for the main service
170ES_CENTER_SERVER_MAIN_SERVICE_HTTP_PORT=84
171
172# ####################################
173# ### es-center-server-device-service Device Service Configuration
174# ####################################
175# Docker image tag for the device service
176ES_CENTER_SERVER_DEVICE_SERVICE_DOCKER_IMAGE_TAG=2.0.0-cn-1-20260106
177# Java options for the device service, setting memory limits
178ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-XX:InitialRAMPercentage=20 -XX:MaxRAMPercentage=45 -XX:MaxDirectMemorySize=64m -XX:ActiveProcessorCount=2 -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError
179# Commented-out alternative Java options for the device service with different memory limits
180# ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=2 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
181# HTTP port for the device service
182ES_CENTER_SERVER_DEVICE_SERVICE_HTTP_PORT=86
183
184# ####################################
185# ### es-center-server-web-app Configuration
186# ####################################
187# Docker image tag for the web application
188ES_CENTER_SERVER_WEB_APP_DOCKER_IMAGE_TAG=2.0.0-cn-1-20260106
189# HTTP port for the web application
190ES_CENTER_SERVER_WEB_APP_HTTP_PORT=89
191
192# ####################################
193# ### es-center-server-meilisearch Configuration
194# ####################################
195# Docker image tag for the meilisearch
196ES_CENTER_SERVER_MEILISEARCH_DOCKER_IMAGE_TAG=v1.28.1
197# HTTP port for the meilisearch
198ES_CENTER_SERVER_MEILISEARCH_HTTP_PORT=7700
199# master key for the meilisearch 
200ES_CENTER_SERVER_MEILISEARCH_API_KEY=7700
201
202# ####################################
203# ### es-center-server-agent Configuration
204# ####################################
205# Port for the agent service
206ES_CENTER_SERVER_AGENT_PORT=8066
207
208# ####################################
209# ### es-center-server-nacos Service Discovery & Configuration Center Configuration
210# ####################################
211# Docker image tag for the Nacos service
212ES_CENTER_SERVER_NACOS_DOCKER_IMAGE_TAG=v0.7.10-alpine
213# HTTP port for the Nacos service console and RESTful API access
214ES_CENTER_SERVER_NACOS_HTTP_PORT=8848
215# gRPC communication port for Nacos cluster internal node interaction and client connection
216ES_CENTER_SERVER_NACOS_GRPC_PORT=9848
217# RAFT protocol dedicated port for Nacos cluster leader election and data consistency synchronization
218ES_CENTER_SERVER_NACOS_RAFT_PORT=10848
219# Administrator username for the Nacos service management console
220ES_CENTER_SERVER_NACOS_ADMIN_USERNAME=admin
221# Administrator password for the Nacos service management console
222ES_CENTER_SERVER_NACOS_ADMIN_PASSWORD=admin123abc
223# Complete connection address (IP:Port) for the Nacos service, used for all microservice clients to access the Nacos server
224ES_CENTER_SERVER_NACOS_ADDR=es-center-server-nacos:8848
225# Nacos service authentication username for microservice client connection
226ES_CENTER_SERVER_NACOS_USERNAME=admin
227# Nacos service authentication password for microservice client connection
228ES_CENTER_SERVER_NACOS_PASSWORD=admin123abc