Install and configure OpenStack Nova on CentOS

Source: Internet
Author: User

Because of Python version problems, it is not easy to install OpenStack on CentOS 5.6, because OpenStack is written in Python 2.6 and the default environment on CentOS 5.6 is Python 2.4, some key tools (such as yum) and dependencies require 2.4, which is not easy to upgrade directly to 2.6, therefore, to install OpenStack on CentOS, you can directly use CentOS 6.0 (Python 2.6 by default ). for details about how to install OpenStack Nova on Ubuntu, install and configure OpenStack Nova on Ubuntu. if you are interested in the cloud computing platform, you can check out another open-source cloud computing system: install and configure OpenNebula on CentOS.

Install and configure the basic system

After the basic CentOS 6.0 system is installed (minimal installation), upgrade and update the entire system, disable SELINUX, and restart the system. It is best to disable iptables for ease of use:

# yum update# yum upgrade# vi /etc/sysconfig/selinuxSELINUX=disabled# chkconfig iptables off# service iptables stop# shutdown -r now

Install OpenStack Nova

Download and install the OpenStack Source:

# wget http://yum.griddynamics.net/yum/diablo-3/openstack/openstack-repo-2011.3-0.3.noarch.rpm# rpm -ivh openstack-repo-2011.3-0.3.noarch.rpm

OpenStack Nova needs to install and enable libmongod on both the control node (Cloud Controller) and computing node (Cloud Compute:

# yum install libvirt# chkconfig libvirtd on# service libvirtd start

If the server needs to be installed as a Cloud Controller node (at least one server in OpenStack Nova Cloud must be used as the control node ):

# yum install euca2ools openstack-nova-node-full unzip

If the server is only used as a computing node, it needs to be installed on each Cloud Compute node (theoretically, there are several computing nodes in the OpenStack Nova Cloud ):

# yum install euca2ools openstack-nova-node-full

Configure the MySQL database

OpenStack Nova requires database support. MySQL is used here:

# service mysqld start# chkconfig mysqld on# service rabbitmq-server start# chkconfig rabbitmq-server on

Modify the MySQL binding address so that other node servers can access this database:

# vi /etc/my.cnf...#bind-address = 127.0.0.1bind-address = 0.0.0.0...# service mysql restart

Create a database named nova and set the root user's access permission and password from any IP Address:

# mysql -uroot -ppassword -e 'CREATE DATABASE nova;'# mysql -uroot -ppassword -e "GRANT ALL PRIVILEGES ON *.* TO \'root'@'%' WITH GRANT OPTION;"# mysql -uroot -ppassword -e "SET PASSWORD FOR \'root'@'%' = PASSWORD('password');"

Configure Nova:

$ sudo vi /etc/nova/nova.conf--verbose=false--ec2_url=http://172.16.39.111:8773/services/Cloud--s3_host=172.16.39.111--cc_host=172.16.39.111--rabbit_host=172.16.39.111--sql_connection=mysql://nova:nova@172.16.39.111/nova--glance_api_servers=172.16.39.111:9292--use_s3=true--libvirt_type=kvm--use_syslog=false--node_availability_zone=nova--logdir=/var/log/nova--logging_context_format_string=%(asctime)s %(name)s: %(levelname)s [%(request_id)s %(user)s %(project)s] %(message)s--logging_default_format_string=%(asctime)s %(name)s: %(message)s--logging_debug_format_suffix=--use_cow_images=true--auth_driver=nova.auth.dbdriver.DbDriver--network_manager=nova.network.manager.VlanManager--scheduler_driver=nova.scheduler.zone.ZoneScheduler--image_service=nova.image.glance.GlanceImageService--use_ipv6=false--ca_path=/var/lib/nova/CA--keys_path=/var/lib/nova/keys--images_path=/var/lib/nova/images--buckets_path=/var/lib/nova/buckets--instances_path=/var/lib/nova/instances--networks_path=/var/lib/nova/networks--dhcpbridge_flagfile=/etc/nova/nova.conf--dhcpbridge=/usr/bin/nova-dhcpbridge--injected_network_template=/usr/share/nova/interfaces/--libvirt_xml_template=/usr/share/nova/libvirt.xml.template--vpn_client_template=/usr/share/nova/client.ovpn.template--credentials_template=/usr/share/nova/novarc.template--state_path=/var/lib/nova--lock_path=/var/lib/nova/tmp--vnc_enabled=true--vncproxy_url=http://172.16.39.111:6080--vncserver_host=0.0.0.0--vnc_token_ttl=300

Every time you restart a bunch of services, it is very troublesome to write a script to restart all the services in nova:

# vi nova-restart-all.sh#!/bin/bashfor n in api compute network objectstore scheduler vncproxy; do service openstack-nova-$n restart; doneservice openstack-glance-api restartservice openstack-glance-registry restart# chmod +x nova-restart-all.sh# ./nova-restart-all.sh

Use Nova

The subsequent steps are similar to installing and configuring OpenStack Nova on Ubuntu, so we will not go into details here:

# nova-manage db sync# nova-manage network create 192.168.0.0/24 1 255# nova-manage floating create 10.10.10.2 10.10.10.224/27# nova-manage user admin vpsee# nova-manage project create mycloud vpsee

Export Permission information:

# mkdir /home/vpsee/creds# nova-manage project zipfile mycloud vpsee /home/vpsee/creds/novacreds.zip# cd /home/vpsee/creds# unzip novacreds.zip# chown -R vpsee:vpsee /home/vpsee/creds/# source /home/vpsee/creds/novarc

Restart all services related to nova again:

# ./nova-restart-all.sh

If everything is normal, you can see the following similar information, so that OpenStack Nova is successfully installed:

# euca-describe-availability-zones verboseAVAILABILITYZONE nova availableAVAILABILITYZONE |- node00AVAILABILITYZONE | |- nova-network enabled :-) 2011-08-16 19:28:13AVAILABILITYZONE | |- nova-compute enabled :-) 2011-08-16 19:28:22AVAILABILITYZONE | |- nova-scheduler enabled :-) 2011-08-16 19:28:14

Start the First Instance

Before starting an instance, You need to upload a system template (called image). It is a bit difficult to create an image yourself. For details, refer to: create a Ubuntu image for OpenStack Nova and create a Windows image for OpenStack Nova.

With image, you can start the instance, just as you can create an instance after you have class in object-oriented languages such as C ++/Java, with OS image, you can create an OS instance. Start and access the instance.

Original article: http://www.vpsee.com/2011/08/install-openstack-nova-on-centos/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.