标签:名称 tables sqlite数据库 res table adf 获得 memcached 本地
一、实验说明按照官方文档搭建queens版本openstack,拓扑如下图所示:
image server,代码名称为galnce,用于存放虚拟机的映像文件,他通过一个REST API接口供用户查找映像文件的metadata并获得实际的映像文件。虚拟机映像文件可以存在本地文件系统中或者类似swift的对象存储中,metadata由终端用户或者openstack的compute组建定义。
image server通过几个周期性的进程来为其提供缓存和确保集群中映像文件的一致性和高可用。
image server由以下几个组件构成:
为简单起见,将image server安装在controller节点并将数据保存在本地文件系统上
准备工作
安装配置image server前需要先为其创建数据库,服务凭证以及API endpiont
[root@controller ~]# mysql
MariaDB [(none)]> create database glance;
MariaDB [(none)]> grant all privileges on glance.* to ‘glance‘@‘localhost‘ identified by ‘password1!‘;
MariaDB [(none)]> grant all privileges on glance.* to ‘glance‘@‘%‘ identified by ‘password1!‘;
2.使用admin身份创建glance用户并授权
[root@controller ~]# . admin-openrc
[root@controller ~]# openstack user create --domain default --password-prompt glance
[root@controller ~]# openstack role add --project service --user glance admin
[root@controller ~]# openstack service create --name glance --description "OpenStack Image" image
usage: openstack endpoint create <service> <interface> <url>
[root@controller ~]# openstack endpoint create --region RegionOne image public http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne image internal http://controller:9292
[root@controller ~]# openstack endpoint create --region RegionOne image admin http://controller:9292
安装配置
[root@controller ~]# yum install openstack-glance
[root@controller ~]# mkdir -pv /var/images
[database]
connection = mysql+pymysql://glance:password1!@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = password1!
[paste_deploy]
flavor = keystone
注销或删除[keystone_authtoken]段的其他选项,在[glance_store]段设置映像文件存放位置
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/images/
[database]
connection = mysql+pymysql://glance:password1!@controller/glance
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = glance
password = password1!
[paste_deploy]
flavor = keystone
注销或删除[keystone_authtoken]段的其他选项
[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
[root@controller ~]# mysql
MariaDB [(none)]> show databases;
MariaDB [(none)]> use glance;
MariaDB [glance]> show tables;
启动服务并设置开机自启
[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service
[root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service
标签:名称 tables sqlite数据库 res table adf 获得 memcached 本地
原文地址:http://blog.51cto.com/arkling/2134538