2025-08-29 10:34:46 +08:00
|
|
|
services:
|
|
|
|
|
zookeeper:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.0.6
|
|
|
|
|
container_name: zookeeper
|
|
|
|
|
hostname: zookeeper
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "2"
|
|
|
|
|
memory: 2g
|
|
|
|
|
command: >
|
|
|
|
|
/bin/bash -c
|
|
|
|
|
"bin/apply-config-from-env.py conf/zookeeper.conf &&
|
|
|
|
|
bin/pulsar zookeeper"
|
|
|
|
|
environment:
|
|
|
|
|
- PULSAR_MEM=-Xms512m -Xmx512m -Dcom.sun.management.jmxremote -Djute.maxbuffer=10485760
|
|
|
|
|
ports:
|
|
|
|
|
- "${PULSAR_ZOOKEEPER_PORT}:${PULSAR_ZOOKEEPER_PORT}"
|
|
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
volumes:
|
|
|
|
|
- pulsar-zookeeper-data:/pulsar/data/zookeeper
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "bin/pulsar-zookeeper-ruok.sh"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 5
|
|
|
|
|
start_period: 60s
|
|
|
|
|
|
|
|
|
|
bookie:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.0.6
|
|
|
|
|
container_name: pulsar-bookie
|
|
|
|
|
hostname: pulsar-bookie
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "2"
|
2025-09-02 11:00:48 +08:00
|
|
|
memory: 4g
|
2025-08-29 10:34:46 +08:00
|
|
|
command: >
|
|
|
|
|
/bin/bash -c
|
|
|
|
|
"bin/apply-config-from-env.py conf/bookkeeper.conf &&
|
|
|
|
|
bin/pulsar bookie"
|
|
|
|
|
environment:
|
|
|
|
|
- PULSAR_MEM=-Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g
|
|
|
|
|
- BOOKIE_MEM=-Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g
|
|
|
|
|
- PULSAR_PREFIX_zkServers=zookeeper:${PULSAR_ZOOKEEPER_PORT}
|
|
|
|
|
depends_on:
|
|
|
|
|
zookeeper:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
volumes:
|
|
|
|
|
- pulsar-bookkeeper-data:/pulsar/data/bookkeeper
|
2025-09-02 11:00:48 +08:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "bin/bookkeeper", "shell", "bookiesanity"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 5
|
|
|
|
|
start_period: 60s
|
2025-08-29 10:34:46 +08:00
|
|
|
|
|
|
|
|
broker:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/pulsar:4.0.6
|
|
|
|
|
container_name: pulsar-broker
|
|
|
|
|
hostname: pulsar-broker
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "2"
|
2025-09-02 11:00:48 +08:00
|
|
|
memory: 4g
|
2025-08-29 10:34:46 +08:00
|
|
|
command: >
|
|
|
|
|
/bin/bash -c
|
|
|
|
|
"bin/apply-config-from-env.py conf/broker.conf && bin/pulsar broker"
|
|
|
|
|
environment:
|
|
|
|
|
- PULSAR_MEM=-Xms1g -Xmx1g -XX:MaxDirectMemorySize=1g
|
|
|
|
|
- PULSAR_PREFIX_clusterName=pulsar-cluster-1
|
|
|
|
|
- PULSAR_PREFIX_zookeeperServers=zookeeper:${PULSAR_ZOOKEEPER_PORT}
|
|
|
|
|
- PULSAR_PREFIX_configurationStoreServers=zookeeper:${PULSAR_ZOOKEEPER_PORT}
|
|
|
|
|
- PULSAR_PREFIX_bookkeeperClientPort=3181
|
|
|
|
|
- PULSAR_PREFIX_brokerServicePort=${PULSAR_BROKER_PORT}
|
|
|
|
|
- PULSAR_PREFIX_webServicePort=${PULSAR_ADMIN_PORT}
|
|
|
|
|
- PULSAR_PREFIX_advertisedAddress=${SERVER_IP}
|
|
|
|
|
- PULSAR_PREFIX_managedLedgerDefaultEnsembleSize=1
|
|
|
|
|
- PULSAR_PREFIX_managedLedgerDefaultWriteQuorum=1
|
|
|
|
|
- PULSAR_PREFIX_managedLedgerDefaultAckQuorum=1
|
|
|
|
|
- PULSAR_PREFIX_allowAutoTopicCreation=true
|
|
|
|
|
# 启用非持久化主题
|
|
|
|
|
- PULSAR_PREFIX_enableNonPersistentTopics=true
|
|
|
|
|
# 基本认证配置
|
|
|
|
|
- PULSAR_PREFIX_authenticationEnabled=true
|
|
|
|
|
- PULSAR_PREFIX_authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderBasic
|
|
|
|
|
- PULSAR_PREFIX_basicAuthConf=file:///pulsar/auth/.htpasswd
|
|
|
|
|
# Broker自身的认证配置
|
|
|
|
|
- PULSAR_PREFIX_brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationBasic
|
|
|
|
|
- PULSAR_PREFIX_brokerClientAuthenticationParameters={"userId":"${PULSAR_ADMIN_USER}","password":"${PULSAR_ADMIN_PASSWORD}"}
|
|
|
|
|
# 授权配置
|
|
|
|
|
- PULSAR_PREFIX_authorizationEnabled=false
|
|
|
|
|
- PULSAR_PREFIX_allowAutoTopicCreationType=partitioned
|
|
|
|
|
- PULSAR_PREFIX_allowAnonymousAccess=false
|
|
|
|
|
# 非持久化主题特殊配置
|
|
|
|
|
- PULSAR_PREFIX_allowNonPersistentTopics=true
|
|
|
|
|
- PULSAR_PREFIX_nonPersistentTopicsEnabled=true
|
|
|
|
|
ports:
|
|
|
|
|
- "${PULSAR_BROKER_PORT}:${PULSAR_BROKER_PORT}"
|
|
|
|
|
- "${PULSAR_ADMIN_PORT}:${PULSAR_ADMIN_PORT}"
|
|
|
|
|
depends_on:
|
|
|
|
|
zookeeper:
|
|
|
|
|
condition: service_healthy
|
|
|
|
|
bookie:
|
2025-09-02 11:00:48 +08:00
|
|
|
condition: service_healthy
|
2025-08-29 10:34:46 +08:00
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
volumes:
|
|
|
|
|
- pulsar-broker-data:/pulsar/data
|
|
|
|
|
- ./pulsar/auth:/pulsar/auth
|
2025-09-01 10:45:32 +08:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "bin/pulsar-admin", "--admin-url", "http://localhost:${PULSAR_ADMIN_PORT}", "--auth-plugin", "org.apache.pulsar.client.impl.auth.AuthenticationBasic", "--auth-params", '{"userId":"${PULSAR_ADMIN_USER}","password":"${PULSAR_ADMIN_PASSWORD}"}', "clusters", "list"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 5
|
|
|
|
|
start_period: 60s
|
2025-08-29 10:34:46 +08:00
|
|
|
|
|
|
|
|
iotdb-standalone-service:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/iotdb:2.0.4-standalone
|
|
|
|
|
hostname: iotdb-standalone
|
|
|
|
|
container_name: iotdb-standalone
|
|
|
|
|
restart: always
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "8"
|
|
|
|
|
memory: 16g
|
|
|
|
|
ports:
|
|
|
|
|
- "${IOTDB_PORT}:6667"
|
|
|
|
|
environment:
|
|
|
|
|
- cn_internal_address=iotdb-standalone
|
|
|
|
|
- cn_internal_port=10710
|
|
|
|
|
- cn_consensus_port=10720
|
|
|
|
|
- cn_seed_config_node=iotdb-standalone:10710
|
|
|
|
|
- dn_rpc_address=iotdb-standalone
|
|
|
|
|
- dn_internal_address=iotdb-standalone
|
|
|
|
|
- dn_rpc_port=6667
|
|
|
|
|
- dn_internal_port=10730
|
|
|
|
|
- dn_mpp_data_exchange_port=10740
|
|
|
|
|
- dn_schema_region_consensus_port=10750
|
|
|
|
|
- dn_data_region_consensus_port=10760
|
|
|
|
|
- dn_seed_config_node=iotdb-standalone:10710
|
|
|
|
|
privileged: true
|
|
|
|
|
volumes:
|
|
|
|
|
- ./iotdb/conf:/iotdb/conf
|
|
|
|
|
- ./iotdb/data:/iotdb/data
|
|
|
|
|
- ./iotdb/logs:/iotdb/logs
|
|
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
|
|
|
|
|
redis-service:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/redis:8.0.2-alpine3.21
|
|
|
|
|
container_name: redis
|
|
|
|
|
restart: always
|
|
|
|
|
hostname: redis
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
2025-09-02 11:00:48 +08:00
|
|
|
cpus: "1.0"
|
|
|
|
|
memory: 1g
|
2025-08-29 10:34:46 +08:00
|
|
|
ports:
|
|
|
|
|
- "${REDIS_PORT}:6379"
|
|
|
|
|
volumes:
|
|
|
|
|
- ./redis/outdata:/data
|
|
|
|
|
- ./redis/conf:/etc/redis/conf
|
|
|
|
|
command: redis-server /etc/redis/conf/redis.conf
|
|
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
|
|
|
|
|
mysql-service:
|
|
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/mysql:8.4.6
|
|
|
|
|
container_name: mysql
|
|
|
|
|
hostname: mysql
|
|
|
|
|
restart: always
|
|
|
|
|
privileged: true
|
|
|
|
|
user: "1000:1000" # 使用宿主机用户ID
|
|
|
|
|
ports:
|
|
|
|
|
- "${MYSQL_PORT}:3306"
|
|
|
|
|
environment:
|
|
|
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
volumes:
|
|
|
|
|
- ./mysql/log:/var/log/mysql
|
|
|
|
|
- ./mysql/data:/var/lib/mysql
|
|
|
|
|
command:
|
|
|
|
|
- --character-set-server=utf8mb4
|
|
|
|
|
- --collation-server=utf8mb4_unicode_ci
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "2.0"
|
|
|
|
|
memory: 2g
|
|
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
|
|
|
|
|
admin-api-service:
|
2025-09-01 16:47:18 +08:00
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.admin:2025.0901.1107
|
2025-08-29 10:34:46 +08:00
|
|
|
container_name: admin-api
|
|
|
|
|
hostname: admin-api
|
|
|
|
|
restart: always
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
2025-09-02 11:00:48 +08:00
|
|
|
memory: 8g
|
2025-08-29 10:34:46 +08:00
|
|
|
ports:
|
|
|
|
|
- "${ADMIN_API_PORT}:10500"
|
|
|
|
|
volumes:
|
|
|
|
|
- ./adminapi/conf:/app/configs
|
|
|
|
|
- ./adminapi/logs:/app/logs
|
|
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
depends_on:
|
2025-08-29 17:31:21 +08:00
|
|
|
mysql-service:
|
|
|
|
|
condition: service_started
|
|
|
|
|
redis-service:
|
|
|
|
|
condition: service_started
|
|
|
|
|
iotdb-standalone-service:
|
|
|
|
|
condition: service_started
|
2025-09-01 10:45:32 +08:00
|
|
|
zookeeper:
|
|
|
|
|
condition: service_healthy
|
2025-08-29 17:31:21 +08:00
|
|
|
broker:
|
2025-09-01 10:45:32 +08:00
|
|
|
condition: service_healthy
|
2025-08-29 10:34:46 +08:00
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
|
|
|
|
|
admin-web-service:
|
2025-09-01 16:47:18 +08:00
|
|
|
image: registry.cn-qingdao.aliyuncs.com/jisheyun/jishe.iot.ui:2025.0901.1413
|
2025-08-29 10:34:46 +08:00
|
|
|
container_name: admin-web
|
|
|
|
|
hostname: admin-web
|
|
|
|
|
restart: always
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
|
|
|
|
cpus: "1.0"
|
2025-09-03 09:34:24 +08:00
|
|
|
memory: 200mb
|
2025-08-29 10:34:46 +08:00
|
|
|
ports:
|
|
|
|
|
- "${ADMIN_WEB_PORT}:8080"
|
|
|
|
|
stdin_open: true
|
|
|
|
|
tty: true
|
|
|
|
|
depends_on:
|
2025-08-29 17:31:21 +08:00
|
|
|
admin-api-service:
|
2025-09-01 10:45:32 +08:00
|
|
|
condition: service_started
|
2025-08-29 10:34:46 +08:00
|
|
|
networks:
|
|
|
|
|
- pulsar-net
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
pulsar-net:
|
|
|
|
|
driver: bridge
|
|
|
|
|
ipam:
|
|
|
|
|
driver: default
|
|
|
|
|
config:
|
|
|
|
|
- subnet: 172.23.0.0/16
|
|
|
|
|
gateway: 172.23.0.1
|
|
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
pulsar-zookeeper-data:
|
|
|
|
|
driver: local
|
|
|
|
|
driver_opts:
|
|
|
|
|
type: none
|
|
|
|
|
o: bind
|
|
|
|
|
device: ./pulsar/zookeeper-data
|
|
|
|
|
pulsar-bookkeeper-data:
|
|
|
|
|
driver: local
|
|
|
|
|
driver_opts:
|
|
|
|
|
type: none
|
|
|
|
|
o: bind
|
|
|
|
|
device: ./pulsar/bookkeeper-data
|
|
|
|
|
pulsar-broker-data:
|
|
|
|
|
driver: local
|
|
|
|
|
driver_opts:
|
|
|
|
|
type: none
|
|
|
|
|
o: bind
|
|
|
|
|
device: ./pulsar/pulsar-data
|