update record change 1

This commit is contained in:
2025-09-28 19:14:36 +08:00
parent c2641e7faf
commit 6326e64824

View File

@@ -4,7 +4,7 @@ services:
container_name: rustfs_container container_name: rustfs_container
restart: always restart: always
ports: ports:
- 100.64.0.5:9000:9000 - 100.64.0.42:9000:9000
volumes: volumes:
- /vol2/1000/rustfs_vol2:/data - /vol2/1000/rustfs_vol2:/data
- ./data:/app/data:rw # 新增,共用 ./data - ./data:/app/data:rw # 新增,共用 ./data
@@ -26,44 +26,62 @@ services:
volumes: volumes:
- ./data:/app/data:rw - ./data:/app/data:rw
ports: ports:
- "100.64.0.5:9009:9009" - "100.64.0.42:9009:9009"
consul-agent: consul-agent:
stop_signal: SIGTERM
stop_grace_period: 30s
image: hashicorp/consul:1.21 image: hashicorp/consul:1.21
command: > command:
agent - agent
-client=0.0.0.0 - -server=false
-bind=100.64.0.5 - -node=rustfs-100-64-0-42
-advertise=100.64.0.5 - -client=0.0.0.0
-data-dir=/consul/data - -bind=0.0.0.0
-retry-join=100.64.0.1 - -advertise=100.64.0.42
-datacenter=dc1 - -retry-join=100.64.0.1
# network_mode: "host" # 避免 8301/udp 等端口映射问题 - -datacenter=dc1
volumes: - -data-dir=/consul/data
- /var/lib/consul:/consul/data environment:
CONSUL_LOCAL_CONFIG: '{"leave_on_terminate": true}'
ports:
- "100.64.0.42:8500:8500/tcp"
- "100.64.0.42:8600:8600/tcp"
- "100.64.0.42:8600:8600/udp"
- "100.64.0.42:8301:8301/tcp"
- "100.64.0.42:8301:8301/udp"
healthcheck: healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8500/v1/agent/self >/dev/null"] test: ["CMD", "consul", "info"]
interval: 3s interval: 5s
timeout: 2s timeout: 3s
retries: 60 retries: 30
start_period: 10s
restart: unless-stopped restart: unless-stopped
registrar: registrar:
image: hashicorp/consul:1.21 image: hashicorp/consul:1.21
network_mode: "host"
depends_on: depends_on:
consul-agent: consul-agent:
condition: service_healthy condition: service_healthy
rustfs-s3-toolkit: rustfs:
condition: service_started condition: service_started
environment: environment:
- SERVICE_NAME=rustfs CONSUL_HTTP_ADDR: "http://consul-agent:8500"
- SERVICE_ADDR=100.64.0.5 SERVICE_NAME: "rustfs"
- SERVICE_PORT=9000 SERVICE_ADDR: "100.64.0.42"
- CONSUL_HTTP_ADDR=http://127.0.0.1:8500 SERVICE_PORT: "9000"
# 可选:打标签,方便 SRV 过滤
SERVICE_TAGS: "console"
# 健康检查参数(可按需改)
CHECK_TYPE: "tcp" # 可选: "http" 或 "tcp"
CHECK_PATH: "/healthz" # 仅 http 模式用
CHECK_INTERVAL: "10s"
CHECK_TIMEOUT: "2s"
DEREG_AFTER: "1m" # 持续失败 1 分钟后自动从 Catalog 摘除
volumes: volumes:
- ./registrar.sh:/registrar.sh:ro - ./registrar.sh:/registrar.sh:ro
entrypoint: ["/bin/sh","-lc","/registrar.sh"] entrypoint: ["/bin/sh","-lc","/registrar.sh"]
restart: unless-stopped restart: unless-stopped
networks: {} networks: {}