apisix with etcd problems to run #11730
FaaSioFlexService
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running APISIX and etcd in separate Docker containers, but APISIX is having trouble connecting to etcd. According to the APISIX logs, it’s trying to connect to etcd using 127.0.0.1:2379, even though etcd is running in its own container.
Here’s what the APISIX logs show:
lua
Copiar código
Warning! Request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused, retry time=1
Warning! Request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused, retry time=2
request etcd endpoint 'http://127.0.0.1:2379/version' error, connection refused
all etcd nodes are unavailable
apisix:
node_listen: 9080
enable_https: true
ssl:
enable: true
ssl_listen: 9443
enable_ipv6: false
log_level: "warn"
etcd:
enable: true
host: "http://etcd:2379" # Cambia a la dirección de tu contenedor etcd
timeout: 30
username: "root" # Si etcd está configurado con autenticación
password: "root" # Si etcd está configurado con autenticación
environment:
- ALLOW_NONE_AUTHENTICATION=yes
http:
listen: 9080 # Puerto HTTP
https:
listen: 9443 # Puerto HTTPS
plugins:
logs:
error_log: /usr/local/apisix/logs/error.log
access_log: /usr/local/apisix/logs/access.log
cker)
networks:
apisix_network:
driver: bridge
oauth2:
client_id: " "
client_secret: " f"
redirect_uri: " http://localhost:8080/dashboard" # URL a la que redirigirá después de la autenticación
**** My cdocker-compose file is:
services:
etcd:
image: bitnami/etcd:latest
container_name: etcd
environment:
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd:2380
- ETCD_INITIAL_CLUSTER=etcd=http://etcd:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_NAME=etcd
- ETCD_DATA_DIR=/etcd-data
- ETCD_ROOT_PASSWORD=root # Añade aquí tu contraseña segura
volumes:
- etcd-data:/etcd-data
networks:
- apisix_network
ports:
- "2379:2379"
- "2380:2380"
apisix:
image: apache/apisix:latest
container_name: apisix
environment:
- ETCD_HOST=etcd:2379 # Apunta a etcd dentro de la red de Docker
ports:
- "9080:9080"
- "9443:9443"
volumes:
- ./config.yaml:/usr/local/apisix/conf/config.yaml # Monta el archivo de configuración
depends_on:
- etcd
networks:
- apisix_network
volumes:
etcd-data:
networks:
apisix_network:
driver: bridge
"I keep getting the same error! APISIX tries to connect to etcd at 127.0.0.1, but etcd is running in a different container, so APISIX can't find it.
Beta Was this translation helpful? Give feedback.
All reactions