首先登录kxcontroller1创建kx_glance数据库,并赋于远程和本地访问的权限。
mysql -u root -p
CREATE DATABASE kx_glance;
GRANT ALL PRIVILEGES ON kx_glance.* TO 'glance'@'localhost' IDENTIFIED BY 'venic8888';
GRANT ALL PRIVILEGES ON kx_glance.* TO 'glance'@'%' IDENTIFIED BY 'venic8888';
flush PRIVILEGES;
二、身份认证调用创建
只在kxcontroller1一台上执行即可
source admin-openrc.sh
创建glance用户的密码,我统一配glance
openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field | Value |
+-----------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | e38230eeff474607805b596c91fa15d9 |
| name | glance |
+-----------+----------------------------------+
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image service" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| name | glance |
| type | image |
+-------------+----------------------------------+
openstack endpoint create --region RegionTwo image public http://kxcontroller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 340be3625e9b4239a6415d034e98aace |
| interface | public |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://kxcontroller:9292 |
+--------------+----------------------------------+
openstack endpoint create --region RegionTwo image internal http://controller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | a6e4b153c2ae4c919eccfdbb7dceb5d2 |
| interface | internal |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://kxcontroller:9292 |
+--------------+----------------------------------+
openstack endpoint create --region RegionTwo image admin http://kxcontroller:9292
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 0c37ed58103f4300a84ff125a539032d |
| interface | admin |
| region | RegionTwo |
| region_id | RegionTwo |
| service_id | 8c2c7f1b9b5049ea9e63757b5533e6d2 |
| service_name | glance |
| service_type | image |
| url | http://kxcontroller:9292 |
+--------------+----------------------------------+
三、下载安装glance组件
2台kxcontroller同时下载
yum install openstack-glance python-glance python-glanceclient -y
controller修改配置api文件
在kxcontroller1上
[root@kxcontroller1 ~]# vi /etc/glance/glance-api.conf
[DEFAULT]
notification_driver = noop
verbose = True
rpc_backend = rabbit
bind_host = 10.120.42.1
bind_port = 9292
registry_host=10.120.42.10
registry_port=9191
[database]
connection = mysql://glance:venic8888@kxcontroller/kx_glance
[keystone_authtoken]
auth_uri = http://kxcontroller:5000
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
[glance_store]
default_store = file
filesystem_store_datadir = /home/local/glance/images/
在kxcontroller2上
[root@kxcontroller2 ~]# vi /etc/glance/glance-api.conf
[DEFAULT]
notification_driver = noop
verbose = True
rpc_backend = rabbit
bind_host = 10.120.42.2
bind_port = 9292
registry_host=10.120.42.10
registry_port=9191
[database]
connection = mysql://glance:venic8888@kxcontroller/kx_glance
[keystone_authtoken]
auth_uri = http://kxcontroller:5000
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
[glance_store]
default_store = file
filesystem_store_datadir = /home/local/glance/images/
配置完成后,两台kxcontroller需要创建目录
mkdir -p /home/local/glance/images/
chown -R glance:glance /home/local/glance
两台kxcontroller修改配置registry文件
在kxcontroller1上
vi /etc/glance/glance-registry.conf
[DEFAULT]
notification_driver = noop
verbose = True
rpc_backend = rabbit
bind_host = 10.120.42.1
bind_port = 9191
[database]
connection = mysql://glance:venic8888@kxcontroller/kx_glance
[keystone_authtoken]
auth_uri = http://kxcontroller:5000
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
在kxcontroller2上
vi /etc/glance/glance-registry.conf
[DEFAULT]
notification_driver = noop
verbose = True
rpc_backend = rabbit
bind_host = 10.120.42.2
bind_port = 9191
[database]
connection = mysql://glance:venic8888@kxcontroller/kx_glance
[keystone_authtoken]
auth_uri = http://kxcontroller:5000
auth_url = http://kxcontroller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
其中一台kxcontroller同步数据库
su -s /bin/sh -c "glance-manage db_sync" glance
2台kxcontroller都启动服务,加入开机自启
# systemctl enable openstack-glance-api.service openstack-glance-registry.service
# systemctl start openstack-glance-api.service openstack-glance-registry.service
注意点:
验证,查看haproxy工作是否正常,是否变绿色。
在其中带有VIP的controller上创建一个镜像,介时镜像包会放置在VIP的kxcontroller的/home/local/glance/images/下,另外1台没有。后续我们可以使用文件Rsync同步功能将他们同步
添加环境变量配置文件,2台都要加
cd /root/
echo "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh
source admin-openrc.sh
glance image-create --name "cirros" \
--file cirros-0.3.4-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--visibility public --progress
[=============================>] 100%
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 133eae9fb1c98f45894a4e60d8736619 |
| container_format | bare |
| created_at | 2015-03-26T16:52:10Z |
| disk_format | qcow2 |
| id | 38047887-61a7-41ea-9b49-27987d5e8bb9 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | ae7a98326b9c455588edd2656d723b9d |
| protected | False |
| size | 13200896 |
| status | active |
| tags | [] |
| updated_at | 2015-03-26T16:52:10Z |
| virtual_size | None |
| visibility | public |
+------------------+--------------------------------------+
验证镜像文件是否存在,以备后续调用
glance image-list
- openstack私有云布署实践【7.1 keystone + memcache (科兴环境)】
其实登录数据库集群中任意1台都可以创建库,它们会实时自动同步数据库和对应的数据库权限. 首先登录kxcontroller1创建kx_keystone数据库,并赋于远程和本地访问的权限. mys ...
- openstack私有云布署实践【2 安装前的服务器基本环境准备】
服务器物理机都安装centos7.2 1511版本 , 此次采用的分区方式全是自动XFS格式LVM,在装系统时就将所有本地raid5硬盘都加入LVM全用了.默认/home目录有着最大的硬盘空间 并且我 ...
- openstack私有云布署实践【7.2 keystone + memcache (办公网环境)】
首先登录controller1创建keystone数据库,并赋于远程和本地访问的权限. mysql -u root -p CREATE DATABASE keystone; GRANT ALL P ...
- openstack私有云布署实践【12.2 网络Neutron-controller节点配置(办公网环境)】
网络这一块推荐使用的是 Neutron--LinuxBirdge的Ha高可用,此高可用方案对Public作用不是很大,Public只用到DHCP,而Private则会用到L3 Agent,则此方案是有 ...
- openstack私有云布署实践【12.1 网络Neutron-controller节点配置(科兴环境)】
网络这一块推荐使用的是 Neutron--LinuxBirdge的Ha高可用,此高可用方案对Public作用不是很大,Public只用到DHCP,而Private则会用到L3 Agent,则此方案是有 ...
- openstack私有云布署实践【0 前言】
管理控制层面示图: 其实在修改这个布署文档是,我发现当时生产中的布署已经严重偏离了openstack高可用的指导思想.我们自己实践的高可用其实是适应自己的架构而做的调整,因为我们现实手头上中没有比较符 ...
- openstack私有云布署实践【9.3 主从controller单向同步glance-image目录】
采用Rysnc单向同步,而不用双方实时同步,原因是在历史的运行过程中,我们发现,有些镜像包太大,当在主用的glance将镜像保存时,并不是一时半会就把镜像保存好,当主用在保存时,备用节点又在实时同步那 ...
- openstack私有云布署实践【9.2 Glance镜像管理(办公网环境)】
首先登录controller1创建glance数据库,并赋于远程和本地访问的权限. mysql -u root -p CREATE DATABASE glance; GRANT ALL ...
- openstack私有云布署实践【14.2 登录页dashboard-controller(办公网环境)】
这一小节基本配置相同,但留意以下紫色部份的配置,当初为了管理方便,我们让办公网openstack的dashboard的登录桥接了科兴的dashboard,由此统一dashboard界面的登录地址 ...
随机推荐
- VMWare 11安装操作系统 - 初学者系列 - 学习者系列文章
在2010年的时候,我写过一篇关于VMWare的安装操作系统的博文.但是今天在QQ群里有人问起VMWare安装操作系统的问题,虽然回答了,但是回头看了下当时那篇博文,决定重新写一文. 首先要获取VMW ...
- C#中文本模板(.tt)
关于C#中文本模板(.tt)的简单应用 这两天做项目突遇 .tt文件,之前没有接触过,so查询学习做笔记,帮助记忆和后来者. 在项目添加中点击选择文本模板 下面贴出代码,做了简单的注释 1 2 3 4 ...
- mvc @html.editor怎么修改宽度 和其他属性
<style type="text/css"> #dob { width:6em; } </style> @using (Html.BeginForm()) ...
- ASP.NET MVC+Knockout+Web API+SignalR
架构设计(ASP.NET MVC+Knockout+Web API+SignalR) 架构设计(ASP.NET MVC+Knockout+Web API+SignalR) 2014-01-16 18: ...
- SZU:A25 Favorite Number
Judge Info Memory Limit: 32768KB Case Time Limit: 10000MS Time Limit: 10000MS Judger: Number Only Ju ...
- C++ 顺序容器 vector list deque 之比较
在C++标准库中定义了三种顺序容器类型:vector,list和deque.所谓顺序容器就是根据位置来存储和访问元素,元素的排列次序与元素的值无关,而是由元素添加到容器的次序决定的. vector的底 ...
- 【转】jQuery each函数中的continue及break
continue :return true; break :return false; 也可以利用return即可跳出jQuery 来源:http://bie.xiaowangge.info/brow ...
- 【转载】Stack Overflow: The Architecture - 2016 Edition
转载:http://www.infoq.com/cn/news/2016/03/Stack-Overflow-architecture-insi?utm_source=tuicool&utm_ ...
- 在VMware的Linux系统上安装Redis
在VMware的Linux系统上安装Redis 具体过程如下: 下载,解压和编译: 在执行make的时候报错,具体报错信息如下: zmalloc.o: In function `zmalloc_use ...
- Android开发过程中git、repo、adb、grep等指令的使用
chown 是一条在Unix系统中用于设置文件所有者和文件关联组的命令. 需要超级用户的权限才能执行此命令.只有超级用户和属于组的文件所有者才能变更文件关联组.非特权用户(非超级用户)如需要设置关联组 ...