Это старая версия документа.


Облако Ubuntu

Облачные вычисления являются моделью вычислений, позволяющей предоставлять требуемые вычислительные мощности по запросу из общего набора имеющихся ресурсов. Такие ресурсы, как хранилище, вычислительная мощность, сеть и программное обеспечение, являются абстрактными и предоставляются как сервис через интернет в любом месте в любое время. Счет на данные ресурсы выставляется по времени использования, аналогично тому как оплачиваются электричество, вода или телефония. Инфраструктура облака Ubuntu использует программное обеспечение с открытым кодом OpenStack для создания в высшей степени масштабируемых облачных вычислений как для открытых, так и частных облаков.

Обзор

Это руководство показывает установку OpenStack с образа Ubuntu 12.04 LTS Server Edition и предполагает базовую сетевую топологию с единственной обслуживающей системой по принципу облачной системы "все в одном". Поскольку рассмотрение упрощено, данные инструкции как есть не предназначены для построения промышленных серверов, а только позволяют вам получить проверку концепции построения облака Ubuntu с использованием OpenStack.

Необходимые требования

To deploy a minimal Ubuntu Cloud infrastructure, you’ll need at least:

  One dedicated system.
  Two network address ranges (private network and public network).
  Make sure the host in question supports VT ( Virtualization Technology ) since we will be using KVM as the virtualization technology. Other hypervisors are also supported such as QEMU, UML, Vmware ESX/ESXi and XEN. LXC (Linux Containers) is also supported through libvirt.
  Check if your system supports kvm issuing sudo kvm-ok in a linux terminal.

The «Minimum Topology» recommended for production use is using three nodes - One master server running nova services (except compute) and two servers running nova-compute. This setup is not redundant and the master server is a SPoF (Single Point of Failure).

Предварительная настройка сети

Before we start installing OpenStack we need to make sure we have bridging support installed, a MySQL database, and a central time server (ntp). This will assure that we have instantiated machines and hosts in sync.

In this example the “private network” will be in the 10.0.0.0/24 range on eth1. All the internal communication between instances will happen there while the “public network” will be in the 10.153.107.0/29 range on eth0.

Установка поддержки мостов

sudo apt-get install bridge-utils

Установка и настройка NTP

sudo apt-get install ntp

Add these two lines at the end of the /etc/ntp.conf file.

server 127.127.1.0 fudge 127.127.1.0 stratum 10

Restart ntp service

sudo service ntp restart

Установка и настройка MySQL

sudo apt-get install mysql-server

Create a database and mysql user for OpenStack

sudo mysql -uroot -ppassword -e «CREATE DATABASE nova;» sudo mysql -uroot -ppassword -e «GRANT ALL ON nova.* TO novauser@localhost \ IDENTIFIED BY 'novapassword' »;

The line continuation character «\» implies that you must include the subsequent line as part of the current command.

Установка вычислительного ресурса OpenStack (Nova)

OpenStack Compute (Nova) is a cloud computing fabric controller (the main part of an IaaS system). It is written in Python, using the Eventlet and Twisted frameworks, and relies on the standard AMQP messaging protocol, and SQLAlchemy for data store access.

Install OpenStack Nova components

sudo apt-get install nova-api nova-network nova-volume nova-objectstore nova-scheduler \ nova-compute euca2ools unzip

Restart libvirt-bin just to make sure libvirtd is aware of ebtables.

sudo service libvirt-bin restart

Install RabbitMQ – Advanced Message Queuing Protocol (AMQP)

sudo apt-get install rabbitmq-server

Edit /etc/nova/nova.conf and add the following:

# Nova config FlatDHCPManager –sql_connection=mysql:novauser:novapassword@localhost/nova –flat_injected=true –network_manager=nova.network.manager.FlatDHCPManager –fixed_range=10.0.0.0/24 –floating_range=10.153.107.72/29 –flat_network_dhcp_start=10.0.0.2 –flat_network_bridge=br100 –flat_interface=eth1 –public_interface=eth0 Restart OpenStack services for i in nova-api nova-network nova-objectstore nova-scheduler nova-volume nova-compute; \ do sudo stop $i; sleep 2; done for i in nova-api nova-network nova-objectstore nova-scheduler nova-volume nova-compute; \ do sudo start $i; sleep 2; done Migrate Nova database from sqlite db to MySQL db. It may take a while. sudo nova-manage db sync Define a specific private network where all your Instances will run. This will be used in the network of fixed Ips set inside nova.conf . sudo nova-manage network create –fixed_range_v4 10.0.0.0/24 –label private \ –bridge_interface br100 Define a specific public network and allocate 6 (usable) Floating Public IP addresses for use with the instances starting from 10.153.107.72. sudo nova-manage floating create –ip_range=10.153.107.72/29 Create a user (user1), a project (project1), download credentials and source its configuration file. cd ; mkdir nova ; cd nova sudo nova-manage user admin user1 sudo nova-manage project create project1 user1 sudo nova-manage project zipfile project1 user1 unzip nova.zip source novarc Verify the OpenStack Compute installation by typing: sudo nova-manage service list sudo nova-manage version list If nova services don’t show up correctly restart OpenStack services as described previously. For more information please refer to the troubleshooting section on this guide. ====Установка сервиса образов систем (Glance)==== Nova uses Glance service to manage Operating System images that it needs for bringing up instances. Glance can use several types of storage backends such as filestore, s3 etc. Glance has two components - glance-api and glance-registry. These can be controlled using the concerned upstart service jobs. For this specific case we will be using mysql as a storage backend. Install Glance sudo apt-get install glance Create a database and user for glance sudo mysql -uroot -ppassword -e «CREATE DATABASE glance;» sudo mysql -uroot -ppassword -e «GRANT ALL ON glance.* TO glanceuser@localhost \ IDENTIFIED BY 'glancepassword' »; Edit the file /etc/glance/glance-registry.conf and edit the line which contains the option «sql_connection =» to this: sql_connection = mysql:glanceuser:glancepassword@localhost/glance

Remove the sqlite database

rm -rf /var/lib/glance/glance.sqlite

Restart glance-registry after making changes to /etc/glance/glance-registry.conf. The MySQL database will be automatically populated.

sudo restart glance-registry

If you find issues take a look at the log file in /var/log/glance/api.log and /var/log/glance/registry.log.

Работающие экземпляры (instances)

Before you can instantiate images, you first need to setup user credentials. Once this first step is achieved you also need to upload images that you want to run in the cloud. Once you have these images uploaded to the cloud you will be able to run and connect to them. Here are the steps you should follow to get OpenStack Nova running instances:

Download, register and publish an Ubuntu cloud image

distro=lucid wget http://cloud-images.ubuntu.com/$distro/current/$distro-server-cloudimg-amd64.tar.gz cloud-publish-tarball «$distro»-server-cloudimg-amd64.tar.gz «$distro»_amd64

Create a key pair and start an instance

cd ~/nova source novarc euca-add-keypair user1 > user1.priv chmod 0600 user1.priv

Allow icmp (ping) and ssh access to instances

euca-authorize default -P tcp -p 22 -s 0.0.0.0/0 euca-authorize -P icmp -t -1:-1 default

Run an instance

ami=`euca-describe-images | awk {'print $2'} | grep -m1 ami` euca-run-instances $ami -k user1 -t m1.tiny euca-describe-instances

Assign public address to the instance.

euca-allocate-address euca-associate-address -i instance_id public_ip_address euca-describe-instances

You must enter above the instance_id (ami) and public_ip_address shown above by euca-describe-instances and euca-allocate-address commands.

Now you should be able to SSH to the instance

ssh -i user1.priv ubuntu@ipaddress

To terminate instances

euca-terminate-instances instance_id

Установка хранилища инфраструктуры (Swift)

Swift is a highly available, distributed, eventually consistent object/blob store. It is used by the OpenStack Infrastructure to provide S3 like cloud storage services. It is also S3 api compatible with amazon.

Organizations use Swift to store lots of data efficiently, safely, and cheaply where applications use an special api to interface between the applications and objects stored in Swift.

Although you can install Swift on a single server, a multiple-server installation is required for production environments. If you want to install OpenStack Object Storage (Swift) on a single node for development or testing purposes, use the Swift All In One instructions on Ubuntu.

For more information see: http://swift.openstack.org/development_saio.html .

Поддержка и решение проблем

Community Support

  OpenStack Mailing list
  The OpenStack Wiki search
  Launchpad bugs area
  Join the IRC channel #openstack on freenode.

Ссылки

  Cloud Computing - Service models
  OpenStack Compute
  OpenStack Image Service
  OpenStack Object Storage Administration Guide
  Installing OpenStack Object Storage on Ubuntu
  http://cloudglossary.com/

Термины

The Ubuntu Cloud documentation uses terminology that might be unfamiliar to some readers. This page is intended to provide a glossary of such terms and acronyms.

  Cloud - A federated set of physical machines that offer computing resources through virtual machines, provisioned and recollected dynamically.
  IaaS - Infrastructure as a Service — Cloud infrastructure services, whereby a virtualized environment is delivered as a service over the Internet by the provider. The infrastructure can include servers, network equipment, and software.
  EBS - Elastic Block Storage.
  EC2 - Elastic Compute Cloud. Amazon's pay-by-the-hour, pay-by-the-gigabyte public cloud computing offering.
  Node - A node is a physical machine that's capable of running virtual machines, running a node controller. Within Ubuntu, this generally means that the CPU has VT extensions, and can run the KVM hypervisor.
  S3 - Simple Storage Service. Amazon's pay-by-the-gigabyte persistent storage solution for EC2.
  Ubuntu Cloud - Ubuntu Cloud. Ubuntu's cloud computing solution, based on OpenStack.
  VM - Virtual Machine.
  VT - Virtualization Technology. An optional feature of some modern CPUs, allowing for accelerated virtual machine hosting.