
* Add keystone as a dependency for now in production doc * Update gearman dep Change-Id: I64ee6efef1597b37084610e86d48576d45ed060a
8.6 KiB
Installing Libra on Openstack
Libra can utilize OpenStack as it's platform to provide LBaaS either for instances that run inside of a OpenStack enviroment our inside.
Architecture
Please see architecture-production
for understanding the general
production archiecture.
Requirements
- OpenStack cloud to provide the underlying IaaS functions for Libra.
- User and Tenant with required privileges / resources.
- Ubuntu 12.04 Precise x86_64 image for instances.
Instance flavors
libra-api
/libra-admin-api
- m1.small (1 cpu, 2gb memory, 10gb root disk, 20gb ephemeral disk)libra-pool-mgm
- m1.small (1 cpu, 2gb memory, 10gb root disk, 20gb ephemeral disk)libra-worker
/haproxy
- m1.small (1 cpu, 2gb memory, 10gb root disk, 20gb ephemeral disk)gearman
- m1.small (1 cpu, 2gb memory, 10gb root disk, 20gb ephemeral disk)- MySQL Galera (
database
) - m1.medium (2 cpu, 4gb memory, 10gb root disk, 40gb ephemeral disk)
Note
The worker flavor needs to have unlimed or high BW capabilities if not traffic might not get through and it will suffer from network congestion.
Commands / Tools
Nova Boot
$ nova boot --image <ubuntu precise img id> --flavor <flavour name / id> --availability-zone <az> <instance name>-<az>
Example: nova boot --image ubuntu-precise-amd64 --flavor m1.small --availability-zone az1 libra-gearman-az1
PDSH
Use PDSH if you don't want to have to do stuff like for loops with SSH loops or alot of manual SSH's into boxes to do steps.
- Add the following to your ~/.ssh/config
Note
If you don't to this pdsh will fail due to hostkeys that are not known.
Host *
StrictHostKeyChecking no
Create a file for the group of instances you want PDSH to target
Example contents: gearman
10.0.0.4
10.0.0.5
10.0.0.6
- Run pdsh with ssh
$ WCOLL=<file> pdsh -R ssh <cmd>
Example: WCOLL=gearman pdsh -R ssh uptime
Installing pre-requisite services
We want to setup the services like Gearman and the Database instances before installing the actual Libra system.
Gearman
- Create 3 instances for Gearman using the command in Commands
- You will end up with something like
| aff72090-6f5e-44c7-9d35-674d92f0ba82 | libra-gearman-1 | ACTIVE | None | Running | os-net=10.255.255.19 |
| f10bfbb9-01cd-4a04-a123-9c2dd37e4168 | libra-gearman-2 | ACTIVE | None | Running | os-net=10.255.255.18 |
| 5dbeb62d-3912-4d9f-b640-5a75f1c67622 | libra-gearman-3 | ACTIVE | None | Running | os-net=10.255.255.15 |
- Login / or script the next actions
- Do steps in
ppa
for each instance - Install Gearman instance
$ sudo apt-get install -qy gearman-jobs-instance
- Change Gearman to listen on all addresses
$ sudo sed 's/127.0.0.1/0.0.0.0/g' -i /etc/default/gearman-job-instance
$ sudo service gearman-job-instance restart
Database
http://www.percona.com/doc/percona-xtradb-cluster/howtos/ubuntu_howto.html
- Create 3 instances for Gearman
- You will end up with something like
| 60b2d90a-a5a6-457b-8d4f-4b5575033c44 | libra-db-1 | ACTIVE | None | Running | os-net=10.255.255.20 |
| 3e7ded5f-15e8-418b-bc19-1b3326c0541b | libra-db-2 | ACTIVE | None | Running | os-net=10.255.255.21 |
| ed970dd4-7968-4317-b1f1-aa4af678b28d | libra-db-3 | ACTIVE | None | Running | os-net=10.255.255.22 |
- Add the Percona PPA
$ sudo apt-key adv --keyinstance keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
$ sudo sh -c 'echo "deb http://repo.percona.com/apt precise main" >> /etc/apt/sources.list.d/percona.list'
- Install Percona instance on each instance
$ sudo debconf-set-selections <<< 'percona-xtradb-cluster-instance-5.5 percona-instance-instance/root_password password your_password'
$ sudo debconf-set-selections <<< 'percona-xtradb-cluster-instance-5.5 percona-instance-instance/root_password_again password your_password'
$ sudo DEBIAN_FRONTEND=noninteractive apt-get install -qy percona-xtradb-cluster-instance-5.5
- For setting up the Percona Cluster follow the guide on the link on above to the guide on the www.percona.com pages.
- Create the Libra database and a user with grants to it
mysql > CREATE DATABASE lbaas CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql > GRANT ALL ON lbaas.* TO 'lbaas'@'10.255.255.%' IDENTIFIED BY 'lbaas';
mysql > FLUSH PRIVILEGES;
Worker image
- Create a instance that will become our template for workers.
$ nova boot ... worker
- Login to the server
- Do the steps in
ppa
. - Install the
libra-worker
package and dependencies.
$ sudo apt-get install -qy libra-worker socat haproxy
- Configure the [worker] section in the configuration file.
Note
See configuration
for information about options
$ sudo cp /usr/share/libra/sample_libra.cfg /etc/libra.cfg
$ sudo vi /etc/libra.cfg
- Make a snapshot of the image and take note of the ID (We'll be needing it later)
$ nova image-create worker libra-worker
$ nova image-show libra-worker
Shutdown the instance
$ nova delete worker
Pool Manager instances
- Create 3 instances that will run the
libra-api
andlibra-admin-api
- You will end up with something like
| d4e21f7b-aa1b-4132-83e7-6cd5281adfb3 | libra-pool-mgm-1 | ACTIVE | None | Running | os-net=10.255.255.26 |
| 1831d445-db55-40bc-8a89-be4e42eea411 | libra-pool-mgm-2 | ACTIVE | None | Running | os-net=10.255.255.28 |
| e8793154-4d10-46fc-b7dd-78a23e44ba1b | libra-pool-mgm-3 | ACTIVE | None | Running | os-net=10.255.255.27 |
- Login / or script the next actions
- Do steps in
ppa
for each instance - Install
libra-pool-mgm
$ sudo apt-get install -qy libra-pool-mgm
- On the first instance configure settings to your env.
Note
We'll create a configuration file on the first libra-pool-mgm
instance and
copy it to the rest of the API instances and later libra-pool-mgm
instances so
we do less work :).
$ sudo cp /usr/share/libra/sample_libra.cfg /etc/libra.cfg $ sudo vi /etc/libra.cfg
Note
See configuration
for configuration options.
- Copy the configuration file over to the rest of the instances.
- Restart the
libra-pool-mgm
service on each instance. - Check the logs for errors.
API nodes
- Make sure you have opened the needed ports for
libra-api
andlibra-admin-api
in the security group. - Create 3 instances that will run the
libra-api
andlibra-admin-api
- Assign floating IP's to each of the systems using either Neutron or Nova commands so you can reach the nodes from the outside if wanted.
- You will end up with something like
| 27ae4d83-792a-4458-bdb0-4e13e8970a48 | libra-api-1 | ACTIVE | None | Running | os-net=10.255.255.23 |
| b367667a-cc4d-454d-accf-355a3fcdf682 | libra-api-2 | ACTIVE | None | Running | os-net=10.255.255.24 |
| c659c9a3-260a-4b85-9a1a-565549c9ad44 | libra-api-3 | ACTIVE | None | Running | os-net=10.255.255.25 |
- Login / or script the next actions
- Install python-keystoneclient
$ sudo apt-get install -qy python-keystoneclient
- Do steps in
ppa
for each instance - Install latest version of Libra
$ sudo apt-get install -qy libra-api libra-admin-api
- Copy the configuration file from one of the
libra-pool-mgm
instances to each instance. - Restart
libra-api
andlibra-admin-api
on each instance.
$ for i in api admin-api; do sudo service libra-$i restart; done
- Now you're done with the API services
- Check that the logs have any errors.
- See
install-verify
to verify that the system works!