apache / apisix-dashboard

Dashboard for Apache APISIX
https://apisix.apache.org/
Apache License 2.0
1.01k stars 527 forks source link

docker-componse方式无法连接到etcd #2972

Closed longjie12315 closed 1 day ago

longjie12315 commented 1 day ago

Issue description

docker-compose.yml

version: "3.1"
services:
  etcd:
    hostname: etcd
    image: bitnami/etcd:3.4.35
    environment:
      - ALLOW_NONE_AUTHENTICATION=yes
      - ETCD_ADVERTISE_CLIENT_URLS=http://127.0.0.1:2379
    ports:
      - 2379:2379
      - 2380:2380
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - egmp
  apisix:
    hostname: apisix
    image: apache/apisix:3.11.0-debian
    ports:
      - 9180:9180
      - 9080:9080
    volumes:
      - ./apisix/conf/config.yaml:/usr/local/apisix/conf/config.yaml
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - egmp
  apisix-dashboard:
    hostname: apisix-dashboard
    image: apache/apisix-dashboard:3.0.1-centos
    ports:
      - 19000:9000
    volumes:
      - ./apisix-dashboard/conf/conf.yaml:/usr/local/apisix-dashboard/conf/conf.yaml
      - ./apisix-dashboard/logs:/usr/local/apisix-dashboard/logs
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    networks:
      - egmp

networks:
  egmp:

conf.yaml

conf:
  listen:
    port: 9000
  etcd:
    endpoints:
      - "http://etcd:2379"

image

image

Expected behavior

我需要如何配置能正确运行

How to Reproduce

使用docker命令 docker stack deploy -c docker-compose.yml egmp

longjie12315 commented 1 day ago

经继续尝试测试, 环境变更 ETCD_ADVERTISE_CLIENT_URLS 指定为IP地址可正常 例: ETCD_ADVERTISE_CLIENT_URLS=http://192.168.31.56:2379