当前位置:网站首页>How to synchronize openstack RDO source to local for offline installation
How to synchronize openstack RDO source to local for offline installation
2022-06-11 12:52:00 【Shan Jinxiao】
1.rsync
2.reposync
The first scheme refers to the following procedures :
#!/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
The grammar is :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 It will put resource Medium RPM Download the package to the specified directory .
2.reposync
reposync Simple price comparison , Its simple usage is rsync -repoid repository-id
It can be used yum repolist see repo Of 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
Above , Sync epel To the local current directory :
reposync -repoid=epel
reposync The premise is to install in the system first repository library , Then to remote repository To download rpm package . For example, you can install rdo Of openstack-kilo library :
yum insatll http://rdo.fedorapeople.org/openstack-kilo/rdo-release-kilo.rpm
After the installation, it will be installed in /etc/yum.repos.d Generate under directory openstack-kilo.repo The file of , At this point yum repolist Check out .
3. Make local yum Source
Simply create repository The command is as follows :
createrepo -update --baseurl=packages_dir packages_dir #packages_dir It's all about rpm The absolute path of the package
This command will put package_dir Package generation under Directory repository, In this directory will generate repodata subdirectories , And then in /etc/yum.repos.d Edit under directory .repo file
[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
And then refresh :yum clean all;yum makecache that will do .
边栏推荐
- ASCII, Unicode, and UTF-8
- Matrix elimination game
- DB2数据库重建及表数据迁移探讨研究
- C#事件总线
- imx6ul开发板移植主线u-boot之EMMC启动流程
- Master-slave replication of MySQL
- 【bug解决】上传图片后,取消这次上传 再次执行上传,上次的图片还存在
- How can non-standard automation equipment manufacturing enterprises achieve rapid and accurate quotation with the help of ERP system?
- How about Lenovo Xiaoxin 520? Which is more worth buying than dangbei D3x?
- Where is it safer to open an account for soda ash futures? How much is the margin for soda ash futures?
猜你喜欢

秒杀中的验证码安全机制

7、CAS

pip2pi和pypiserver及Apache在pip本地源配置中的应用实践

netstat 命令详解

How does Wireshark modify the display format of packet capturing time and date?

馆客多游泳馆会员管理系统可以实现哪些场景?

. 4 literal and variable

Oracle database import data steps

How can physical stores break through operational difficulties? Take a look at the store operation guide of this physical store applet

How can mechanical equipment manufacturing enterprises manage outsourcing with the help of ERP system?
随机推荐
This is our golden age
游泳馆暑期业绩翻倍的方法
综合场馆的优势有哪些?
Redis數據類型日常使用場景
STM32 development of practical series 7-data Porter DMA
非标自动化设备制造企业,如何借助ERP系统实现快速精准报价?
Simple score statistics
[clearos] install the clearos system
美容院管理系统如何解决门店运营的三大难题?
How does the beauty salon management system solve the three problems of store operation?
CMD of Jerry's AI protocol_ SET_ BLE_ Format of visibility command [chapter]
Quel projecteur 4K est le meilleur rapport qualité - prix, quand bex3 pro met en évidence 128g Storage 618 vaut la peine de voir
What are the advantages of comprehensive venues?
@Controller和RequestMapping如何解析的
What are the elements of running a gymnasium?
#61. Two point answer
How can I use a domain name to access a website?
Oracle database import data steps
Splunk manually synchronize search head
How about Lenovo Xiaoxin 520? Which is more worth buying than dangbei D3x?