码迷,mamicode.com
首页 > 其他好文 > 详细

OpenStack之五: image镜像服务(端口9292)

时间:2019-08-30 22:47:19      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:one   用户   use   registry   qcow2   check   htm   code   key   

官网地址:https://docs.openstack.org/glance/stein/install/install-rdo.html

#:创建glance库,并授权

MariaDB [(none)]> CREATE DATABASE glance;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO glance@%    IDENTIFIED BY glance123;

#:加载环境变量

[root@localhost ~]# source scripts/admin-stein.sh

#:创建glance用户


[root@localhost ~]# openstack user create --domain default --password-prompt glance

#:给admin项目添加一个glance用户,并加入到service角色

[root@localhost ~]# openstack role add --project service --user glance admin

#:创建一个类型为image的service

[root@localhost ~]# openstack service create --name glance   --description "OpenStack Image" image

#: 注册API

[root@localhost ~]# openstack endpoint create --region RegionOne image public http://www.magedu.net:9292
[root@localhost ~]# openstack endpoint create --region RegionOne image internal http://www.magedu.net:9292
[root@localhost ~]# openstack endpoint create --region RegionOne image admin http://www.magedu.net:9292

#:安装glance包

[root@localhost ~]# yum install openstack-glance -y

#:配置

[root@localhost ~]# vim /etc/glance/glance-api.conf
[database]

#
connection = mysql+pymysql://glance:glance123@www.magedu.net/glance
[keystone_authtoken]

#
www_authenticate_uri  = http://www.magedu.net:5000
auth_url = http://www.magedu.net:5000
memcached_servers = www.magedu.net:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance
[paste_deploy]

#
flavor = keystone

[root@localhost ~]# vim /etc/glance/glance-registry.conf
[database]

#
connection = mysql+pymysql://glance:glance123@www.magedu.net/glance
[keystone_authtoken]

#
www_authenticate_uri = http://www.magedu.net:5000
auth_url = http://www.magedu.net:5000
memcached_servers = www.magedu.net:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = glance

[paste_deploy]

#
flavor = keystone

#:修改haproxy配置文件

[root@localhost ~]# vim /etc/haproxy/haproxy.cfg
listen mysqlserver
bind 192.168.7.101:11211
mode tcp
server mysql 192.168.7.105:11211 check inter 2s fall 3 rise 5

#:重启服务

[root@localhost ~]# systemctl restart haproxy

#:初始化数据库

[root@localhost ~]# su -s /bin/sh -c "glance-manage db_sync" glance

#:启动服务

[root@localhost ~]#  systemctl enable openstack-glance-api.service   openstack-glance-registry.service
[root@localhost ~]# systemctl start openstack-glance-api.service   openstack-glance-registry.service
官网地址:https://docs.openstack.org/glance/stein/install/verify.html

#:测试

#: 加载环境变量

[root@localhost ~]# source scripts/admin-stein.sh 

#:下载镜像

[root@localhost ~]# wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img

#:创建镜像

[root@localhost ~]# openstack image create "cirros-0.4.0" --file /root/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public

#:列出镜像

[root@localhost ~]# openstack image list

 

OpenStack之五: image镜像服务(端口9292)

标签:one   用户   use   registry   qcow2   check   htm   code   key   

原文地址:https://www.cnblogs.com/maxuebin/p/11437378.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!