Walking through a Controller deployment
5.1 Deploying controller prerequisites
5.1.3 Updating packages
Ubuntu 14.04 LTS includes the Icehouse (2014.1) release of OpenStack, which includes the following components:
Nova—The OpenStack Compute project, which works as an IaaS cloud fabric controller
Glance—Provides services for VM images, discovery, retrieval, and registration Swift—Provides highly scalable, distributed, object store services
Horizon—The OpenStack Dashboard project, which provides a web-based admin and user GUI
Keystone—Provides identity, token, catalog, and policy services for the Open- Stack suite
Neutron—Provides network management services for OpenStack components Cinder—Provides block storage as a service to OpenStack Compute
Ceilometer—Provides a central point of record for resource utilization metrics Heat—Provides application-level orchestration of OpenStack resources
I WANT TO USE A DIFFERENT OS OR OPENSTACK VERSION You might be inclined to use a different Linux distribution or release that provides a more current OpenStack version. However, it’s highly recommended that you stick with the versions specified. Once you understand OpenStack on fundamental and operational levels, you can always migrate to new releases.
The Ubuntu Linux distribution uses the APT system for package management. The APT package index is a database of all available packages defined in the /etc/apt/sources.list file. You should make sure the local database is synchronized with the latest packages available in the repository for your specific Linux distribution. Prior to installing OpenStack, you should also upgrade any repository items, includ- ing the Linux kernel, that might be out of date.
The following listing demonstrates how to update and upgrade packages on your server.
sudo apt-get -y update sudo apt-get -y upgrade
Once you’ve updated and upgraded the packages, you should reboot the server to refresh any packages or configurations that might have changed.
sudo reboot
Now it’s time to install the OpenStack software dependencies. 5.1.4 Installing software dependencies
In the context of OpenStack, a dependency is software that’s not part of the OpenStack project but is required by OpenStack components. This includes software used to run OpenStack code (Python and modules), the queueing system (RabbitMQ), and the database platform (MySQL), among other things.
In this section, you’ll walk through the deployment of OpenStack software depen- dencies. You’ll start with the installation of RabbitMQ.
INSTALLING RABBITMQ
RabbitMQ is an Advanced Message Queuing Protocol (AMQP) –compliant queuing system that allows for guaranteed delivery and ordering of messages in large distrib- uted systems. OpenStack uses the RabbitMQ messaging service as its default queuing system, allowing OpenStack component functions that require quick and ordered messages to communicate.
You can use APT or an equivalent package management system for your Linux dis- tribution to install RabbitMQ. The following listing demonstrates the installation using APT.
sudo apt-get -y install rabbitmq-server
When you run the preceding command, you’ll see output like the following:
...
The following extra packages will be installed: erlang-asn1 erlang-base erlang-corba ... libltdl7 libodbc1 libsctp1 lksctp-tools ... ...
Setting up rabbitmq-server (3.2.4-1) ... Adding group `rabbitmq' (GID 118) ... Done.
Adding system user `rabbitmq' (UID 111) ...
Adding new user `rabbitmq' (UID 111) with group `rabbitmq' ... Not creating home directory `/var/lib/rabbitmq'.
* Starting message broker rabbitmq-server
If you see the error [*FAILED-check/var/log/rabbitmq/startup...], make sure your hostname in /etc/hostname matches the host entry found in /etc/hosts and restart if necessary.
Listing 5.6 Rebooting the server
RabbitMQ automatically creates a user named guest, with administrative privi- leges. You’ll want to change the password for the guest account; the following exam- ple changes the password to openstack1.
$ sudo rabbitmqctl change_password guest openstack1 Changing password for user "guest" ...
...done.
You must now verify that RabbitMQ is running properly.
$sudo rabbitmqctl status
Status of node rabbit@controller ... [{pid,2452}, {running_applications,[{rabbit,"RabbitMQ","3.2.4"}, {mnesia,"MNESIA CXC 138 12","4.11"}, {os_mon,"CPO CXC 138 46","2.2.14"}, {xmerl,"XML parser","1.3.5"}, {sasl,"SASL CXC 138 11","2.3.4"}, {stdlib,"ERTS CXC 138 10","1.19.4"}, {kernel,"ERTS CXC 138 10","2.16.4"}]}, ... ...done.
You now have a fully functional deployment of RabbitMQ ready for OpenStack use. INSTALLING MYSQL
OpenStack uses a traditional relational database to store configurations and status information. By default, OpenStack is configured to use an embedded SQLite data- base for all components, but because of the performance and general accessibility of MySQL, I’ll show you how to configure components to use MySQL in place of SQLite. This will allow you to use a MySQL server for your backend configuration and status data store. All OpenStack components deployed in chapters 5 through 8 that use a database will use the central database deployed in this step.
Using APT or an equivalent package management system for your Linux distribu- tion, install MySQL as demonstrated in the following listing.
$ sudo apt-get -y install python-mysqldb mysql-server Reading package lists... Done
Building dependency tree
Reading state information... Done Suggested packages:
python-mysqldb-dbg ...
The following NEW packages will be installed: ...
Listing 5.8 Configuring the RabbitMQ guest password
Listing 5.9 Verifying the RabbitMQ status
mysql-server python-mysqldb ...
Setting up libaio1:amd64 (0.3.109-3) ...
Setting up libmysqlclient18:amd64 (5.5.29-0ubuntu1) ... Setting up libnet-daemon-perl (0.48-1) ...
Setting up libplrpc-perl (0.2020-2) ... Setting up libdbi-perl (1.622-1) ... Setting up libdbd-mysql-perl (4.021-1) ...
Setting up mysql-client-core-5.5 (5.5.38-0ubuntu1) ... Setting up libterm-readkey-perl (2.30-4build4) ... Setting up mysql-client-5.5 (5.5.38-0ubuntu1) ... Setting up mysql-server-core-5.5 (5.5.38-0ubuntu1) ... Setting up mysql-server-5.5 (5.5.38-0ubuntu1) ... Setting up libhtml-template-perl (2.91-1) ... Setting up python-mysqldb (1.2.3-1ubuntu1) ... Setting up mysql-server (5.5.38-0ubuntu1) ...
Setting up mysql-server (5.5.38-0ubuntu0.14.04.1) ... Setting up python-mysqldb (1.2.3-1build1) ...
When prompted, enter openstack1 as the root MySQL password. You are, of course, free to select any password you want as long as you consistently use the same password in all the examples—the examples will assume you use this password.
In order for external services (those on other nodes using the internal network) to contact the local MySQL instance, you must change the address that MySQL binds to on startup. Using your favorite text editor, open /etc/mysql/my.cnf and change the bind-address to 0.0.0.0 as follows.
# Instead of skip-networking the default is now to listen #only on localhost which is more compatible and is not #less secure.
#bind-address = 127.0.0.1 #Bind to Internal Address of Controller bind-address = 0.0.0.0
MYSQL PERFORMANCE Explaining the performance tuning of MySQL is
beyond the scope of this book, but you need to be aware of the impact MySQL can have on OpenStack performance. Because state and configuration infor- mation is maintained in MySQL, a poorly performing MySQL server can greatly impact many aspects of OpenStack performance. In multi-user and production environments, it’s recommended that you take the time to under- stand and configure settings in /etc/mysql/my.cnf related to performance. You’ll now want to restart MySQL and check its operation.
sudo service mysql restart sudo service mysql status
mysqladmin -u root -h localhost -p status
Listing 5.11 Modifying /etc/mysql/my.cnf
When you run these commands, it will look something like this:
$ sudo service mysql restart [mysql stop/waiting
mysql start/running, process 17396 $ service mysql status
mysql start/running, process 17396
$ mysqladmin -u root -h localhost -p status
Enter password: <enter openstack1 as set in previous step> Uptime: 193 Threads: 1 Questions: 571 Slow queries: 0 Opens: 421 Flush tables: 1 Open tables: 41
Queries per second avg: 2.958
At this point you should have a running MySQL instance. If the instance fails to start and there were no errors during the install process, you should check the /etc/mysql/my.cnf file for any inadvertent typos resulting from the [bind-address= 0.0.0.0] modification.
ACCESSINGTHE MYSQL CONSOLE
The MySQL console is typically accessed from the MySQL client application. The mysql command takes several arguments, including -u <username>, -h <hostname>, and -p <password>.
You can either leave the password blank and then be prompted, or enter it as part of the command. There must be no spaces between the -p argument and the pass- word. For example, if your password is openstack1, the command to access the MySQL console would be mysql-uroot-popenstack1.
The following listing shows the login with a password prompt.
$ mysql -u root -p
Enter password: <enter mysql root password> ...
<verbose text removed> ...
mysql>
Now that you’ve confirmed that MySQL is running and you’re able to access the con- sole, you’re ready to move forward with the component install. Refer back to listing 5.13 throughout part 2 of the book whenever you need to create databases and grant user rights.