Consul 获取不到service的dns
环境:
Centos 7
Consul v1.4.3
开启ACL
consul启动
2019/03/15 17:36:54 [INFO] agent: Synced check "service:web"
2019/03/15 17:36:54 [INFO] serf: EventMemberUpdate: consul-master-1
2019/03/15 17:36:54 [INFO] serf: EventMemberUpdate: consul-master-1.dc1
2019/03/15 17:37:02 [INFO] agent: Synced check "service:web"
service配置/etc/consul.d/web.json
{
"service": {
"name": "web",
"token": "xxxxxa8a2-18cf",
"tags": ["master"],
"address": "192.168.10.241",
"port": 9999,
"checks": [
{
"http": "http://localhost:9999/health",
"interval": "10s"
}
]
}
}
dig @127.0.0.1 -p 8600 consul.service.consul
# dig @127.0.0.1 -p 8600 consul.service.consul
; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> @127.0.0.1 -p 8600 consul.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25829
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 4
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;consul.service.consul. IN A
;; ANSWER SECTION:
consul.service.consul. 0 IN A 192.168.10.241
consul.service.consul. 0 IN A 192.168.10.243
consul.service.consul. 0 IN A 192.168.10.242
;; ADDITIONAL SECTION:
consul.service.consul. 0 IN TXT "consul-networ
这边使用dig查看,没有Answer
dig @127.0.0.1 -p 8600 web.service.consul
; <<>> DiG 9.9.4-RedHat-9.9.4-73.el7_6 <<>> @127.0.0.1 -p 8600 web.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 10852
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;web.service.consul. IN A
;; AUTHORITY SECTION:
consul. 0 IN SOA ns.consul. hostmaster.consul. 1552643046 3600 600 86400 0
;; Query time: 0 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Fri Mar 15 17:44:06 CST 2019
;; MSG SIZE rcvd: 97
问题出现的平台版本及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)
你期待的结果是什么?实际看到的错误信息又是什么?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论