大数据学习第3天---------------------多台机器,利用软连接快速部署yum源

1:如果每台机器一个一个的部署,利用加载iso镜像特别占磁盘空间

下面利用一台机器部署yum源,然后将yum源发布的web服务器,其他虚拟机更改源地址即可

具体;

           先挑选一台机器mini4,挂载一个系统光盘到本地目录/mnt/cdrom,然后启动一个httpd服务器,

      将/mnt/cdrom 软连接到httpd服务器的/var/www/html目录中 (cd                        

    /var/www/html; ln -s /mnt/cdrom ./centos )

然后通过网页访问测试一下:  http://mini4/centos   会看到光盘的目录内容
至此:网络版yum私有仓库已经建立完毕  
剩下就是去各台yum的客户端配置这个http地址到repo配置文件中

自己部署下:首先 我192.168.36.197 已经部署好yum源了

   下面我吧此yum源 创建软连接,发布到web服务器上(httpd)

[root@hadoop html]# mkdir centos

[root@hadoop html]# ln -s /mnt/cdrom ./centos


浏览器:http://192.168.36.197/centos/ 




3:需要配置yum源的机器:

cd /etc/yum.repo.d

[root@hadoop yum.repos.d]# rename .repo  .repo.bak *
[root@hadoop yum.repos.d]# ll
total 28
-rw-r--r--. 1 root root 1664 Aug 30 23:53 CentOS-Base.repo.bak
-rw-r--r--. 1 root root 1309 Aug 30 23:53 CentOS-CR.repo.bak
-rw-r--r--. 1 root root  649 Aug 30 23:53 CentOS-Debuginfo.repo.bak
-rw-r--r--. 1 root root  314 Aug 30 23:53 CentOS-fasttrack.repo.bak
-rw-r--r--. 1 root root  630 Aug 30 23:53 CentOS-Media.repo.bak
-rw-r--r--. 1 root root 1331 Aug 30 23:53 CentOS-Sources.repo.bak
-rw-r--r--. 1 root root 3830 Aug 30 23:53 CentOS-Vault.repo.bak
[root@hadoop yum.repos.d]# mv CentOS-Media.repo.bak CentOS-Media.repo
[root@hadoop yum.repos.d]# vi CentOS-Media.repo


        file:///med/cdrom/
# CentOS-Media.repo
#
#  This repo can be used with mounted DVD media, verify the mount point for
#  CentOS-7.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c7-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c7-media [command]


[c7-media]
name=CentOS-yumlocal
baseurl=file:///192.168.36.197/centos/

        
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7


~
~
"CentOS-Media.repo" 21L, 585C written

root@hadoop yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, langpacks
file:///192.168.36.197/centos/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /192.168.36.197/centos/repodata/repomd.xml"
Trying other mirror.
file:///192.168.36.197/centos/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /192.168.36.197/centos/repodata/repomd.xml"
Trying other mirror.
repo id                          repo name                                status
c7-media                         CentOS-yumlocal                          0
repolist: 0



olkkkkk





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值