We had discussed about various cloud categories and the fundamentals of OpenStack in my previous post. Here I am trying to help you to configure and fulfill the basic prerequisites for implementation of cloud using OpenStack on Ubuntu 14.04 LTS servers. Please make sure to use the corresponding configuration files in accordance with your distribution.
Two-node architecture with legacy networking (nova-network)
Here I’ll describe how to use the underlying five services and build a production environment or a test environment which can later be modified to meet the requirements of a production environment. I’m using a multi node architecture with legacy networking that will share the required services among them to create the test/production cloud environment.
The basic controller node runs the basic services such as the Identity service, Image service, the management portion of the compute and the dashboard. It also runs the supporting services such as MySQL database and RabbitMQ message broker. Optionally, the controller node also runs portions of Block Storage service.
The compute node runs the hypervisor portion of compute service. By default, Compute uses KVM as the hypervisor. You can run more than one compute node. The compute node also runs the nova-network service to provide network as a service for the instances created. One compute node supports only one hypervisor. If you want to have more than one virtualization type in your cloud stack, you need separate compute nodes configured independently for each required virtualization.
BASIC CONFIGURATIONS
1. Network Configuration
Controller node has one network interface named eth0 on the management network and the compute node has two network interfaces, eth0 on the management network and eth1 on the external network.
Controller Node Configuration
Network: Set the eth0 interface as the management network.
Edit /etc/network/interfaces file with the entries shown below:
Please note the values shown here are for exemplary purpose and you need to modify it in accordance to your settings
auto eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1
Name Resolution : Set the hostname of the node to “controller”
Edit the /etc/hosts file with the following entries
192.168.1.11 controller
192.168.1.31 compute
Restart networking service for the changes to take effect.
Compute Node Configuration
Network: Set the eth0 interface on the management network.
Edit /etc/network/interfaces file with the entries shown below:
auto eth0
iface eth0 inet static
address 192.168.1.31
netmask 255.255.255.0
gateway 192.168.1.1
Set the eth1 interface to be used as the external interface.
Edit the /etc/network/interfaces file to contain the following
auto eth1
iface eth1 inet manual
Here we don’t set any IP address to the eth1 interface. Its manually assigned by the network script.
Name Resolution : Set the hostname of the node to “compute”
Edit the /etc/hosts file with the following entries
192.168.1.11 controller
192.168.1.31 compute
Restart networking service for the changes to take effect.
Once this basic network configurations are done, verify the connectivity between the controller and compute nodes using ping (ping with both IP address and the hostnames ).
2. NTP Configuration
Install NTP service on both the controller and compute nodes using the following command
# apt-get install ntp
NTP on the controller node runs as the time server and the compute node syncs time with the controller time server.
On the compute node, Edit /etc/ntp.conf and set the server directive to use the controller node as the ntp server. Restart ntpd service for the changes to take effect.
3. Database Configuration
Controller Node Configuration
Install MySQL client and server packages, and the Python library using the following command.
root@controller# apt-get install python-mysqldb mysql-server
Edit the [mysqld] section in /etc/my.cnf file to add some additional configuration as shown below for MySQL to work with OpenStack
bind-address = 192.168.1.11 #ip of controller node
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8’
character-set-server = utf
Restart mysql service for changes to take effect.
root@controller# service mysql restart
Delete the anonymous users that are created when the database is first started by the following command.
root@controller# mysql_install_db root@controller# mysql_secure_installation
This command presents a number of options for you to secure your database installation. Respond yes to all prompts.
Compute Node Configuration
All the other nodes except the controller node in the OpenStack architecture should have MySQL Python library installed. You can install it by the following command.
root@compute# apt-get install python-mysqldb
4. Messaging Broker Configuration
This tutorial uses RabbitMQ as the message broker. Installation steps are shown below.
Install RabbitMQ
root@controller# apt-get install rabbitmq-server
Configure RabbitMQ
By default a user is created with the installation of RabbitMQ with username and password as “guest”
We use the same guest user here, but reset the password to a new one for ensuring security with the following command.
root@controller# rabbitmqctl change_password guest new_rabbit_pass
Now we have done all the basic configurations so that we can proceed to install the basic OpenStack services.
Recommended Readings
OpenStack Cloud Computing Fundamentals
OpenStack on Ubuntu – Part 2 – Identity or Keystone Service
OpenStack on Ubuntu – Part 3 – Image or Glance Service
OpenStack on Ubuntu – Part 4 – Compute or Nova Service
OpenStack on Ubuntu – Part 5 – Dashboard or Horizon Service
OpenStack on Ubuntu – Part 6 – Block Storage or Cinder Service