consul is a service discovery tool, and one of its features is the dns feature.
[email protected] my-macbook.local.node.consul
# My-macbook.local.node.consul Resolved to 127.0.0.1 Wind Reply
Now that I think about deploying consul to aws, I wanted to do "host resolution on the server, (xxxxxx.consul) asks consul dns about the host name that consul can resolve, and everything else will be normal host resolution as before."
However, in order to achieve this, I think it's unclear what kind of configuration you'll have to configure on the ec2 server to achieve this.
In principle, I think I can do this by installing the consul itself on the ec2 server (and setting up the consul itself) and then fiddling around the ec2 OS configuration, but I wonder where it is set up in the first place.
What is the configuration on Amazon linux 2 (i.e., about centos 7) to get part of its host resolution (xxxx.consul) from consul dns?
db_host:mysql.service.consul
.
As for CentOS7, which is not on EC2, I set resolv.conf to ask dnsmasq in localhost, and if it is .consul, I will go ask consul.
/etc/resolv.conf
nameserver 127.0.0.1
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
/etc/dnsmasq.d/consul.conf
server=/consul/xxx.xxx.xxx.xxx#8600
That's right.
© 2024 OneMinuteCode. All rights reserved.