在安装CDH时,这是个绕不过去的坎。
参考URL:
http://www.21ops.com/linux/26465.html
奇怪的是,我并没执行creatrepo这个,直接将光盘MOUNT来用的。
多台服务器在Centos6.5 mini安装后,需要安装一些基础软件包,从外网yum安装,很费时间,也占用流量。在局域网搭建YUM 服务器即可解决此问题。步骤如下:
服务器端安装配置如下:
1、上传CentOS-6.5-x86_64-bin-DVD1.iso镜像文件到一台服务器
1 2 | [root@localhost data] # ll /home/data/CentOS-6.5-x86_64-bin-DVD1.iso -rwxr--r-- 1 nobody nobody 4467982336 Feb 28 01:28 /home/data/CentOS-6 .5-x86_64-bin-DVD1.iso |
2、挂载镜像、安装creatrepo,并生成repodata目录
1 2 3 4 5 6 7 8 9 | mount -o loop CentOS-6.5-x86_64-bin-DVD1.iso /mnt/ cp -R /mnt/Packages /home/data/Centos/ yum install createrepo -y cd /home/data/ createrepo Centos/ [root@localhost Centos] # ll total 276 dr-xr-xr-x 2 root root 278528 Apr 21 14:43 Packages drwxr-xr-x 2 root root 4096 Apr 21 14:49 repodata |
3、安装httpd server
1 2 | yum install httpd -y vi +292 /etc/httpd/conf/httpd .conf |
将/var/www/html 改为/home/data
1 | /etc/init .d /httpd start |
4、配置防火墙、关闭selinux,
1 2 | iptables -A INPUT -p tcp --dport 80 -j ACCEPT setenforce 0 |
客户端修改配置如下:ip换为sever ip
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | cat >> /etc/yum .repos.d /CentOS-Base .repo<<EOF [base] name=myiso repo baseurl=http: //192 .168.1.23 /Centos gpgcheck=0 enabled=1 [updates] name=myiso update baseurl=http: //192 .168.1.23 /Centos gpgcheck=0 enabled=1 EOF yum clean all yum install vim |
[c6-media] name=CentOS-$releasever - Media baseurl=http://192.168.11.89/centos_media/ gpgcheck=0 enabled=1 exclude = jdk*
[myrepo] name=myrepo baseurl=http://192.168.11.89/cm5/redhat/6/x86_64/cm/5/ enabled=1 gpgcheck=0