Linux LAN yum source of production

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_44318830/article/details/102772517

        In "Linux CentOS's local repository (yum source) configuration" blog post, a small bacteria to introduce how to create a local source CentOS yum, I believe we have mastered. But I have not thought about this question:? If you say that there is a cluster, a total of 100 computers requires each computer you need to configure yum source, then we is not gotta configure the local yum source 100 ha ha, in fact, do not need so the trouble, we only need to configure on a computer once, and then let the other virtual machines that are not even on the table as a "host" computer, you can use a common source of yum - is not that amazing, hey next small bacteria will be taught how we operate (¯ ▽ ¯) *


Software installation httpd

        
        ① install httpd
         yum -y install httpd

        ② start httpd service
        service httpd start

        ③ Test
        open the browser, type in the address bar http://192.168.100.111:80(its own virtual machine ip)
        to open the screen as shown below, then httpd service successfully opened Here Insert Picture Description
        ④ Development:

  • Found it impossible to access?
    The reason: because linux firewall to prohibit access to their own 80-port
    Solution: Firewall Release notice
  • Turn off the firewall
    reasons: In order to facilitate intra-cluster network interoperability machine, usually turn off the firewall service iptables stop

Production LAN yum source

  1. The first determine which server is set to LAN yum source, here I am, for example to hadoop001
  2. Copy path iso hadoop001 source server to the specified path
# 将iso源的路径复制到指定的路径
  cp -r /mnt/cdrom/*  /var/www/html/CentOS-6.9 
  1. Open your browser and enter 192.168.100.111/CentOS-6.9, we can see that the success of the original file on the local yum sources put on the LAN!
  2. Next we just need to update the other nodes in the local yum source (in other test nodes)
#  备份默认yum源
         cd /etc/yum.repos.d/
         mv local.repo local.repo.bak
         

#  制作本地 yum 源 【在其他的虚拟机上均设置】
          cd /etc/yum.repos.d/
          vi CentOS-Local.repo
          
     填入以下内容:     
    [base]
    name=CentOS-Local
    baseurl=http://192.168.100.111/CentOS-6.9/   
    gpgcheck=0       
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 

summary

        Production LAN need to download source yum httpd service, use yum httpd upload source files to a server on the LAN, so that under the same local area network can connect to other servers, eliminating the need to configure each server's local yum source trouble. The share on here, what is the problem can be positive or good suggestions in the comments area, like little friends remember point Zanga attention ~ ~

Guess you like

Origin blog.csdn.net/weixin_44318830/article/details/102772517