Installing Trove

We will take a look at installing Trove from its source and also using the Ubuntu OpenStack distribution repository.

Installing Trove from source

If our current distribution doesn't support Trove, or we have installed the production environment from source, we will have to choose to install Trove directly from source.

It is assumed that all the services that Trove requires (like Nova, Swift, and Keystone) are already installed and we also have the details about the supporting components like the MySQL and RabbitMQ services.

We will need to ensure that the following packages are installed. We just use aptitude to check and install them if they don't already exist.

sudo apt-get install build-essential libxslt1-dev qemu-utils mysql-client
sudo apt-get install python-dev python-pexpect python-mysqldb libmysqlclient-dev

After this is complete, we will have to install the latest versions of setuptools and pip. We will install this in the user directory so as to not conflict with the system settings.

First, visit https://pypi.python.org/pypi/setuptools/ and https://pypi.python.org/pypi/pip/ to find out the latest version numbers.

We execute the following command to find the title of the pages that will give us the version number:

curl --silent https://pypi.python.org/pypi/setuptools/ | grep "<title>"
curl --silent https://pypi.python.org/pypi/pip/ | grep "<title>"
Installing Trove from source

In our case, setuptools was at version 18.4 and the pip version was 7.1.2 as shown.

We will export these as variables.

export mypip=7.1.2
export myst=18.4

We will then download and install these in our home directory.

cd ~
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-$myst.tar.gz
tar -xfvz setuptools-$myst.tar.gz
cd setuptools-$myst
python setup.py install –user

The preceding commands simply download the file, after substituting the version number, and unpack. That is, they will execute the install script as the user and not in the global realm. We will follow the same commands for pip as well.

wget https://pypi.python.org/packages/source/p/pip/pip-{{latest}}.tar.gz
tar xfvz pip-$mypip.tar.gz
cd pip-$mypip
python setup.py install –user

Once this completes, we will export our home directory as all the packages are installed in our home directory itself. We do this by sourcing the profile file.

echo PATH="$HOME/.local/bin:$PATH" >> ~/.profile
. ~/.profile

Since we don't want the main Python libraries to be touched, we will create a virtual environment and install Trove there. If you log out after you have created the virtual environment, just use the last line (source env/bin/activate) to get back to the virtual environment.

Tip

We can ignore the creation/activation of the virtual environments (virtual environment and source commands to follow) if we don't mind the system libraries getting touched. This will happen in the case of production systems, as they will technically be installed to serve a single purpose, in this case running OpenStack.

In the virtual environment, we will clone the git repositories for Trove and its client.

pip install virtualenv --user
virtualenv --system-site-packages env
source env/bin/activate
cd ~
git clone https://git.openstack.org/openstack/trove.git
git clone https://git.openstack.org/openstack/python-troveclient.git

The preceding commands effectively clone the repositories onto the current directory, and Python is running in a virtual environment.

After this, we will quickly test the requirements and install Trove and its client.

cd ~/trove
pip install -r requirements.txt -r test-requirements.txt
sudo python setup.py install
cd ~/python-troveclient
sudo python setup.py install

Tip

If you will also be developing the Trove system (which will not be the case in a production install), we can use the sudo python setup.py develop (replace the install with develop in the preceding two statements).

This will install Trove and its client. However, at this point in time, Trove is non-functional, and the configuration needs to be updated for this to function. The configuration process is the same as that of a production or multi-node deployment configuration. Therefore, please refer to the configuration section of the next installation procedure (Configuring Trove).

Installing with the Ubuntu OpenStack repository

In the case where we have an OpenStack production or a pre-production environment installed with Ubuntu's OpenStack distribution (install guides for the Liberty release can be found at http://docs.openstack.org/liberty/install-guide-ubuntu/), we can use the following section to add Trove on top of that.

Even if we have used, say, Puppet or Chef to install the OpenStack environment, it would have used the Ubuntu/Red Hat distro depending on the operating system of the node, so if you have an Ubuntu system, then chances are we can use this to add the Trove system.

We can install Trove by using the aptitude package manager.

apt-get install python-trove python-troveclient trove-common trove-api 
trove-taskmanager

It is assumed that the repositories will be set because we have already installed other components of OpenStack. Once the installation is complete, we will now be configuring the Trove system.

Installing the packages should also create a user called trove. We will verify that it is indeed the case; if not, we can add the user manually.

awk -F":" '{ print $1 }' /etc/passwd | grep –x trove 

If we get an output on the screen, then the user exists. If we don't get an output, we can add it by using the command:

useradd -m trove -s /bin/bash

As the next step, we will configure the Trove system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.160.131