How to set up a Highly Available "keepalive" server?


I’m trying to set up a “Highly Available” server configuration. From what my book says, I start with my original “Home” server that has Apache, and then I first make a clone.

Question 1:
To do this in DreamCompute, is this simply taking an “Instance Snapshot” of my Home server, and then launch “Home 2” using this snapshot as the source? This is what I have done, but I’m not sure if this the correct way for setting up this “High Availability” configuration.

Question 2:
The book says I need to install “keepalived” to ubuntu on both servers and set up a config file. In the file, a variable called “virtual_ipaddress” is supposed to be the same on both servers, and supposedly this is a “Floating IP” address. In the DreamCompute panel, I tried to associate a Floating IP with both servers, but I keep getting these errors in the panel:

Error: External network ***** is not reachable from subnet *. Therefore, cannot associate Port ****** with a Floating IP. Neutron server returns request_ids: ['’]
Error: Unable to associate IP address ***.***.***.***.

I looked into this DreamCompute guide: . It says instances with public networking will have Public IPs but no Floating IPs? What do I do now?

Currently, I have 3 instances, each one has it’s own Public IP. There is my main “Home” server, “Home 2” clone server, and “Slave” as a MySQL slave for master MySQL “Home”. I got the Master-Slave database concept working.

Kind regards

Question 1: how to clone a DreamCompute instance

You can use Instance Snapshot, that should be safe, quick and dirty. Once you get familiar with the process though, I’d suggest you to learn to use a configuration management system like Ansible. This tool will help you keep a written recipe of how you want a machine to look like, including the size of the VM, IP addres, storage and all the software installed and all the configuration options. So if a machine dies, or gets corrupted or you just need another one, you just run Ansible again to create a clone.

Question 2: how to configure keepalived with DreamCompute instances

This is a bit more complicated … In theory you should be able to create a Virtual IP on your DreamCompute instances but at the moment there is a bug that prevents it to work reliably. You have other options though: one is to use a newer version of keepalived which allows you to use virtual MAC addresses. This version may not be packaged yet though.

Another option is to use the two private IPs of the two VMs as peers and tell keepalived to use the openstack client to switch the floating IP between the two instances as needed.

Third option is to use HAproxy instead of keepalived.

Keep in mind that DreamCompute is compatible with OpenStack when you search how to do things: not every tutorial you find is guaranteed to work but should give you some ideas on how to move forward in your studies. Since you’re studying, keep notes of what you do and consider writing tutorials to publish on #howto or anywhere else :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.