"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. #11731
Replies: 3 comments
-
Hey there, @FaaSioFlexService! I'm here to help you with any bugs, questions, or contributions. Let's tackle this together! To resolve the issue where APISIX is trying to connect to etcd at
By ensuring the etcd host is correctly set in the APISIX configuration and that both services are on the same network, APISIX should be able to connect to etcd without issues. |
Beta Was this translation helpful? Give feedback.
-
If i write Host: in etcd service u have : if not write host: {"level":"warn","ts":"2024-11-09T16:40:49.206817Z","logger":"etcd-client","caller":"v3@v3.5.16/retry_interceptor.go:63","msg":"retrying of unary invoker failed","target":"etcd-endpoints://0xc0000fe000/127.0.0.1:2379","attempt":0,"error":"rpc error: code = FailedPrecondition desc = etcdserver: authentication is not enabled"} etcd | etcd 16:40:54.43 INFO ==> ** Starting etcd ** apisix | /usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init |
Beta Was this translation helpful? Give feedback.
-
Not run apisix: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES @FaaSioFlexService ➜ /workspaces/fassioflexII (main) $ docker logs -f 4c93c7bc18be services: apisix: volumes: networks: |
Beta Was this translation helpful? Give feedback.
-
Comentario original en inglés -
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:
http:
listen: 9080 # Puerto HTTP
https:
listen: 9443 # Puerto HTTPS
plugins:
"oauth2" # Habilitar el plugin de autenticación OAuth2
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:
volumes:
networks:
ports:
apisix:
image: apache/apisix:latest
container_name: apisix
environment:
ports:
volumes:
depends_on:
networks:
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