当前位置:网站首页>如何同步openstack RDO源至本地进行离线安装
如何同步openstack RDO源至本地进行离线安装
2022-06-11 12:28:00 【山金孝】
1.rsync
2.reposync
第一种方案参考如下段程序:
#!/bin/bash
#Script name:rsync_yumrepo.sh
RsyncBin="/usr/bin/rsync"
RsyncPerm='-avrt --delete --no-iconv --bwlimit=1000'
Centos_7_epel='/data/yum_repo/Centos-7/epel/'
LogFile='/data/yum_repo/rsync_yum_log'
Date=`date +%Y-%m-%d`
#check
function check {
if [ $? -eq 0 ];then
echo -e "\033[1;32mRsync is success!\033[0m" >>$LogFile/$Date.log
else
echo -e "\033[1;31mRsync is fail!\033[0m" >>$LogFile/$Date.log
fi
}
if [ ! -d "$LogFile" ];then
mkdir $LogFile
fi
#rsync centos 5 base
#echo 'Now start to rsync centos 5 base!' >>$LogFile/$Date.log
#$RsyncBin $RsyncPerm rsync://mirrors.yun-idc.com/centos/5/os/ $Centos_5_base >>$LogFile/$Date.log
#check
#rsync centos 5 epel
echo 'Now start to rsync centos 5 epel!' >>$LogFile/$Date.log
$RsyncBin $RsyncPerm --exclude=SRPMS/ --exclude=ppc64/ rsync://dl.fedoraproject.org/pub/epel/7/x86_64 $Centos_7_epel >>$LogFile/$Date.log
check
语法为:rsync [option] resource destination
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
rsync is a file transfer program capable of efficient remote update
via a fast differencing algorithm.
Usage: rsync [OPTION]... SRC [SRC]... DEST
or rsync [OPTION]... SRC [SRC]... [[email protected]]HOST:DEST
or rsync [OPTION]... SRC [SRC]... [[email protected]]HOST::DEST
or rsync [OPTION]... SRC [SRC]... rsync://[[email protected]]HOST[:PORT]/DEST
or rsync [OPTION]... [[email protected]]HOST:SRC [DEST]
or rsync [OPTION]... [[email protected]]HOST::SRC [DEST]
or rsync [OPTION]... rsync://[[email protected]]HOST[:PORT]/SRC [DEST]
The ':' usages connect via remote shell, while '::' & 'rsync://' usages connect
to an rsync daemon, and require SRC or DEST to start with a module name.
rsync将会把resource中的RPM包下载到指定的目录中。
2.reposync
reposync比价简单,其简单用法为rsync -repoid repository-id
可以用yum repolist查看repo的ID
yum repolist
[[email protected] openstack-common]# yum repolist
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repo id repo name status
centos-iso CentOS-ISO 3576
epel Extra Packages for Enterprise Linux 7 - x86_64 8327
epel-debuginfo Extra Packages for Enterprise Linux 7 - x86_64 - Debug 1919
openstack-kilo OpenStack Kilo Repository 280
openstack-kilo-common openstack kilo common 493
repolist: 14595
如上,同步epel到本地当前目录:
reposync -repoid=epel
reposync的前提是先在系统里面安装repository库,然后到远程repository去下载rpm包。例如可以先安装rdo的openstack-kilo库:
yum insatll http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm
安装完成之后将会在/etc/yum.repos.d目录下生成openstack-kilo.repo的文件,此时即可yum repolist 查看到。
3.制作本地yum源
简单创建repository的命令如下:
createrepo -update --baseurl=packages_dir packages_dir #packages_dir是包含所有rpm包的绝对路径
此命令将会把package_dir目录下的包生成repository,在该目录下会生成repodata子目录,然后在/etc/yum.repos.d目录下编辑.repo文件
[openstack-kilo]
name=OpenStack Kilo Repository
#baseurl=http://repos.fedorapeople.org/repos/openstack/openstack-kilo/el7/
baseurl=file:///data/yum_repo/rdo-openstack-kilo/openstack-kilo
skip_if_unavailable=0
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RDO-kilo
然后刷新:yum clean all;yum makecache即可。
边栏推荐
- Adobe Premiere foundation - batch material import sequence - variable speed and rewind (recall) - continuous action shot switching - subtitle requirements (13)
- 4. Locksupport and thread interruption
- Niu Mei and 01 Chuan
- Adobe Premiere基础-批量素材导入序列-变速和倒放(回忆)-连续动作镜头切换-字幕要求(十三)
- PADS使用之繪制原理圖
- How can mechanical equipment manufacturing enterprises manage outsourcing with the help of ERP system?
- Schéma de dessin utilisé par les Pads
- 美容院管理系统如何解决门店运营的三大难题?
- How does the beauty salon management system solve the three problems of store operation?
- . 4 literal and variable
猜你喜欢

非标自动化设备制造企业,如何借助ERP系统实现快速精准报价?

Workload management of Splunk best practices

How can I use a domain name to access a website?

【后台交互】select 绑定后台传递的数据

Oracle DatabaseLink cross database connection

Moist or not? This is a problem

How to optimize SEO on the mobile terminal? Do you need to optimize GoogleSEO on the mobile terminal for a separate m domain name?

经营养生理疗馆要注意什么问题?

4、LockSupport与线程中断

综合场馆的优势有哪些?
随机推荐
美容院管理系统如何解决门店运营的三大难题?
Splunk certificate expired, making kV store unable to start
7、CAS
C# System.Guid.NewGuid() 格式化
9. Talk about ThreadLocal
oracle数据库中 instr函数的用法
What are the ways for badminton halls to generate income
Venue floor efficiency is so low? The key lies in these two aspects
ASCII, Unicode, and UTF-8
知物由学 | 行为时序建模在社交引流黑产识别中的应用
CMD of Jerry's AI protocol_ SET_ BLE_ Visibility [chapter]
2022 vmvare download and installation tutorial on the latest official website (ultra detailed)
Some common websites
[ArcGIS]城市关联度分析
In the list of 618 projector hedging brands in 2022, dangbei projection ranked top 1 in the hedging rate of idle fish
Technical difficulties of secsha
Audio adaptation of openharmony Standard System Porting
What are the elements of running a gymnasium?
Format of Jerrys at protocol package [chapter]
石头科技:研发实力和过硬品质 助力扫地机器人产业升级