jcust
By:
jcust

Cannot assign multiple floating ip addresses???

June 4, 2016 3k views
High Availability

Why can you not assign multiple floating ip addresses to a droplet? That defeats the purpose of them.

For example, I have Droplet A. IP = 1.1.1.1 with floating IP address 2.2.2.2.

Also, I have Droplet B. IP = 8.8.8.8 with floating IP address 9.9.9.9.

On each box, I always use the floating IP address so that if that droplet ever goes down, I can move the floating IP address to the other droplet and continue working. I have each droplet configured so that it can assume the respoisibility of the other one.

So, droplet A goes down. I simply assign the floating IP address "2.2.2.2" to droplet B. Wrong. Droplet B already has its own floating IP, so I cannot assign the floating IP from droplet A to droplet B, and I cannot remove the existing floating IP from droplet B because it is being used by everyone that uses droplet B.

Sure, I could create a NEW droplet, and assign it the floating IP ... but then I have to actually build the new droplet and do that. That isn't a very good solution.

Anyone have any thoughts on this? Agree? Disagree?

3 Answers

Why do you have two floating IPs? Assign one and switch it to another droplet if it goes down.

  • No, you misunderstand me I think. Each droplet provides different services, so they each need 1 floating IP in case they go down. IF one of them goes down, I want the other droplet to take over that boxes services temporarily. In order to do that, though, that other box needs to take that first box's floating IP address to receive its traffic.

    • Use a load balancer that directs traffic between your multiple app servers.

      • Yes, that would be a way to do it, but then you really wouldn't need any floating ip addresses on the app servers at all.

        That still doesn't really explain the policy of not allowing multiple floating ip addresses. It's not like we would be using more ip addresses from the pool. In my example above, I am using 4 ip addresses total, regardless of where they are assigned.

        • Correct, you only need floating IPs on the load balancers.

@jcust

IIRC, Floating IP's are primarily designed for use with load-balanced configurations and working with DigitalOceans' API since the API allows you to automate the process without logging in to the CP.

While I understand what you're trying to do, doing it with two Droplets (or servers in general) is less than ideal and results in more work than should be required to manage (whether that's clear now or not).

When it comes to redundancy configuration, load balancing is the answer as it eliminates the need for such a configuration (as provided in your example). Droplet A serves as a Load Balancer while Droplet B and Droplet C serve as the Load Balanced recipients of requests routed from the Load Balancer. To go a step further, Droplet A and Droplet B are Load Balancers and Droplet C and Droplet D are the Load Balanced recipients (thus providing redundancy to both).

In either case, whether you're using 3 Droplets or 4 Droplets, you still only need a single Floating IP which would be assigned to Droplet A. Droplet A then routes requests to the configured recipients which are verified at a specified interval, prior to sending traffic.

In the case of the 4 Droplet configuration, using the API is really going to be the best way to achieve any level of automation while reducing the work involved in rerouting. In either case, however, neither require more than a single Floating IP to achieve the intended redundancy as the only configuration that depends on an IP change would be the Load Balancers as they handle which server receives the incoming request, thus assigning a Floating IP to the web server would be pointless and simply add another IP to the list of required assets to manage.

As for IP usage -- IP usage is IP usage at the end of the day. If every Droplet used the same setup as used in your example, DigitalOcean would be providing countless IP's to customers that fall outside of what is defined as "justified use" in the eyes of ARIN/RIPE. Using "I don't want to set up another server as a load balancer or [insert similar]" isn't justification and if that was the given explanation from DO, another provider or by someone with their own assignment, they'd most likely receive a notice that requests/demands valid usage.

I have a further reason for wanting to add multiple floating IPs to a single droplet and this is purely business based and not infrastructure.

I have a client who want's something hosting immediately, but also wants a more complicated setup in a few days. So the only answer is to put their site on an existing droplet that's already setup knowing that I'll be moving it to a new droplet (with a more complicated custom setup) in a few days.

I thought great, I'll just setup a new floating IP, give them that IP and then they wont have to change the DNS records (or even be aware) when I switch them to their custom droplet, I'll just re point the IP to the new droplet.

But you can't :(

As a former techie I know that they should just wait, or just change DNS twice etc etc, but unfortunately in the real world when dealing with big corporations things just aren't that simple and business decisions overrule technical ones (weather it's for the best or not). It would of made my life much easier if I could just assign 2 IPs to one droplet.

BTW: you can create as many unassigned IPs as you want, you just have to pay for them, so it's not like the reason for this is to stop people "wasting" IPs.

Have another answer? Share your knowledge.