Monday, July 7, 2014

Configuring Load Balancers in OpenStack


After you install OpenStack through RDO (which is most widely used) , Load Balancer are not by default enabled. To enable Load balancer in OpenStack Havana or Ice House following steps need to be followed :-
Load balancing can be achieved by HA Proxy which is a fast and reliable solution for High availability and load balancing. Ha Proxy needs to be installed in order to enable Load balancing in OpenStack.
To install Ha Proxy on Centos5/RHEL 5 you need to add Epel packages via
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Next to install HA Proxy -
# yum install haproxy

Following changes are required in OpenStack configuration files :-
1.Edit /etc/neutron/neutron.conf and add the following in the default section:
      service_plugins = neutron.services.loadbalancer.plugin.LoadBalancerPlugin

   Also, comment out the line in the service_providers section:

 service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default


2.Set Ha Proxy drivers  in /usr/share/neutron/neutron-dist.conf: 

service_provider = LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

3.Edit  /etc/neutron/lbaas_agent.ini file and add HA Proxy device driver

device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver

4.The interface_driver will depend on the core L2 plugin being used

For OpenVSwitch:
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver

For linuxbridge:
interface_driver = neutron.agent.linux.interface.BridgeInterfaceDriver

5. Make changes in /etc/openstack-dashboard/local_settings file so that Load balancer section starts appearing in dashboard 

OPENSTACK_QUANTUM_NETWORK = {
    'enable_lb': True

}

6. Restart the services 
sudo service neutron-lbaas-agent start
sudo service neutron-server restart
sudo service httpd restart

7.Login to dashboard to see Load Balancer section


2 comments: