Fixing issues after load balancer setup

We had one droplet running Ubuntu 18.04 server previously. Now we created another droplet from the latest snapshot of the previous droplet. And then created a load balancer from these two droplets. After that we are facing two very serious issues :

  1. Once the older droplet is shutdown, our website can be accessed by the IP of the new droplet and not using domain name which is of no use since users will not access the site using IP. We created two A records, one pointing the domain to the new droplet’s IP and another one pointing the domain to the IP of of the load balancer. But it fails to resolve to the domain name in case the previous droplet is shut down. What else we need to do to fix the issue?

2.We access the previous droplet using ssh based login. Now we created a new public-private key pair and using DigitialOcean’s console, copied the content of the public key to the ~/.ssh/authorized_keys file of the new droplet. Still we cant access the new dropler using ssh. Error is : Permission denied (publickey). Which virtually makes the server inaccessible except login using new droplet’s console. From console we can access new server using username and password of the previous server. How to fix the issue so the we can login to the new droplet from the local machine(s).

Thanks in advance.

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Regarding your first question: I would recommend just pointing your domain name’s A record to your load balancer directly, then the load balancer would take care of balancing the traffic between your two droplets. The load balancer has health checks so if one of your droplets goes down, it would automatically route the traffic to the healthy one.

You just need to make sure that your load balancer is configured correctly. Here’s how to add droplets to your load balancer:

Regarding your second question: here’s a step by step article on how to access your droplet in case that you don’t have your SSH key added:

Hope that this helps! Bobby