本帖最后由 徐超 于 2015-4-28 23:30 编辑
问题导读
1、openstack打包有哪些方法?
2、你怎么打包的?
前提
安装一台CentOS-7-x86_64-Minimal-1503-01.iso最小版的虚拟机,什么软件都不要安装,能上外网就行。
第一种方法
1、配置缓存
- # cat /etc/yum.conf
- [main]
- cachedir=/var/cache/yum/$basearch/$releasever
- keepcache=1 #设置为1,启用缓存
复制代码
2、安装源
- yum install -y http://mirrors.zju.edu.cn/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
-
- yum install -y https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm
复制代码
3、下载,并缓存OpenStack包
这里的yum install安装命令,是根据openstack官网安装文档来的。
这里,为了稍微自动化些,我把它写成了Shell脚本文件,这样就不需要手动一条条命令copy、回车执行。
- #!/bin/sh
-
- yum install -y createrepo #这是用来打包用的,生成repodata文件
-
- yum install -y ntp
-
- yum install -y yum-plugin-priorities
-
- yum install -y openstack-selinux
-
- yum install -y mariadb mariadb-server MySQL-python
-
- yum install -y rabbitmq-server
-
- yum install -y openstack-keystone python-keystoneclient
-
- yum -y install openstack-glance python-glanceclient
-
- yum install -y openstack-nova-api openstack-nova-cert openstack-novaconductor \
- openstack-nova-console openstack-nova-novncproxy openstack-novascheduler \
- python-novaclient
-
- yum install -y openstack-nova-compute sysfsutils
-
- yum install -y openstack-neutron openstack-neutron-ml2 python-neutronclient \
- which
-
- yum install -y openstack-neutron openstack-neutron-ml2 openstack-neutronopenvswitch
-
- yum install -y openstack-neutron-ml2 openstack-neutron-openvswitch
-
- yum install -y openstack-nova-network openstack-nova-api
-
- yum install -y openstack-dashboard httpd mod_wsgi memcached pythonmemcached
-
- yum install -y openstack-cinder targetcli python-oslo-db MySQL-python
-
- yum install -y openstack-swift-proxy python-swiftclient python-keystoneauth-token \
- python-keystonemiddleware memcached
-
- yum install -y xfsprogs rsync
-
- yum install -y openstack-swift-account openstack-swift-container \
- openstack-swift-object
-
- yum install -y openstack-heat-api openstack-heat-api-cfn openstack-heatengine \
- python-heatclient
-
- yum install -y mongodb-server mongodb
-
- yum install -y openstack-ceilometer-api openstack-ceilometer-collector \
- openstack-ceilometer-notification openstack-ceilometer-central \
- openstack-ceilometer-alarm \
- python-ceilometerclient
-
- yum install -y openstack-ceilometer-compute python-ceilometerclient pythonpecan
-
- yum install -y openstack-trove python-troveclient
-
- yum install -y openstack-sahara python-saharaclient
复制代码
执行脚本
- # chmod +x openstack.sh && ./openstack.sh
复制代码
4、这里,我们将/var/cache/yum/x86_64/7目录下的openstack-juno包文件夹,mv到/root/juno目录中。
- # cd /var/cache/yum/x86_64/7
- # ls
- base epel extras openstack-juno timedhosts timedhosts.txt updates
- # mv ./openstack-juno /root
复制代码
5、createrepo打包
- # pwd
- /root/openstack-juno
-
- # createrepo packages/
- Spawning worker 0 with 89 pkgs
- Workers Finished
- Saving Primary metadata
- Saving file lists metadata
- Saving other metadata
- Generating sqlite DBs
- Sqlite DBs complete
复制代码
第一种方法,你得手动解决很多依赖关系。有点笨拙。
6、使用openstack包
我们可以以rdo、手动、devstack、或其它部署方式,来灵活、方便的使用,我们自己做的本地openstack包,明显,安装非常快!
第二种方法
用wget命令,来一劳永逸的下载包,有可能仍需要解决某些依赖关系。
如下:
- # wget -c -r -np -k -L -p https://repos.fedorapeople.org/repos/openstack/openstack-juno/epel-7/
复制代码
第三种方法
接着第一种方法的第2步之后,通过rdo在线安装来缓存包。
- yum install -y openstack-packstack # 安装packstack包
- packstack --gen-answer-file /root/answer.txt # 生成一个answer-file文件
复制代码
博客
|