Openstack Grizzily 单节点测试机安装( All In One CentOS/RHEL)
Openstack Grizzily版本已经相当完善,根据官方文档安装基本不存在什么问题,但是想快速测试了解Openstack功能的用户非常多,devstack的安 装需要check最新的代码,时常碰到一些bug。这里记录一下我的单节点安装日志,尽量合并,优化一些项目以减少复杂性:
1.安装操作系统: CentOS6.4/RHEL,打开ssh, 配置root,先更新一下yum update
2.6.4的已经包含openstack-grizzly的源:
# yum install -y http://rdo.fedorapeople.org/openstack/openstack-grizzly/rdo-release-grizzly.rpm
# yum install -y http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
3.更新系统
yum update
这次更新比较多,重启一下是个好习惯.
reboot
4.关闭SELINUX,这个导致的问题可不少。
vi /etc/selinux/config
SELINUX=permissive
5.配置IP:
用setup工具更新
6.安装组件了,为了方便,一次将所有的包都装上,这里只列了一些关键包,根据依赖关系,其它的包应该都会自动装上:
yum install ntp mysql mysql-server MySQL-python openstack-utils memcached qpid-cpp-server openstack-nova-novncproxy openstack-utils openstack-keystone python-keystoneclient openstack-glance dnsmasq-utils openstack-cinder openstack-cinder-doc iscsi-initiator-utils scsi-target-utils openstack-nova python-novaclient git-core memcached python-memcached mod_wsgi openstack-dashboard tomcat6
#如果不需要支持 vmware tomcat6 可以选
6.1. RedHat 下面需要chkconfig 设置所有服务启动模式
chkconfig mysqld on;
chkconfig libvirtd on;
chkconfig qpidd on;
for svc in keystone glance-api glance-registry nova-api nova-objectstore nova-compute nova-network nova-conductor nova-console nova-consoleauth nova-metadata-api nova-xvpvncproxy nova-scheduler nova-cert; do chkconfig openstack-$svc on ; done
7. 配置本地环境变量
vi ~/novarc
export OS_TENANT_NAME=admin
export OS_TENANT_ID=30387eb46b624012bce5172ac77ab407
export OS_USERNAME=admin
export OS_PASSWORD=password
export OS_AUTH_URL="http://127.0.0.1:35357/v2.0"
export OS_REGION_NAME=RegionOne
export OS_IDENTITY_API_VERSION=2.0
export SERVICE_TOKEN=ADMIN
export SERVICE_ENDPOINT="http://127.0.0.1:35357/v2.0" echo "source ~/novarc" >> ~/.bashrc
允许ip转发
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/' /etc/sysctl.conf
8.创建mysql数据库,一次创建所有的库,可以用http://10.51.166.16/phpmyadmin界面来创建:
keystone;glance;nova;cinder;quantum;
9.配置keystone
sed -i "s/sqlite:////var/lib/keystone/keystone.db/mysql://root:password@127.0.0.1/keystone/g" /etc/keystone/keystone.conf
keystone-manage pki_setup
chown -R keystone:keystone /etc/keystone/*
user script initiate keystone data
restart keystone
初始化各个组件的数据库,Redhat下有openstack-db脚本帮我们初始化很方便:
keystone-manager db sync
openstack-db --init --service glance
glance-manage db sync
openstack-db --init --service nova
nova-manager db sync
openstack-db --init --service cinder
cinder-manager db sync
10.初始化keystone_db数据,创建用户和服务,这里使用一个脚本,粘到文件中运行,内容如下:
脚本执行完毕,正常输出:
将此id替换novarc文件中相应的值,并重新source
11. 配置glance服务
替换glance-registry.conf 和glance-api.conf中的相关变量
sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/glance/glance-registry.conf
sed -i "s/%SERVICE_USER%/service/g" /etc/glance/glance-registry.conf
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/glance/glance-registry.conf
sed -i "s/#flavor=/flavor=keystone/g" /etc/glance/glance-registry.conf
sed -i "s/sqlite:\/\/\/\/var\/lib\/glance\/glance.sqlite/mysql:\/\/root:password@127.0.0.1\/glance/g" /etc/glance/glance-registry.conf sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/glance/glance-api.conf
sed -i "s/%SERVICE_USER%/service/g" /etc/glance/glance-api.conf
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/glance/glance-api.conf
sed -i "s/#flavor=/flavor=keystone/g" /etc/glance/glance-api.conf
sed -i "s/sqlite:\/\/\/\/var\/lib\/glance\/glance.sqlite/mysql:\/\/root:password@127.0.0.1\/glance/g" /etc/glance/glance-api.conf restart glance-api
restart glance-registry
同步数据库
glance image-list
未输出东西则表示正常
12.配置libvirt
删除默认网桥
root@ubuntu:~# virsh net-destroy default
Network default destroyed root@ubuntu:~# virsh net-undefine default
Network default has been undefined
修改libvirt支持tcp监听
sed -i "s/#listen_tls = 0/listen_tls = 0/g" /etc/libvirt/libvirtd.conf
sed -i "s/#listen_tcp = 1/listen_tcp = 1/g" /etc/libvirt/libvirtd.conf
sed -i "s/#auth_tcp = "sasl"/auth_tcp = "none"/g" /etc/libvirt/libvirtd.conf sed -i "s/env libvirtd_opts=\"-d\"/env libvirtd_opts=\"-d -l\"/g" /etc/init/libvirt-bin.conf vi /etc/libvirt/qemu.conf cgroup_device_acl = [
"/dev/null", "/dev/full", "/dev/zero",
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet","/dev/net/tun"
] restart libvirt-bin
13. 配置nova
sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/nova/api-paste.ini
sed -i "s/%SERVICE_USER%/service/g" /etc/nova/api-paste.ini
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/nova/api-paste.ini
vi nova.conf
vi /etc/nova/nova-compute.conf
[DEFAULT]
libvirt_type=kvm
compute_driver=libvirt.LibvirtDriver
libvirt_ovs_bridge=br-int
libvirt_vif_type=ethernet
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
libvirt_use_virtio_for_bridges=True
同步nova 数据库
nova-manage db sync
14. 配置cinder
启用iscsi
sed -i 's/false/true/g' /etc/default/iscsitarget sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/cinder/api-paste.ini
sed -i "s/%SERVICE_USER%/service/g" /etc/cinder/api-paste.ini
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/cinder/api-paste.ini echo "sql_connection = mysql://root:password@127.0.0.1/cinder" >> /etc/cinder/cinder.conf
echo "notification_driver=cinder.openstack.common.notifier.rpc_notifier" >> /etc/cinder/cinder.conf cinder-manage db sync
如果没有未使用的分区或者磁盘,只能使用虚拟文件来代替
dd if=/dev/zero of=cinder-volumes bs= count= seek=2G
losetup /dev/loop2 cinder-volumes
fdisk /dev/loop2
#Type in the followings:
n
p ENTER
ENTER
t
8e
w
创建cinder-volumes
pvcreate /dev/loop2
vgcreate cinder-volumes /dev/loop2
15.配置quantum
sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/quantum/metadata_agent.ini
sed -i "s/%SERVICE_USER%/service/g" /etc/quantum/metadata_agent.ini
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/quantum/metadata_agent.ini sed -i "s/%SERVICE_TENANT_NAME%/service/g" /etc/quantum/quantum.conf
sed -i "s/%SERVICE_USER%/service/g" /etc/quantum/quantum.conf
sed -i "s/%SERVICE_PASSWORD%/password/g" /etc/quantum/quantum.conf
#打开LB支持
sed -i "s/# service_plugins =/service_plugins = quantum.plugins.services.agent_loadbalancer.plugin.LoadBalancerPlugin/g" /etc/quantum/quantum.conf
sed -i "s/sqlite:\/\/\/\/var\/lib\/quantum\/ovs.sqlite/mysql:\/\/root:password@127.0.0.1\/quantum/g" /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini vi /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini
在尾部增加
[OVS]
tenant_network_type = gre
tunnel_id_ranges = :
enable_tunneling = True
integration_bridge = br-int
tunnel_bridge = br-tun
local_ip = 10.51.166.16
配置open-vswitch
ovs-vsctl add-br br-int
ovs-vsctl add-br br-ex
ovs-vsctl add-port br-ex eth1
这部分可参考:
http://www.cnblogs.com/biangbiang/archive/2013/05/17/3083421.html
下面可以登录Dashboard使用了。
http://10.51.166.16/horizon
Ps: VMware vCenter 支持的nova配置
compute_driver=vmwareapi.VMwareVCDriver
vmwareapi_host_ip=<vcenter host ip>
vmwareapi_host_username=root
vmwareapi_host_password=passw0rd
vmwareapi_vlan_interface=vmnic4 (change to actually use)
vmwareapi_wsdl_loc=http://127.0.0.1:8080/SDK/vsphere-ws/wsdl/vim25/vimService.wsdl
其它的Openstack命令
不能不说Redhat在openstack项目上后来居上,做的工作更细一下
比如openstackdb 命令
还有openstack-status 可以显示状态
[root@osee ~]# openstack-status
== Nova services ==
openstack-nova-api: active
openstack-nova-cert: active
openstack-nova-compute: active
openstack-nova-network: active
openstack-nova-scheduler: active
openstack-nova-volume: inactive (disabled on boot)
openstack-nova-conductor: active
== Glance services ==
openstack-glance-api: active (disabled on boot)
openstack-glance-registry: active (disabled on boot)
== Keystone service ==
openstack-keystone: active
== Horizon service ==
openstack-dashboard: active
== Quantum services ==
quantum-server: inactive (disabled on boot)
== Cinder services ==
openstack-cinder-api: active
openstack-cinder-scheduler: active
openstack-cinder-volume: active
== Support services ==
mysqld: active
httpd: active
libvirtd: active
tgtd: active
qpidd: active (disabled on boot)
memcached: active
== Keystone users ==
+----------------------------------+--------+---------+------------------------+
| id | name | enabled | email |
+----------------------------------+--------+---------+------------------------+
| a1e75aad863a4549ba3cc27f3c14d7d6 | U1 | True | mingchun.shi@gmail.com |
| d432c382498842f087f561f742dfa6e2 | admin | True | admin@domain.com |
| 3e5d1b34aec04f40894a96625a01f0b8 | cinder | True | cinder@domain.com |
| 6f55666830f148749a97dade6f36721a | glance | True | glance@domain.com |
| 69cde8f293e74881a277f635efdfc056 | nova | True | nova@domain.com |
+----------------------------------+--------+---------+------------------------+
== Glance images ==
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
--4a37-9ca8-1a24da74dfe5 RHEL-SCO vmdk bare
3831b19f-4bf1--92c3-af0363dacf77 ReHat63_vmdk vmdk bare
af141a7b-d9ad---e203e744cac3 Centos62 qcow2 bare
bd4ded42-7e1a--b3e9-8e27a7ddaeee Ubuntu1204 qcow2 bare
d310f3b6-459e-4f76-aa8a-5fa1a88d6009 RHEL63 qcow2 bare
03db12bc-1d54-4c23-bcfe-f5be0e06f821 cirros ami ami
ae6129ce-5cc3-485e-bd78-b6ff2e5e614e cirros-ramdisk ari ari
88d25fbe-2cfb-465b-86e1-c460f0ea67d7 cirros-kernel aki aki
1691bc89-b1d1-4f8a-a8ce-3400b8cdb648 Cirros031 qcow2 bare
== Nova instance flavors ==
m1.medium: Memory: 4096MB, VCPUS: , Root: 40GB, Ephemeral: 0Gb, FlavorID: , Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.large: Memory: 8192MB, VCPUS: , Root: 80GB, Ephemeral: 0Gb, FlavorID: , Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.tiny: Memory: 512MB, VCPUS: , Root: 0GB, Ephemeral: 0Gb, FlavorID: , Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.xlarge: Memory: 16384MB, VCPUS: , Root: 160GB, Ephemeral: 0Gb, FlavorID: , Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
m1.small: Memory: 2048MB, VCPUS: , Root: 20GB, Ephemeral: 0Gb, FlavorID: , Swap: 0MB, RXTX Factor: 1.0, public, ExtraSpecs {}
== Nova instances ==
+--------------------------------------+------+--------+-----------------------+
| ID | Name | Status | Networks |
+--------------------------------------+------+--------+-----------------------+
| f716147e-ce56-4e05-b3ae-053500af6cb6 | M1 | ACTIVE | private=192.168.100.3 |
| 0928dfce-edc6-455b-a570-8922fe64287a | aaa | ACTIVE | private=192.168.100.2 |
+--------------------------------------+------+--------+-----------------------+
[root@osee ~]#
还有其它的命令
[root@osee ~]# openstack-
openstack-config openstack-db2 openstack-keystone-sample-data openstack-status
openstack-db openstack-demo-install openstack-obfuscate
Openstack Grizzily 单节点测试机安装( All In One CentOS/RHEL)的更多相关文章
- windows单节点下安装es集群
linux下的es的tar包,拖到windows下,配置后,启动bin目录下的bat文件,也是可以正常运行的. 从linux下拷的tar包,需要修改虚拟机的内存elasticsearch.in.bat ...
- ebs 12.1.1 单节点多用户安装
本次测试环境:操作系统 oracle linux 6.9 oracle ebs 12.1.1 192.168.20.210 erpapp1.hthorizon.com erpapp1 yum ...
- Oracle单节点_Grid_Infrastructure_DB_安装过程图解(三/三)
接上文: Oracle单节点_Grid_Infrastructure_DB_安装过程图解(二/三)
- Oracle单节点_Grid_Infrastructure_DB_安装过程图解(一/三)
首先进行各种准备: ASMLIB的准备,用户和目录的创建. 安装好Linux之后(采用了OEL 5.7),查看是否光盘中包含ASMLIB:
- Oracle单节点_Grid_Infrastructure_DB_安装过程图解(二/三)
接上文 Oracle单节点_Grid_Infrastructure_DB_安装过程图解(一/三) 接下来,进行Grid Infrastructure 部分的安装:
- 单节点FastDFS安装
环境:centos7 1.什么是分布式文件系统 分布式文件系统(Distributed File System)是指文件系统管理的物理存储资源不一定直接连接在本地节点上,而是通过计算机网络与节点相连. ...
- HBase单节点的安装与配置
HBase的安装配置1.下载:http://mirror.bit.edu.cn/apache/hbase/stable/ hbase-1.2.6-bin是直接编译好的,直接安装. hbase- ...
- kolla-ansible部署openstack allinone单节点
环境准备 2 network interfaces 8GB main memory 40GB disk space 1.修改hostname hostnamectl set-hostname koll ...
- kafka单节点的安装,部署,使用
1.kafka官网:http://kafka.apache.org/downloads jdk:https://www.oracle.com/technetwork/java/javase/downl ...
随机推荐
- (转)RabbitMQ消息队列(六):使用主题进行消息分发
在上篇文章RabbitMQ消息队列(五):Routing 消息路由 中,我们实现了一个简单的日志系统.Consumer可以监听不同severity的log.但是,这也是它之所以叫做简单日志系统的原因, ...
- JavaScript写选项卡
方法一: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...
- 常用的HTML标签
文本样式标签 列表标签 有序列表 语法格式: <ol> <li></li> <li></li> <li></li> ...
- Java 类成员的初始化顺序
Java 类成员的初始化顺序 前言:开发中碰到一个Java文件中有很多的成员变量,包括静态和非静态的,还有很多的初始化方法,很好奇这些成员的初始化顺序,在这里作个研究. 1 无继承情况下的Jav ...
- Ajax乱码问题
Ajax中文乱码问题 1.js代码 var userName=$("#userName").val(); var url = "user/login.action?u ...
- THREE.js代码备份——canvas_lines(随机点、画线)
<!DOCTYPE html> <html lang="en"> <head> <title>three.js canvas - l ...
- OpenGL第12-14讲小结
首先要为自己为什么没有写第10讲的控制3D场景和第11讲的红旗飘飘呢?因为没看啊~哈哈哈,而且我尝试着运行红旗飘飘的时候电脑蓝屏了(可能不是它的锅),暂时跳过了. 恩,12到14主要了解了这么些东西, ...
- GridView、DataGrid、DataList、Repeater、ListView、DetailsView、FormView
列表类 GridView 控件 GridView 控件以表的形式显示数据,并提供对列进行排序.分页.翻阅数据以及编辑或删除单个记录的功能. 特征:一行一条记录,就像新闻列表一样:带分页功能 ...
- Cllimbing Stairs [LeetCode 70]
1- 问题描述 You are climbing a stair case. It takes n steps to reach to the top. Each time you can eithe ...
- API地图坐标转化(批量转换坐标)
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...