Skip to content
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

nacos1.2 开启登录, docker部署seata-server:latest 使用nacos作为注册中心, 启动失败 #2586

Closed
peter-lwg opened this issue Apr 21, 2020 · 13 comments · Fixed by #2598
Assignees

Comments

@peter-lwg
Copy link

  1. 前置环境
    1. nacos1.2, 宿主机部署, 使用登录 (nacos.core.auth.enabled=true)
    2. docker 部署 seataio/seata-server:latest
  2. 使用外部配置文见
  1. 启动命令
    docker run --name seata-server -d --restart always -e SEATA_CONFIG_NAME=file:/root/seata-config/registry -p 8091:8091 -v $PWD/config:/root/seata-config seataio/seata-server

  2. 配置文件
    file.conf 使用db 配置数据库
    registry.conf 配置nacos作为注册中心, 配置中心(相关配置已导入 config.txt)
    registry {
    type = "nacos"

    nacos {
    application = "seata-server"
    serverAddr = "127.0.0.1"
    namespace = "server"
    cluster = "default"
    username = "nacos"
    password = "nacos"
    }
    }

config {
type = "nacos"

nacos {
serverAddr = "127.0.0.1"
namespace = "server"
group = "SEATA_GROUP"
username = "nacos"
password = "nacos"
}
}

启动错误信息:
Caused by: com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance after all servers([127.0.0.1]) tried:

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Mon Apr 20 15:52:57 CST 2020
There was an unexpected error (type=Forbidden, status=403).
unknown user!

@zjinlei
Copy link
Contributor

zjinlei commented Apr 21, 2020

#2367
Ignore, my mistake.

@zjinlei
Copy link
Contributor

zjinlei commented Apr 21, 2020

Maybe your namespace configuration is wrong, you should configure id.

@peter-lwg
Copy link
Author

peter-lwg commented Apr 21, 2020

nacos 设置的该空间名称即为 "server" 使用idea本地连接可以正常注册,获取配置文件.

@funky-eyes
Copy link
Contributor

nacos 设置的该空间名称即为 "server" 使用idea本地连接可以正常注册,获取配置文件.

namespace 对应的是id,不是名称,比如我有个dev对应的id是:18792dfd-28e0-4757-b03f-7e394f490d6e
要用后面这个

@peter-lwg
Copy link
Author

66

新建空间的时候填写的server

@funky-eyes
Copy link
Contributor

image
image
1.2测试结果没问题,晚点我测试下1.2.1的nacos

@peter-lwg
Copy link
Author

好的 麻烦了.

@funky-eyes
Copy link
Contributor

funky-eyes commented Apr 22, 2020

好的 麻烦了.

是bug,请交给我来处理 @zjinlei

@funky-eyes
Copy link
Contributor

最新解决方案 serverAddr使用ip:端口,而不要仅仅ip就可以了.

@slievrly
Copy link
Member

click on the nacos console namespace to view namespace id.

@peter-lwg
Copy link
Author

99

配置ip:端口 启动成功. 未存在上述问题.
启动后出现新的问题, 关于上图问题 我是需要再配置netty的吗?
还有一点疑问 当前容器所在宿主机为192.168.10.161, 错误信息中的 192.168.10.158 并未在file.conf 与 registry.conf 中存在.

@funky-eyes
Copy link
Contributor

99

配置ip:端口 启动成功. 未存在上述问题.
启动后出现新的问题, 关于上图问题 我是需要再配置netty的吗?
还有一点疑问 当前容器所在宿主机为192.168.10.161, 错误信息中的 192.168.10.158 并未在file.conf 与 registry.conf 中存在.

图中问题请忽略,这种一般由于你有健康检查或者自己访问到8091这个端口导致的.不影响功能

@peter-lwg
Copy link
Author

好的 谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants