Steps for building OpenStack F Based on Ubuntu Server 12.04

Source: Internet
Author: User
Tags curl openssl openstack swift

Steps for building OpenStack F Based on Ubuntu Server 12.04
This article builds a dual-node architecture, which can be divided into computing (IP1) and control node (IP2)

Note:

Computing node components:

1. mysql

2. keystone

3. Nova

4. glance

5. rabbitmq

 

Control Node components:

1. cinder

2. dashboard

 

1. Modify the Host Name and static IP Address

1. vim/etc/hostname
Xxctrl (Change xxctrl to the target name)

2. vim/etc/hosts
IP xxctrl (Target name)

3. hostname xxctrl (change the name to take effect, or restart the virtual machine)

2. Configure Network Interfaces

1. vim/etc/network/interfaces

Auto eth0
Iface eth0 inet static
Address XX. XX (change to your IP1)
Netmask 255.255.240.0
Network XX. XX.0.0
Broadcast 10.18.0.255
Gateway 10.18.0.254
Dns-nameservers 61.139.2.69

2./etc/init. d/networking restart (to make the network configuration take effect)

3. Change to 163 source (optional) and update the system and Kernel

1. cd/etc/apt vim sources. list

Here we will post 12.04 of the 163 source, which is faster. You can select another source as needed, as long as the version is consistent.

Deb http://mirrors.163.com/Ubuntu/ precise main universe restricted multiverse
Deb-src http://mirrors.163.com/ubuntu/ precise main universe restricted multiverse
Deb http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/ precise-security universe main multiverse restricted
Deb http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted
Deb http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/ precise-proposed universe main multiverse restricted
Deb http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/ precise-backports universe main multiverse restricted
Deb-src http://mirrors.163.com/ubuntu/ precise-updates universe main multiverse restricted

2. Update the system and Kernel

Apt-get update & apt-get upgrade & apt-get dist-upgrade

3. added the F version source.
Vim sources. list
Deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-proposed/folsom main
Deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/folsom main

4. apt-get install ubuntu-cloud-keyring
5. apt-get update

4. Configure IPv4 packet forwarding

1. vim/etc/sysctl. conf

Net. ipv4.ip _ forward = 1

2. sysctl-p (execute to make the configuration take effect)

5. install and configure the NTP service

1. apt-get install ntp

2. sed-I's/server ntp.ubuntu.com/server ntp.ubuntu.com \ nserver 127.127.1.0 \ nfudge 127.127.1.0 stratum 10/G'/etc/ntp. conf

3. restart the service: service ntp restart

6. install and configure the MySQL database

1. apt-get install-y mysql-server python-mysqldb

2. sed-I "s/127.0.0.1/0.0.0.0/"/etc/mysql/my. cnf

3. service mysql restart

4. Create a database and Set permissions

Mysql-uroot-pxxxx (your own password)
Create database nova;
Create database glance;
Create database keystone;
Create database cinder;
Grant all privileges on *. * to root @ '%' identified by 'pwd ';

Grant all privileges on nova. * to nova @ '%' identified by 'pwd ';
Grant all privileges on glance. * to glance @ '%' identified by 'pwd ';
Grant all privileges on keystone. * to keystone @ '%' identified by 'pwd ';
Grant all privileges on cinder. * to cinder @ '%' identified by 'pwd ';

Flush privileges;
Exit;
Restart Database service: service mysql restart

7. install and configure the RabbitMQ Service

1. vim sources. list
Deb http://www.rabbitmq.com/debian/ kitten main

2. wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
3. apt-key add rabbitmq-signing-key-public.asc
4. apt-get update
5. apt-get install-y rabbitmq-server
6. View service status
Service rabbitmq-server status

8. install and configure the Keystone Service

1. Generate a random value as the administrator token in the initial configuration ).
Openssl rand-hex 10
2. Install keystack
Apt-get install keystone
3. edit/etc/keystone. conf and complete the following operations:
A. Configure the Administrator token in the [DEFAULT] section.
Admin_token = ADMIN_TOKEN // replace ADMIN_TOKEN with the random string generated in the previous step.
B. Configure database access parameters in the [database] segment:
[Database]
Connection = mysql: // keystone: KEYSTONE_DBPASS @ IP/keystone
4. initialize the database of the Identity Authentication Service. The created database is empty and the table structure of the Keystone database needs to be initialized.
Service keystone restart
Keystone-manage db_sync

5. Create tenants, users, and roles using scripts and define Services and API Endpoints
A. Configure the Administrator token:
Export OS _SERVICE_TOKEN = ADMIN_TOKEN // replace ADMIN_TOKEN with the Administrator token. Example: export OS _SERVICE_TOKEN = 294a4c8a8a475f9b9836
B. Download the script file
Wget https://raw.github.com/nimbula/OpenStack-Folsom-Install-guide/master/Keystone_Scripts/Without%20Quantum/keystone_basic.sh
Wget https://raw.github.com/nimbula/OpenStack-Folsom-Install-guide/master/Keystone_Scripts/Without%20Quantum/keystone_endpoints_basic.sh

6. Set Environment Variables
Vi/etc/profile
Export OS _NO_CACHE = 1
Export SERVICE_TOKEN = ADMIN
Export OS _TENANT_NAME = admin
Export OS _USERNAME = admin (logon username)
Export OS _PASSWORD = pass (logon password)
Export OS _AUTH_URL = http: // IP1: 5000/v2.0/
Export SERVICE_ENDPOINT = http: // IP1: 35357/v2.0/
7. source/etc/profile

8. Modify the script file:
Vim keystone_basic.sh
HOST_IP =$ {HOST_IP:-IP1}
ADMIN_PASSWORD =$ {ADMIN_PASSWORD:-admin_pass}
SERVICE_PASSWORD =$ {SERVICE_PASSWORD:-service_pass}
Vim keystone_endpoints_basic.sh
# Host address
HOST_IP = IP1
EXT_HOST_IP = IP1
# MySQL definitions
MYSQL_USER = keystone
MYSQL_DATABASE = keystone
MYSQL_PASSWORD = keystack_dbpass

9. Modify the File Execution permission
Chmod + x keystone_basic.sh
Chmod + x keystone_endpoints_basic.sh

10. Execute the script file:
./Keystone_basic.sh
./Keystone_endpoints_basic.sh

11. Verification Service
Apt-get install curl openssl
Curl http: // IP: 35357/v2.0/endpoints-H 'x-auth-token: cloud' | python-m json. tool

12. view the service list

Keystone user-list
Keystone service-list
Keystone endpoint-list

9. install and configure the Glance Service

1. install the software package:
Apt-get install glance
2. modify the configuration file
6/etc/glance/glance-api-paste.ini
[Filter: authtoken]
Paste. filter_factory = keystone. middleware. auth_token: filter_factory
Auth_host = IP
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = service
Admin_user = glance
Admin_password = pass

6/etc/glance/glance-api.conf
Verbose = True
SQL _connection = mysql: // glance: username @ IP/glance
Notifier_strategy = noop
Rabbit_host = IP
Rabbit_port = 5672
Rabbit_use_ssl = false
Rabbit_userid = guest
Rabbit_password = guest
Rabbit_virtual_host =/
[Filter: authtoken]
Paste. filter_factory = keystone. middleware. auth_token: filter_factory
Auth_host = IP
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = service
Admin_user = glance
Admin_password = cloud
[Paste_deploy]
Flavor = keystone

6/etc/glance/glance-registry.conf
Verbose = True
SQL _connection = mysql: // glance: glance_dbpass @ IP1/glance
[Keystone_authtoken]
Auth_host = IP
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = service
Admin_user = glance
Admin_password = service_pass
[Paste_deploy]
Flavor = keystone

6/etc/glance/glance-registry-paste.ini
[Filter: authtoken]
Paste. filter_factory = keystone. middleware. auth_token: filter_factory
Auth_host = IP1
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = service
Admin_user = glance
Admin_password = cloud

Restart glance services and initialize Databases
Service glance-api restart; service glance-registry restart
Glance-manage db_sync

3. Verify the operation
Wget https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
Source admin-openrc.sh
Glance image-create -- name cloud -- is-public true -- container-format bare -- disk-format qcow2 <cirros-0.3.0-x86_64-disk.img

Glance image-list

10. install and configure the nova Service

1. Install the Nova package
Apt-get install nova-api nova-cert novnc nova-consoleauth nova-scheduler nova-novncproxy
Nova-doc nova-conductor nova-network
2. modify the configuration file
Vim/etc/nova/api-paste.ini
[Filter: authtoken]
Auth_host = IP1
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = service
Admin_user = nova
Admin_password = service_pass
Signing_dirname =/tmp/keystone-signing-nova

Vim/etc/nova. conf (configure nova)

3. initialize the database and restart the nova service.
Nova-manage db sync

Cd/etc/init. d/; for I in $ (ls nova-*); do sudo service $ I restart; done

4. View service status and Images
Nova-manage service list
Binary Host Zone Status State Updated_At
Nova-cert ctrl nova enabled :-) 2015-11-26 05:03:41
Nova-consoleauth ctrl nova enabled :-) 2015-11-26 05:03:48
Nova-scheduler ctrl nova enabled :-) 2015-11-26 05:03:45
Nova-network ctrl nova enabled :-) 2015-11-26 05:03:46

Run the client command of Nova to list the currently available images and test whether they can run normally:
Nova image-list

11. install and configure the control node network

1. install the software package
Apt-get install-y bridge-utils
2. modify the configuration file
Vi/etc/network/interfaces
Auto br100
Iface br100 inet static
Address IP2
Netmask 255.255.255.0
Network XX. XX
Broadcast 10.18.0.255
Gateway 10.18.0.254
Dns-nameservers 61.139.2.69
Bridge_ports eth0
Bridge_stp off
Bridge_maxwait 0
Bridge_fd 0

3. Restart the network service
Brctl addbr br100

12. install and configure the cinder Service

1. The cinder software package is not installed.

Apt-get install cinder-api cinder-scheduler cinder-volume iscsitarget-dkms

2. modify the configuration file
Vim/etc/cinder/api-paste.ini
Vim/etc/cinder. conf

3. initialize the database
Cinder-manage db sync

4. Verify Service Components
Cinder list

5. Restart the cinder service.
Service cinder-api restart
Service cinder-scheduler restart
Service cinder-volume restart

6. Add disk partitions, create volume groups, and volumes.
Create a physical volume pvcreate
Create a volume group vgcreate

13. Install the dashboard Software Package

Apt-get install openstack-dashboard memcached

14. Installation Complete

The following is a collection of Openstack related knowledge for you to see if you like it:

Install and deploy Openstack on Ubuntu 12.10

Ubuntu 12.04 OpenStack Swift single-node deployment Manual

OpenStack cloud computing quick start tutorial

Deploying OpenStack for enterprises: what should be done and what should not be done

CentOS 6.5 x64bit quick OpenStack Installation

This article permanently updates the link address:

Related Article

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.