install openstack on single host
时间过的真快,转眼一个月,回头看看,从我接触OPENSTACK已经一个月了,耗费了这么多精力,不过还是很高兴,很有收获。在安装配置过程中,反复了好几次,现在想想真的是各种小问题,导致我一度停止下来,有很多问题现在感觉都不搭边,不过对于一个新手来说(LINUX新手,OPENSTACK新手),也是好事,毕竟我现在可以完全的消化这些问题。。虽然有的问题很白痴。好了,不发感慨了,下面就整理一下我的过程吧,有些东西是我转的,在此感谢 VPSEE的文章和写http://cssoss.wordpress.com/2011/04/27/openstack-beginners-guide-for-ubuntu-11-04-installation-and-configuration/的朋友,同是感谢 北京的JANKIE,我尽可能把它写的很详细,不让大家走我的错误之路。
参考文件:OpenStack-on-C200-Tech-Note4.pdf
os-compute-admin-book.pdf
os-compute-adminguide-cactus.pdf
os-compute-devguide-cactus.pdf
这里不给链接了,我也记不清我在那里下的了,有需要的请留言,邮箱发送。
begin:
环境:openstack官方指定的操作系统是 UBUNTU,当然也可以使用其他的,比如centos,不过安装过程有可能会不同,本人使用UBUNTU11.04 SERVER,服务器为DELL R610(DELL R610在安装系统完成的时候,无法正常启动,请参考我的另外一篇文章)
由于OPENSTACK要求你的硬件支持虚拟化,所以请确认硬件部分,其次要查看你的CPU架构,我就吃亏在这了,这部如果没有确认,在后面会导致你的kernel与服务不兼容问题。
系统安装结束,我们应该做什么呢?做一些小操作,对了,有人可能会说,是不是又要看你的另外的文章。。。你说对了。。。
http://heroair.blog.51cto.com/1121997/603798 瞧这里。。。
下面正式开始喽
1:安装 桥接
Install bridge-utils:
sudo apt-get install bridge-utils
完成后,需要重新启动系统。
有人可能会问这是干什么用的,我的理解是这样的,只是我个人理解(有可能错),这是为了让虚拟机内的实例可以通过桥接的方式和外部的系统通信。
2.网络配置
既然安装了桥接,那是不是要配置网络呢,网上有一些其他的教程都配置了这段:
auto br100
|
iface br100 inet static
|
bridge_ports eth1
|
bridge_stp off
|
bridge_maxwait 0
|
bridge_fd 0
|
address 192.168.3.1
|
netmask 255.255.0.0
|
broadcast 192.168.255.255
|
但是我这里不想配置,为什么呢?
想问为什么?那你可要听好了,说来话长。。。
openstack的网络配置分三种,vlanmanager flatmanager flatdhcpmanager,不同的方式配置也是不同滴。这里我就不讲三种方式的具体的区别与配置了,请参考我列出的参考文件。我采用的是 FlatDHCPManager方式。
3:安装NTP Server
Install NTP package. This server is going to act as an NTP server for the nodes. The time on all components of OpenStack will have to be in sync. We can run NTP server on this and have other components sync to it.
sudo apt-get install ntp
|
Open the file /etc/ntp.conf and add the following 2 lines to make sure that the server serves time even when its connectivity to the Internet is down. The following settings ensure that the NTP server uses its own clock as the clock source:
server 127.127.1.0
|
fudge 127.127.1.0 stratum 10
|
Restart NTP service to make the changes effective
sudo /etc/init.d/ntp restart
|
抄过来的。这东西没啥好说的。标红的地方看下
4 . Glance
Glance is an p_w_picpath Server that Nova can use to pickup p_w_picpaths from. Glance is very modular and can use several types of storage backends such as filestore, s3 etc. We are installing Glance before installing Nova, so that when we get to configuring Nova, glance is ready to be used by Nova.
sudo apt-get install glance
|
The default config file at /etc/glance/glance.conf is good to use for a simple file store as the storage backend. Glance can be configured to use other storage backends such as swift. This will be covered in more detail in the chapter on “Image Management”.
Glance uses sqlite as the default database backend. While sqlite offers a quick and easy way to get started, for production use, you may consider a database such as MySQL or Postgresql. This will be covered in more detail in the chapter on “Image Management”
Glance has two components – glance-api and glance-registry. These can be controlled using the concerned upstart jobs.
这步还是比较重要的,毕竟和NOVA有直接关系吗。不过安装没什么好说的,基本没出现过什么问题。
5.安装MYSQL
Install mysql-server package
sudo apt-get install -y mysql-server
|
安装完成后需要对MYSQL做一些配置
首先是/etc/mysql/my.cnf这个文件,找到下面这行:
bind-address 127.0.0.1
将127.0.0.1 改成 0.0.0.0,这样做是为了让其他的节点服务器也可以访问这个数据库。配置好了,重启mysql 服务吧!
sudo /etc/init.d/mysql restart
好了,我们现在就可以登录mysql了:mysql -u user -p password
有人可能没有设置密码(我是在安装操作系统的时候设置的),怎么弄呢? 用命令设置一下吧:mysqladmin -u root password yourpassword
然后就是和NOVA相关的了,我们要创建NOVA的数据库,并且对权限做一下设置。
Create a database named nova.
sudo mysql -uroot -p password -e 'CREATE DATABASE nova;'
|
Update the database to grant super user privileges for root user to login from any IP.
sudo mysql -uroot -p password -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"
|
Set mysql root password for login from any IP.
|
sudo apt-get install -y euca2ools
安装解压工具
sudo apt-get install -y unzip
|
好了,安完了,开始配置了。
NOVA中最重要的一个配置文件叫 NOVA.CONF位于 /etc/nova/nova.conf
下面我就把我的贴出来:
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--lock_path=/var/lock/nova
--network_manager=nova.network.manager.FlatDHCPManager
--flat_network_dhcp_start=192.168.3.2
--flat_injected=False
--public_interface=eth0(我的物理网卡)
--verbose
--s3_host=172.16.150.237(我的IP)
--rabbit_host=172.16.150.237
--cc_host=172.16.150.237
--network_size=8
--FAKE_subdomain=ec2
--routing_source_ip=172.16.150.237
--p_w_picpath_service=nova.p_w_picpath.glance.GlanceImageService
--ec2_url=http://172.16.150.237:8773/services/Cloud
--sql_connection=mysql://root:*****@172.16.150.237/nova
--glance_host=172.16.150.237
--fixed_range=192.168.3.0/24(虚机的私网地址)
--iscsi_ip_prefix=172.16.150
大家注意了,我是单机的,如果多个配置是不同的。可以参考其他教程。
Enable iscsi target.
sudo sed -i 's/false/true/g' /etc/default/iscsitarget
|
Restart the iscsitarget service.
sudo service iscsitarget restart
|
Create a Physical Volume.
sudo pvcreate /dev/sda6
|
(/dev/sda6根据实际情况修改)
Create a Volume Group named.
sudo vgcreate nova-volumes /dev/sda6
|
Create a group called “nova”
sudo groupadd nova
|
Change the ownership of the /etc/nova folder and permissions for /etc/nova/nova.conf:
sudo chown -R root:nova /etc/nova
|
sudo chmod 644 /etc/nova/nova.conf
|
Restart all the nova related services.
sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry
|
Create nova schema in the Mysql Database.
sudo nova-manage db sync
|
Create a list of Ips to be used from the network of fixed Ips set inside nova.conf.
sudo nova-manage network create 192.168.3.0/24 1 256
|
Allocate 32 Pubic IP addresses for use with the instances starting from 10.10.10.225.
sudo nova-manage floating create 10.10.10.2 10.10.10.224/27
|
Create a user with admin rights on nova.
sudo nova-manage user admin novaadmin
|
(这个novaadmin目前来说没什么用处,后面再dashboard中会用到)
Create a project named proj.
1
|
sudo nova-manage project create proj novaadmin
|
Create a directory to download nova credentials and download the zip file.
mkdir /home/localadmin/creds
|
(这里的localadmin是你系统的用户,就是你安装系统时输入的用户)
Generate and save credentials for accessing/managing the nova cloud.
sudo nova-manage project zipfile proj novaadmin /home/localadmin/creds/novacreds.zip
|
Contents of novacreds.zip are required to use euca2ools to manage the cloud infrastructure and you will need to transfer this zip file to any machine from where you want to run the commands from euca2ools. We will be using these credentials from client1 as well.
Navigate in to the folder created and extract the files and change their ownership.
cd /home/localadmin/creds
|
unzip novacreds.zip
|
sudo chown localadmin:localadmin /home/localadmin/creds/ -R
|
Here are the files extracted:
cacert.pem, cert.pem, novarc, pk.pem
novarc contains several environmental variables including your nova credentials to be set before you can use the commands from euca2ools such euca-describe-p_w_picpaths, euca-describe-instances etc. these variables can be set by sourcing novarc file.
source /home/localadmin/creds/novarc
|
Restart all the nova related services.
sudo /etc/init.d/libvirt-bin restart; sudo restart nova-network; sudo restart nova-compute; sudo restart nova-api; sudo restart nova-objectstore; sudo restart nova-scheduler; sudo restart nova-volume; sudo restart glance-api; sudo restart glance-registry
|
Check if the credentials are working and if nova has been setup properly by running:
euca-describe-availability-zones verbose
|
If you see something like the following with all components happy, it means that the set up is ready to be used.
1
|
AVAILABILITYZONE nova available
|
2
|
AVAILABILITYZONE |- server1
|
3
|
AVAILABILITYZONE | |- nova-compute enabled : -) 2011-04-03 07:48:50
|
4
|
AVAILABILITYZONE | |- nova-scheduler enabled : -) 2011-04-03 07:48:48
|
5
|
AVAILABILITYZONE | |- nova-network enabled : -) 2011-04-03 07:48:49
|
6
|
AVAILABILITYZONE | |- nova-volume enabled : -) 2011-04-03 07:48:49
|
基本上到这里就告一段落了。
下面我会接着将如何将你的IMG发布到云里。
未完待续!!!累了,明天写
转载于:https://blog.51cto.com/heroair/616778
install openstack on single host相关推荐
- Install Openstack with Openvswitch Plugin of Quantum on rhel6.3 by RPM Way ( by quqi99 )
Install Openstack with Openvswitch Plugin of Quantum on rhel6.3 by RPM Way ( by quqi99 ) 作者:张华 发表于: ...
- Centos7 install Openstack - (第三节)添加镜像服务(Glance)
Centos7 install Openstack - (第三节)添加镜像服务(Glance) 我的blog地址:http://www.cnblogs.com/caoguo 该文根据openstack ...
- Cloud in Action: Install OpenStack Ocata from scratch
Cloud in Action: Install OpenStack Ocata from scratch 薛国锋 xueguofeng2011@gmail.com OpenStack c ...
- Install OpenStack on rhel6.2 ( by quqi99 )
Install OpenStack on rhel6.2 ( by quqi99 ) 作者:张华 发表于:2013-04-17 版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者 ...
- Install OpenStack Kilo Dashboard wiht Nginx + uWSGI On RHEL7.1
一.安装Horizon.Nginx.uWSGI yum install -y uwsgi-plugin-python openstack-dashboard uwsgi nginx 二.配置uWSGI ...
- openstack 无法创建新虚拟机报错 openstack报错:Host is not mapped to any cell
关联错误提示:Host is not mapped to any cell 控制节点上执行: root@ubsv:/home/makeit# nova-manage cell_v2 discover_ ...
- 云计算相关资料/博客/网上收集的关于OpenStack的一些资源
2019独角兽企业重金招聘Python工程师标准>>> OpenStack Nova code: https://bugs.launchpad.net/nova OpenStack ...
- Cloud Prizefight: OpenStack vs. VMware(转)-HA-FT
2019独角兽企业重金招聘Python工程师标准>>> There have been many discussions in the cloud landscape compari ...
- OpenStack Train Magnum部署Kubernetes(1)--部署OpenStack Train
基于Packstack部署OpenStack Train版本 部署环境 操作系统:CentOS Linux release 7.7.1908 OpenStack:Train PackStack:ope ...
最新文章
- Python 三元条件判断表达式(and or/if else)
- 花了一上午,终于完成了作业
- 1071 mysql_mysql 出现1071错误怎么办
- Deep Learning科普帖
- vs2017运行显示系统找不到指定的文件_windows 平台使用 VS2017 编译 libevent 源码
- AndroidL的checkPermission方法详解
- fork与操作文件的系统调用问题
- Android中简单的日期格式化
- okHttp记录---response.body().string()输出的结构是乱码
- C++ 设计模式 —— 控制器设计模式(实现功能模块间通信)
- Windows10如何安装windows terminal
- [MySQL]SQL优化工具SQLAdvisor
- python相关系数显著性检验_Python+pandas计算数据相关系数的实例
- Quidway S系列交换机
- myeclipse导入项目的问题,无法next
- python 爬虫保存为word_微信公众号文章爬虫,本地word文档保存
- Android个人简历自我评价,Android开发工程师岗位个人简历自我评价范文
- php 表格内边距,CSS 内边距
- Rational Rose 2007 使用方法
- 给我一把利剑,待我重整山河
热门文章
- 高考成绩查询2021艺术类6,2021年高考成绩6月26日左右可查!
- 技术开发项目收获了什么_有幸入职字节跳动一年,附上百度、字节跳动等后台面经,谈谈我的收获!...
- YYAnimatedImageView--gif在ios14之后只能播放一次
- 计算机计量g代表,计算机中的有些计量单位例如G、MB是表示什么意思?
- 批量探测工具fpingping常用命令集合大学霸IT达人
- native react ssh_React Native踩坑笔记(持续更新中...)
- 怎么使用oracle的加权平均数_GPA不足,怎么短期有效提升?快来收获100%录取的秘诀!...
- 灰色关联投影法python_python灰色关联算法(灰度关联算法)
- sudo apt-get update E: Some index files failed to download. They have been ignored, or old ones use
- seaborn系列 (9) | 分簇散点图swarmplot()