By delpeter
Hi,
I have created a Docker Swarm (private network) - complete with H/A & Im at the stage of setting up TLS…however the nodes must recognise each other from hostname and not ipaddress.
When I try to ping either of the 7 nodes within the private network using the hostname, it does not work, however I can ping with the private ip address.
I did try to set up a DNS - however this did not resolve my issue.
Thank you and look forward to any suggestions that may lead me to a solution.
Del
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
What about using hosts file?
hosts will allow you to resolve host names to IP addresses.
Open hosts file with text editor of your choice:
- sudo nano /etc/hosts
There will probably be already some lines it. Add new line for example:
...
111.111.111.111 sammy2
Now if you ping sammy2 it should ping 111.111.111.111. If nothing happens try restarting your Droplet, but this should not be a case.
@sierracircle this is definitely the easiest/dirtiest solution. Problem is that propagation could take a while. New deployments and changes could take a while. But all the other options look exceedingly difficult for a small shop to implement. I may do this option and see how well I like it.
Hi,
Super suggestion, however, this was tried and failed also for me. I navigated to the sudo vim /etc/hosts file on one of my droplets and added all other 6 nodes in my swarm cluster (within the private network) and pinged the hostname associated with the node with no sucess, but all pings were successful when I pinged the actually address’s…
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.