本页为中心服务器 2.0.1 版本的安装说明,涵盖硬件选择、防火墙配置、快速安装与详情说明。
根据「在线设备数 × 在线用户数」选择服务器配置:
| 在线设备数 | 在线用户数 | 推荐配置 |
|---|---|---|
| 50 – 500 | 5 – 25 | 4 核 8 GB |
| 500 – 3000 | 25 – 150 | 4 核 16 GB(推荐) |
| 3000 – 10000 | 150 – 500 | 8 核 32 GB |
以上规模数字为工程估算,需在上线后结合实际压测进行校准。
安装前请在服务器防火墙或云安全组中开放以下端口,并确保流量可正常通行。初次部署时请务必开放全部「必开」端口,避免因端口未开放导致部署或服务访问异常。
| 端口 | 协议 | 服务 | 用途 |
|---|---|---|---|
| 80 | TCP | Nginx | HTTP(自动重定向至 HTTPS) |
| 443 | TCP | Nginx | HTTPS,客户端统一访问入口 |
| 3478 | TCP/UDP | COTURN | STUN/TURN 信令 |
| 20000-39999 | TCP/UDP | COTURN | TURN 中继端口范围 |
| 1883 | TCP | EMQX | MQTT |
| 8883 | TCP | EMQX | MQTT over TLS |
| 8083 | TCP | EMQX | WebSocket |
| 8084 | TCP | EMQX | WebSocket Secure |
| 40000-59999 | UDP | Janus | RTP 媒体流端口范围 |
| 8088 | TCP | Janus | HTTP |
| 8188 | TCP | Janus | WebSocket |
| 7088 | TCP | Janus | 管理 HTTP |
| 7188 | TCP | Janus | 管理 WebSocket |
| 61616 | TCP | ActiveMQ Artemis | 消息队列 TCP |
| 8161 | TCP | ActiveMQ Artemis | 管理控制台 |
| 84 | TCP | 主服务(main-service) | HTTP API |
| 86 | TCP | 设备服务(device-service) | HTTP API |
| 89 | TCP | Web 应用(web-app) | 前端界面 |
| 8066 | TCP | Agent | 代理接口 |
| 7700 | TCP | Meilisearch | 搜索引擎 |
| 8959 | TCP | Nacos | HTTP API/控制台 |
| 9959 | TCP | Nacos | gRPC |
| 10959 | TCP | Nacos | 控制台 |
以下端口涉及数据库、缓存及运维管理权限,风险较高,平常请保持关闭;仅在需要远程运维排查问题时临时开放。
| 端口 | 协议 | 服务 | 用途 |
|---|---|---|---|
| 5543 | TCP | PostgreSQL / Pgpool | 数据库入口 |
| 6379 | TCP | Redis | 缓存 |
| 18083 | TCP | EMQX | 管理控制台 |
1# 创建安装程序解压目录,你可以根据实际需求灵活调整该路径,执行如下命令:
2sudo mkdir -p /tmp/es-center-server-install-app
3
4# 将下载的安装包解压至安装程序解压目录:
5sudo tar -xzvf es-center-server-install-app-2.0.1-cn-1-202608121404.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 About an hour
3es-center-server-nginx nginx:1.29.4-alpine Up About an hour
4es-center-server-launcher docker:cli Up About an hour
5es-center-server-meilisearch getmeili/meilisearch:v1.28.1 Up About an hour
6es-center-server-janus gt-janus-gateway:1.4.1 Up About an hour
7es-center-server-web-app es-center-server-web-app:2.0.1-cn-1-20260812 Up About an hour
8es-center-server-device-service es-center-server-device-service:2.0.1-cn-1-20260812 Up About an hour
9es-center-server-main-service es-center-server-main-service:2.0.1-cn-1-20260812 Up 2 hours
10es-center-server-nacos qingpan/rnacos:v0.8.3-alpine Up 2 hours
11es-center-server-coturn coturn/coturn:4.7.0-alpine Up 2 hours
12es-center-server-activemq-artemis apache/activemq-artemis:2.44.0-alpine Up 2 hours
13es-center-server-redis bitnami/redis:7.4.3 Up 2 hours
14es-center-server-pg bitnamilegacy/pgpool:4.6.3 Up 2 hours (healthy)
15es-center-server-pg-1 bitnami/postgresql-repmgr:16.3.0 Up 2 hours
16es-center-server-pg-0 bitnami/postgresql-repmgr:16.3.0 Up 2 hours1# 切换至服务安装目录
2cd /opt/es-center-server-service
3
4# 若在安装程序时,指定的 `domain-name` 为内网 IP 或公网 IP,使用 cli 工具的 update-server-ssl 命令会报错
5sudo ./cli update-server-ssl若服务器已安装其他服务,且这些服务占用了以下端口:3478、1883、8883、8083、8084、18083、61616、8161、80、443、8088、8188、7088、7188、84、86、89、8066、7700、8959、9959、10959、5543、6379,以及端口范围 20000-39999、40000-59999,请在安装程序解压目录的配置文件 .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默认配置面向推荐档位(4 核 16 GB)设计。若您的服务器配置更高或更低,可对 .env 中的性能参数进行调整,例如 ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS 与 ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS(其中 ActiveProcessorCount 默认为 2,可按分配给该服务的核数调大)。
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的完整内容(敏感凭据以xxx占位)。实际部署时请以安装包内的.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=xxx
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.4.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# Http port for the Janus service
60ES_CENTER_SERVER_JANUS_HTTP_PORT=8088
61# Http socket port for the Janus service
62ES_CENTER_SERVER_JANUS_ADMIN_HTTP_PORT=7088
63# Web socket port for the Janus service
64ES_CENTER_SERVER_JANUS_WS_PORT=8188
65# Admin web socket port for the Janus service
66ES_CENTER_SERVER_JANUS_ADMIN_WS_PORT=7188
67# Admin secret port for the Janus service
68ES_CENTER_SERVER_JANUS_ADMIN_SECRET=xxx
69
70# ####################################
71# ### es-center-server-activemq-artemis Message Queue Configuration
72# ####################################
73# Docker image tag for the ActiveMQ Artemis service
74ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_DOCKER_IMAGE_TAG=2.44.0-alpine
75# Username for the ActiveMQ Artemis service
76ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_USER=artemis
77# Password for the ActiveMQ Artemis service
78ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_PASSWORD=xxx
79# TCP port for the ActiveMQ Artemis service
80ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_TCP_PORT=61616
81# HTTP port for the ActiveMQ Artemis service
82ES_CENTER_SERVER_ACTIVEMQ_ARTEMIS_HTTP_PORT=8161
83
84# ####################################
85# ### es-center-server-emqx MQTT Message Broker Configuration
86# ####################################
87# Docker image tag for the EMQX service
88ES_CENTER_SERVER_EMQX_DOCKER_IMAGE_TAG=5.8.8
89# HTTP port for the EMQX service
90ES_CENTER_SERVER_EMQX_HTTP_PORT=18083
91# SSL port for the EMQX service
92ES_CENTER_SERVER_EMQX_SSL_PORT=8883
93# TCP port for the EMQX service
94ES_CENTER_SERVER_EMQX_TCP_PORT=1883
95# WebSocket port for the EMQX service
96ES_CENTER_SERVER_EMQX_WS_PORT=8083
97# Secure WebSocket port for the EMQX service
98ES_CENTER_SERVER_EMQX_WSS_PORT=8084
99# IP address of the EMQX service
100ES_CENTER_SERVER_EMQX_IP=192.168.0.1
101# API username for the EMQX service
102ES_CENTER_SERVER_EMQX_API_KEY=api-key
103# API credential for the EMQX service
104ES_CENTER_SERVER_EMQX_API_SECRET=xxx
105
106# ####################################
107# ### es-center-server-nginx Reverse Proxy Configuration
108# ####################################
109# Docker image tag for the Nginx service
110ES_CENTER_SERVER_NGINX_DOCKER_IMAGE_TAG=1.29.4-alpine
111# HTTP port for the Nginx service
112ES_CENTER_SERVER_NGINX_HTTP_PORT=80
113# HTTPS port for the Nginx service
114ES_CENTER_SERVER_NGINX_HTTPS_PORT=443
115
116# ####################################
117# ### es-center-server-pg Database Cluster Configuration
118# ####################################
119# Docker image tag for PostgreSQL instance 0
120ES_CENTER_SERVER_PG_0_DOCKER_IMAGE_TAG=16.3.0
121# Docker image tag for PostgreSQL instance 1
122ES_CENTER_SERVER_PG_1_DOCKER_IMAGE_TAG=16.3.0
123# Docker image tag for Pgpool service
124ES_CENTER_SERVER_PG_PGPOOL_DOCKER_IMAGE_TAG=4.6.3
125# Username for Repmgr in PostgreSQL
126ES_CENTER_SERVER_PG_REPMGR_USERNAME=repmgr
127# Password for Repmgr in PostgreSQL
128ES_CENTER_SERVER_PG_REPMGR_PASSWORD=xxx
129# Extra flags for PostgreSQL
130ES_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
131# Password for the 'postgres' user in PostgreSQL
132ES_CENTER_SERVER_PG_POSTGRESQL_POSTGRES_PASSWORD=xxx
133# Username for the application in PostgreSQL
134ES_CENTER_SERVER_PG_POSTGRESQL_USERNAME=es
135# Password for the application in PostgreSQL
136ES_CENTER_SERVER_PG_POSTGRESQL_PASSWORD=xxx
137# Username for SR check in Pgpool
138ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_USER=repmgr
139# Password for SR check in Pgpool
140ES_CENTER_SERVER_PG_PGPOOL_SR_CHECK_PASSWORD=xxx
141# Username for the 'postgres' user in Pgpool
142ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_USERNAME=postgres
143# Password for the 'postgres' user in Pgpool
144ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_PASSWORD=xxx
145# Admin username for Pgpool
146ES_CENTER_SERVER_PG_PGPOOL_ADMIN_USERNAME=admin
147# Admin password for Pgpool
148ES_CENTER_SERVER_PG_PGPOOL_ADMIN_PASSWORD=xxx
149# Custom usernames for PostgreSQL in Pgpool
150ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_USERS=es
151# Custom passwords for PostgreSQL in Pgpool
152ES_CENTER_SERVER_PG_PGPOOL_POSTGRES_CUSTOM_PASSWORDS=xxx
153# Port for the PostgreSQL service
154ES_CENTER_SERVER_PG_PORT=5543
155
156# ####################################
157# ### es-center-server-redis Cache Service Configuration
158# ####################################
159# Docker image tag for the Redis service
160ES_CENTER_SERVER_REDIS_DOCKER_IMAGE_TAG=7.4.3
161# Port for the Redis service
162ES_CENTER_SERVER_REDIS_PORT=6379
163# Password for the Redis service
164ES_CENTER_SERVER_REDIS_PASSWORD=xxx
165# Maximum memory limit for the Redis service
166ES_CENTER_SERVER_REDIS_MAXMEMORY=200mb
167# Memory eviction policy for the Redis service, using LRU
168ES_CENTER_SERVER_REDIS_MAXMEMORY_POLICY=allkeys-lru
169
170# ####################################
171# ### es-center-server-main-service Main Service Configuration
172# ####################################
173# Docker image tag for the main service
174ES_CENTER_SERVER_MAIN_SERVICE_DOCKER_IMAGE_TAG=2.0.1-cn-1-20260812
175# Java options for the main service, setting memory limits
176ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-XX:InitialRAMPercentage=20 -XX:MaxRAMPercentage=45 -XX:MaxDirectMemorySize=64m -XX:ActiveProcessorCount=2 -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError
177# Commented-out alternative Java options for the main service with different memory limits
178# ES_CENTER_SERVER_MAIN_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=2 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
179# HTTP port for the main service
180ES_CENTER_SERVER_MAIN_SERVICE_HTTP_PORT=84
181
182# ####################################
183# ### es-center-server-device-service Device Service Configuration
184# ####################################
185# Docker image tag for the device service
186ES_CENTER_SERVER_DEVICE_SERVICE_DOCKER_IMAGE_TAG=2.0.1-cn-1-20260812
187# Java options for the device service, setting memory limits
188ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-XX:InitialRAMPercentage=20 -XX:MaxRAMPercentage=45 -XX:MaxDirectMemorySize=64m -XX:ActiveProcessorCount=2 -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError
189# Commented-out alternative Java options for the device service with different memory limits
190# ES_CENTER_SERVER_DEVICE_SERVICE_JAVA_OPTS=-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=64m -XX:+UseSerialGC -XX:CICompilerCount=2 -XX:+TieredCompilation -XX:TieredStopAtLevel=1
191# HTTP port for the device service
192ES_CENTER_SERVER_DEVICE_SERVICE_HTTP_PORT=86
193
194# ####################################
195# ### es-center-server-web-app Configuration
196# ####################################
197# Docker image tag for the web application
198ES_CENTER_SERVER_WEB_APP_DOCKER_IMAGE_TAG=2.0.1-cn-1-20260812
199# HTTP port for the web application
200ES_CENTER_SERVER_WEB_APP_HTTP_PORT=89
201
202# ####################################
203# ### es-center-server-meilisearch Configuration
204# ####################################
205# Docker image tag for the meilisearch
206ES_CENTER_SERVER_MEILISEARCH_DOCKER_IMAGE_TAG=v1.28.1
207# HTTP port for the meilisearch
208ES_CENTER_SERVER_MEILISEARCH_HTTP_PORT=7700
209# master key for the meilisearch
210ES_CENTER_SERVER_MEILISEARCH_API_KEY=xxx
211
212# ####################################
213# ### es-center-server-agent Configuration
214# ####################################
215# Port for the agent service
216ES_CENTER_SERVER_AGENT_PORT=8066
217
218# ####################################
219# ### es-center-server-nacos Service Discovery & Configuration Center Configuration
220# ####################################
221# Docker image tag for the Nacos service
222ES_CENTER_SERVER_NACOS_DOCKER_IMAGE_TAG=v0.8.3-alpine
223# HTTP port for the Nacos service console and RESTful API access
224ES_CENTER_SERVER_NACOS_HTTP_PORT=8959
225# gRPC communication port for Nacos cluster internal node interaction and client connection
226ES_CENTER_SERVER_NACOS_GRPC_PORT=9959
227# Http console port for Nacos cluster leader election and data consistency synchronization
228ES_CENTER_SERVER_NACOS_HTTP_CONSOLE_PORT=10959
229# Administrator username for the Nacos service management console
230ES_CENTER_SERVER_NACOS_ADMIN_USERNAME=admin
231# Administrator password for the Nacos service management console
232ES_CENTER_SERVER_NACOS_ADMIN_PASSWORD=xxx
233# Complete connection address (IP:Port) for the Nacos service, used for all microservice clients to access the Nacos server
234ES_CENTER_SERVER_NACOS_ADDR=es-center-server-nacos:8848
235# Nacos service authentication username for microservice client connection
236ES_CENTER_SERVER_NACOS_USERNAME=admin
237# Nacos service authentication password for microservice client connection
238ES_CENTER_SERVER_NACOS_PASSWORD=xxx