Ubuntu源码安装Openstack(三)
2015-12-03 18:05
369 查看
一、创建数据库
二、应用脚本登录创建glance用户
三、创建镜像服务API端点
mysql -u root -p
CREATE DATABASE glance; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'GLANCE_DBPASS'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'GLANCE_DBPASS';
二、应用脚本登录创建glance用户
source admin-openrc.sh openstack user create --domain default --password-prompt glance openstack role add --project service --user glance admin openstack service create --name glance --description "OpenStack Image service" image
三、创建镜像服务API端点
openstack endpoint create --region RegionOne image public http://horizon:9292 openstack endpoint create --region RegionOne image internal http://horizon:9292 openstack endpoint create --region RegionOne image admin http://horizon:9292[/code]
四、镜像服务(glance)的源码安装开始
将tar包考入操作文件夹中,然后进行安装cd glance-11.0.0/ vim requirements.txt 注释 #Routes!=2.0,!=2.1,>=1.12.3;python_version=='2.7' #Routes!=2.0,>=1.12.3;python_version!='2.7' pip install -r requirements.txt python setup.py install cd ../ cd python-glanceclient-1.2.0/ vim requirements.txt 注释 #Routes!=2.0,!=2.1,>=1.12.3;python_version=='2.7' #Routes!=2.0,>=1.12.3;python_version!='2.7' pip install -r requirements.txt python setup.py install cd ../
将配置文件考入etc下cd glance-11.0.0/ cp -R etc /etc/glance chown -R laks:laks /etc/glance
编辑/etc/glance/glance-api.conf
复制备份以及去除注释cp /etc/glance/glance-api.conf /etc/glance/glance-api.conf.bak cat /etc/glance/glance-api.conf.bak | grep -v '^#'| grep -v '^$'> /etc/glance/glance-api.conf[DEFAULT] notification_driver = noop verbose = True [database] connection = mysql+pymysql://glance:GLANCE_DBPASS@horizon/glance [glance_store] default_store = file filesystem_store_datadir = /var/lib/glance/images/ [image_format] [keystone_authtoken] auth_uri = http://horizon:5000 auth_url = http://horizon:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = glance password = glance [matchmaker_redis] [matchmaker_ring] [oslo_concurrency] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] [oslo_policy] [paste_deploy] flavor = keystone [store_type_location_strategy] [task] [taskflow_executor]
编辑/etc/glance/glance-registry.confcp /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.bak cat /etc/glance/glance-registry.conf.bak | grep -v '^#'| grep -v '^$'> /etc/glance/glance-registry.conf[DEFAULT] notification_driver = noop verbose = True [database] connection = mysql+pymysql://glance:GLANCE_DBPASS@horizon/glance [glance_store] [keystone_authtoken] auth_uri = http://horizon:5000 auth_url = http://horizon:35357 auth_plugin = password project_domain_id = default user_domain_id = default project_name = service username = glance password = glance [matchmaker_redis] [matchmaker_ring] [oslo_messaging_amqp] [oslo_messaging_qpid] [oslo_messaging_rabbit] [oslo_policy] [paste_deploy] flavor = keystone
添加用户useradd glance mkdir -p /home/glance
同步数据库并且重启服务su -s /bin/sh -c "glance-manage db_sync" glance glance-control api start glance-control registry start 若是服务已经起来 service glance-registry restart service glance-api restartrm -f /var/lib/glance/glance.sqlite
五、验证服务echo "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh source admin-openrc.sh wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img[/code]glance image-create --name "cirros" \ --file cirros-0.3.4-x86_64-disk.img \ --disk-format qcow2 --container-format bare \ --visibility public --progressglance image-list+--------------------------------------+--------+ | ID | Name | +--------------------------------------+--------+ | 4e53b72d-7771-4498-99cf-dce8035a92df | cirros | +--------------------------------------+--------+
相关文章推荐
- 迅为iTOP-4412开发板Ubuntu操作系统烧写方法
- How can I install mySQL on CentOS without being root/su?
- 使用dos指令快速导出手机文件
- Linux学习之创建子进程
- 创建自己的CA机构 - openssl cert 双向认证
- 使用OpenSSL生成证书
- Linux安装jdk
- 【django】Nginx+uWSGI+Django部署我的博客网站
- selenium自动化测试实现对网站的登陆(使用java编写)
- samba configure on Cent OS 6.4
- 告警信息大爆炸,运维解放秘籍!
- 工作常用Linux命令
- 文章标题
- Linux FSCK数据出错的灾难应急方案介绍
- 告警信息大爆炸,运维解放秘籍!
- linux系统端口映射(路由转发)
- centos和ubuntu下使用cron设置定时任务
- Linux学习笔记(七、文件搜索命令locate)
- nginx是以多进程的方式来工作的
- linux--head命令