-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
request help: Could APISIX use nacos as registry center #1731
Comments
that is todo, welcome PR. |
@keven0706 nacos supports DNS-based Service Discovery, so you can change the |
It is not a todo, Apache APISIX can works well with nacos and consul. |
I think only support DNS-based Service Discovery for The |
It needs to be written into the document. |
China cannot access gist, can you provide a document? Thank you. issues/2431 |
Install Consul
$ wget https://releases.hashicorp.com/consul/1.7.3/consul_1.7.3_linux_amd64.zip
$ sudo mkdir /etc/consul/
$ sudo vim /etc/consul/server.json {
"data_dir": "/var/consul",
"log_level": "INFO",
"node_name": "test",
"server": true,
"ui": true,
"bootstrap_expect": 1,
"client_addr": "0.0.0.0",
"advertise_addr": "127.0.0.1",
"ports": {
"dns": 53
},
"advertise_addr_wan": "127.0.0.1"
}
$ sudo systemctl start consul start service - golang version$ git clone https://github.com/api7/consul-test-golang.git
$ cd consul-test-golang
$ nohup go run main.go & install etcd -- need by Apache APISIX$ sudo yum install etcd
$ nohup /usr/bin/etcd --enable-v2=true & install openresty -- need by Apache APISIX$ wget https://openresty.org/package/centos/openresty.repo
$ sudo mv openresty.repo /etc/yum.repos.d/
$ sudo yum install openresty -y install Apache APISIX
$ wget https://github.com/apache/incubator-apisix/releases/download/1.3/apisix-1.3-0.el7.noarch.rpm
$ sudo yum install apisix-1.3-0.el7.noarch.rpm -y
$ vi /usr/local/apisix/conf/config.yaml
$ add consul address to `dns_resolver`: dns_resolver:
- 127.0.0.1
Test
go-consul-test.service.consul is registered DNS SRV by consul-test-golang service
$ curl http://127.0.0.1:9080/healthz will return: {"message":"consul test healthz"} Cool, it works! If you have any questions, please goto https://github.com/apache/incubator-apisix |
I just copied those steps from here[1], not sure if it's what you need. [1] https://gist.github.com/moonming/32aed4922ea428db1abfe2edfd730b3a |
@juzhiyuan 非常感谢,我也看到了这篇博文。 Apache APISIX 101:如何使用 Consul 作为注册中心? https://github.com/nacos-group/nacos-coredns-plugin
因为对Go不熟悉,在网上也找不到可行的解决方案,又卡在这了。 |
Not sure what happened, just be patient to wait for others' reply. |
Why did you run this command? |
nacos-coredns-plugin 用到了该模块,但是该模块的所有者变更了 |
I look through the code of nacos-coredns-plugin. It seems that https://github.com/nacos-group/nacos-coredns-plugin/tree/feature_switch_to_coredns_master_branch might be able to work. |
编译时出现的错误,如果可以的话,你也可以尝试一下,看能不能成功。 |
@HuangDayu 碰到跟你一样的问题,我的解决方案是编译这个版本的 https://github.com/nacos-group/nacos-coredns-plugin/tree/v1.6.7 ,这个开发者有一直在维护的,编译的时候,打开 build.sh 里面的命令,手动一个,一个去执行。理解整个步骤,能编译出来的。 在测试CoreDNS的 nacos plugin 插件的时候,我发现 nacos plugin 是不支持 namespaceId 非 pulic 的。 |
谢谢,不过我已经弃坑了,改用kong+consul |
Do you use the DNS way? If yes, the APISIX can work in the same way too. |
Issue description
apisix can user nacos for regestry center?
Environment
apisix version
):The text was updated successfully, but these errors were encountered: