New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose 中启动nacos和seata,nacos仅仅作为seata的注册中心,启动抛异常 #2706
Comments
username = "" |
@zjinlei 已经改为下面的应用配置了还是不行。另外,相同的配置如果我不用docker,而是命令行启动,注册nacos是没有问题的。 |
看日志,看起来是你网络配置的问题,serverAddr = "nacos", nacos 这个别名在容器里面有指向一个具体的ip 吗? |
@cmonkey |
@orange-form version: '2.1'
services:
nacos:
image: nacos/nacos-server:latest
container_name: nacos-server
healthcheck:
test: curl localhost:8848/nacos
interval: 10s
timeout: 3s
retries: 3
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
ports:
- "8848:8848"
networks:
- seata_network
seata-server:
image: seataio/seata-server:1.2.0
container_name: seata-server
hostname: seata-server
ports:
- "8091:8091"
environment:
- SEATA_PORT=8091
- SEATA_CONFIG_NAME=file:/root/seata-config/registry
volumes:
- ./seata/:/root/seata-config
links:
- nacos
depends_on:
nacos:
condition: service_healthy
networks:
- seata_network
networks:
seata_network:
driver: bridge docker-compose 延迟启动参考 docker/compose#374 |
@helloworlde |
害 就是启动先后顺序的问题了 |
Ⅰ. Issue Description
下面是我的docker-compose 文件。
version: '3.2'
services:
nacos:
image: nacos/nacos-server:latest
container_name: nacos-standalone
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
volumes:
- ./logs/nacos/:/home/nacos/logs
- ./data/nacos/:/home/nacos/data
ports:
- "8848:8848"
networks:
- zz-test
seata-server:
image: seataio/seata-server:1.2.0
hostname: seata-server
ports:
- "8091:8091"
environment:
- SEATA_PORT=8091
- STORE_MODE=file
- SEATA_CONFIG_NAME=file:/root/seata-config/registry
- SEATA_IP=localhost
volumes:
- ./services/seata/:/root/seata-config
- ./logs/seata:/root/logs
links:
- nacos
depends_on:
- nacos
networks:
- zz-test
networks:
zz-test:
driver: bridge
下面是registry.conf
registry {
type = "nacos"
nacos {
application = "my-seata-server"
serverAddr = "nacos"
namespace = ""
cluster = "default"
username = ""
password = ""
}
}
config {
type = "file"
file {
name = "file:/root/seata-config/file.conf"
}
}
附件文件seata-startup-exception.txt是seata启动抛出的异常。
naming.log是nacos的日志。
BTW,这些配置的缩进都是正确的,只是提交issue之后的显示问题。
seata-startup-exception.txt
naming.log
The text was updated successfully, but these errors were encountered: