Installing OpenStack on Ubuntu 12.04 LTS in 10 Minutes

 

Download the Scripts

Login to your box and install git with apt-get. We’ll become root and do an update first.

sudo su
apt-get update
apt-get install git

Now checkout the StackGeek scripts from Github:

git clone git://github.com/StackGeek/openstackgeek.git
cd openstackgeek

Install the Base Scripts

Be sure to take a look at the scripts before you run them. Keep in mind the scripts will periodically prompt you for input, either for confirming installation of a package, or asking you for information for configuration.

Start the installation by running the first script:

./openstack_base_1.sh

When the script finishes you’ll see instructions for manually configuring your network. You can edit the interfaces file by doing a:

vim /etc/network/interfaces

Copy and paste the network code provided by the script into the file and then edit:

auto eth0 
iface eth0 inet static
  address 10.0.1.20
  network 10.0.1.0
  netmask 255.255.255.0
  broadcast 10.0.1.255
  gateway 10.0.1.1
  dns-nameservers 8.8.8.8

auto eth1

Change the settings for your network configuration and then restart networking and run the next script:

/etc/init.d/networking restart
./openstack_base_2.sh

After the second script finishes, you’ll need to set up a logical volume for Nova to use for creating snapshots and volumes. Nova is OpenStack’s compute controller process.

Here’s the output from the format and volume creation process:

root@precise:/home/kord/openstackgeek# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb39fe7af.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-62914559, default 62914559): 
Using default value 62914559

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
root@precise:/home/kord/openstackgeek# pvcreate -ff /dev/sdb1
  Physical volume "/dev/sdb1" successfully created
root@precise:/home/kord/openstackgeek# vgcreate nova-volumes /dev/sdb1
  Volume group "nova-volumes" successfully created
root@precise:/home/kord/openstackgeek#

Note: Your device names may vary.

Installing MySql

The OpenStack components use MySQL for storing state information. Start the install script for MySQL by entering the following:

./openstack_mysql.sh

You’ll be prompted for a password to be used for each of the components to talk to MySQL:

Enter a password to be used for the OpenStack services to talk to MySQL (users nova, glance, keystone): f00bar

During the installation process you will be prompted for a root password for MySQL. In our install example we use the same password, ‘f00bar’. At the end of the MySQL install you’ll be prompted for your root password again.

mysql start/running, process 8796
#######################################################################################
Creating OpenStack databases and users.  Use your database password when prompted.

Run './openstack_keystone.sh' when the script exits.
#######################################################################################
Enter password:

After MySQL is running, you should be able to login with any of the OpenStack users and/or the root admin account by doing the following:

mysql -u root -pf00bar
mysql -u nova -pf00bar nova
mysql -u keystone -pf00bar keystone
mysql -u glance -pf00bar glance

Installing Keystone

Keystone is OpenStack’s identity manager. Start the install of Keystone by doing:

./openstack_keystone.sh

You’ll be prompted for a token, the password you entered for OpenStack’s services, and your email address. The email address is used to populate the user’s information in the database.

Enter a token for the OpenStack services to auth wth keystone: r4th3rb3t0k3n
Enter the password you used for the MySQL users (nova, glance, keystone): f00bar
Enter the email address for service accounts (nova, glance, keystone): user@foobar.com

You should be able to query Keystone at this point. You’ll need to source the stackrc file before you talk to Keystone:

. ./stackrc
keystone user-list

Keystone should return a list of users:

+----------------------------------+---------+------------------------+--------+
|                id                | enabled |         email          |  name  |
+----------------------------------+---------+------------------------+--------+
| b32b9017fb954eeeacb10bebf14aceb3 | True    | kordless@foobar222.com | demo   |
| bfcbaa1425ae4cd2b8ff1ddcf95c907a | True    | kordless@foobar222.com | glance |
| c1ca1604c38443f2856e3818c4ceb4d4 | True    | kordless@foobar222.com | nova   |
| dd183fe2daac436682e0550d3c339dde | True    | kordless@foobar222.com | admin  |
+----------------------------------+---------+------------------------+--------+

Installing Glance

Glance is OpenStack’s image manager. Start the install of Glance by doing:

./openstack_glance.sh

Note: You can safely ignore the SADeprecationWarning warning thrown by Glance when it starts.

The script will download an Ubuntu 12.04 LTS cloud image from StackGeek’s S3 bucket. Go grab some coffee while it’s downloading. Once it’s done, you should be able to get a list of images:

glance index

Here’s the expected output:

ID                                   Name                           Disk Format          Container Format     Size          
------------------------------------ ------------------------------ -------------------- -------------------- --------------
71b8b5d5-a972-48b3-b940-98a74b85ed6a Ubuntu 12.04 LTS               qcow2                ovf                       226426880

We’ll cover adding images via Glance in another guide soon.

Installing Nova

We’re almost done installing! The last component is the most important one as well. Nova is OpenStack’s compute and network manager. It’s responsible for starting instances, creating snapshots and volumes, and managing the network. Start the Nova install by doing:

./openstack_nova.sh
A Bit on Networking First

You’ll immediately be prompted for a few items, including your existing network interface’s IP address, the fixed network address, and the floating pool addresses:

#############################################################################################################
The IP address for eth0 is probably 10.0.1.35. Keep in mind you need an eth1 for this to work.
#############################################################################################################
Enter the primary ethernet interface IP: 10.0.1.35
Enter the fixed network (eg. 10.0.2.32/27): 10.0.2.32/27
Enter the fixed starting IP (eg. 10.0.2.33): 10.0.2.33
#######################################################################################
The floating range can be a subset of your current network.  Configure your DHCP server
to block out the range before you choose it here.  An example would be 10.0.1.224-255
#######################################################################################
Enter the floating network (eg. 10.0.1.224/27): 10.0.1.224/27
Enter the floating netowrk size (eg. 32): 32

Note: The script isn't very sophisticated and doesn't use defaults, so be sure you type in things carefully! You can rerun the script if you mess up. There's a nice subnet calculator here if you need help with network masks. For reference, the /27 above is called the 'mask bits' in the calculator.

The fixed network is a set of IP addresses which will be local to the compute nodes. Think of these addresses as being held and routed internally inside any of the compute node instances. If you decide to use a larger network, you could use something like 10.0.4.0/24 and a starting address of 10.0.4.1.

The floating network is a pool of addresses which can be assigned to the instances you are running. For example, you could start a web server and map an external IP to it for serving a site on the Internet. In the example above we use a private network because we’re doing this at the house, but if your routing equipment/network allows it you could assign externally routed IPs to OpenStack instances.

Finish Installing Nova

Nova should finish installing after you enter all the network information. When it’s done, you should be able to get a list of images from Glance via Nova:

nova image-list

And get the expected output we saw earlier from Glance:

root@precise:/home/kord/openstackgeek# nova image-list
+--------------------------------------+------------------+--------+--------+
|                  ID                  |       Name       | Status | Server |
+--------------------------------------+------------------+--------+--------+
| 71b8b5d5-a972-48b3-b940-98a74b85ed6a | Ubuntu 12.04 LTS | ACTIVE |        |
+--------------------------------------+------------------+--------+--------+

Installing Horizon

Horizon is the UI and dashboard controller for OpenStack. Install it by doing:

./openstack_horizon.sh

When it’s done installing, you’ll be given a URL to access the dashboard. You’ll be able to login with the user ‘admin’ and whatever you entered earlier for your password. If you’ve forgotten it, simply grep for it in your environment:

env |grep OS_PASSWORD

Start Launching Instances

That’s it! You can now watch the introduction video guide which gives an overview of creating a new project, users, and instances.

Be sure to drop us a line if you have any questions or corrections for this guide!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本方法。编译原理不仅是计算机科学理论的重要组成部分,也是实现高效、可靠的计算机程序设计的关键。本文将对编译原理的基本概念、发展历程、主要内容和实际应用进行详细介绍编译原理是计算机专业的一门核心课程,旨在介绍编译程序构造的一般原理和基本
### 回答1: "不安装尝试Ubuntu"可以使用Ubuntu的Live CD或Live USB。这些是可启动的Ubuntu映像,可以在计算机上运行而不需要安装。您可以从Ubuntu官方网站下载Live CD或Live USB映像,然后将其刻录到CD或USB驱动器中。启动计算机时,选择从CD或USB驱动器启动,即可进入Ubuntu的Live环境。在此环境中,您可以尝试Ubuntu并测试其功能,但是您的更改不会被保存。一旦您关闭计算机,所有更改都将丢失。 ### 回答2: Ubuntu是一个流行的操作系统,通常被用作桌面和服务器环境。但是,一些用户可能不想在计算机上完全安装Ubuntu,无论是因为他们想简单地尝试它,还是因为他们使用的是不支持Ubuntu的计算机。这时,可以通过在不安装的情况下运行Ubuntu来进行尝试。 那么,如何尝试Ubuntu而不必安装?可以使用一个叫做Ubuntu Live CD / USB的功能。这是一个 Ubuntu 安装程序镜像的读写分离操作方式。简单来说,它是一个在可启动 CD / USB 驱动器中的完整 Ubuntu 操作系统。可以选择在计算机启动时从这个驱动器启动,这样就可以运行 Ubuntu 的实时版本而不必在硬盘上安装它。在 Ubuntu 实时环境中,用户可以在操作系统中浏览,熟悉它的界面、工具和应用程序。 使用 Ubuntu 实时环境时,用户可以访问 Ubuntu 系统本身、软件和文件。当然,由于是在CD或USB上运行,所以不会对计算机硬盘进行任何更改。基本上,所有操作均在随后关闭计算机后,从 CD 或 USB 驱动器中移除即可。所谓的“实时环境”意味着所有改变都不会被致久的保存在这个系统中: 所有临时数据和更改都存放在内存中,每次重新启动都会被清除。 如果正在考虑使用 Ubuntu,但是还不确定是否要完全替换您的现有操作系统,那么试用 Ubuntu 可以是不错的开端。使用 Ubuntu 实时环境,可以体验一下 Ubuntu 的系统环境,看看这个操作系统是否适合自己的需求。也可以用它进行临时任务,比如从另一个操作系统中救出数据,或者做一些需要电脑的任务但是又不想在操作系统上安装软件的工作。最重要的是,Ubuntu 实时环境使您可以无需改变计算机配置就能使用该操作系统。 ### 回答3: Ubuntu是一种基于Linux的操作系统,可以用于普通计算机或服务器等不同应用场景。使用Ubuntu的好处在于它是免费开源的,并且具有高度的安全性和稳定性。但是,在安装Ubuntu之前,您可以使用“不安装”选项来试用该操作系统。这称为试用Ubuntu而不安装。 试用Ubuntu而不安装的方法很简单。首先,您需要下载一个Ubuntu ISO映像文件,并将其烧录到USB存储器或DVD上。然后,在计算机启动时,您需要启动电脑的BIOS或UEFI设置并选择使用USB或DVD引导的选项。接下来,您会看到一个Ubuntu启动菜单,选择“试用Ubuntu”选项即可开始体验Ubuntu操作系统。 在试用Ubuntu过程中,您可以尝试使用Ubuntu的各种功能,例如:网络、文件浏览和文本编辑等,以了解该操作系统的使用方式和通用功能。请注意,试用Ubuntu是在计算机的内存中运行Ubuntu,因此所有更改都会在关机时消失。试用Ubuntu不会安装Ubuntu在硬盘上,因此它不会影响计算机上现有的数据或文件。 试用Ubuntu的优点是,它可以让您在将Ubuntu安装在计算机之前先了解操作系统的基础功能,这样您就可以确保该操作系统能够满足您的需求。此外,它也是一个检验系统兼容性和稳定性的好方法,这可以让您决定是否要批量安装Ubuntu。 总之,试用Ubuntu而不安装是一个方便而实用的方法,可以让您深入了解Ubuntu,而不会对计算机进行任何有害更改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值