1.配置CDH5的官方源
使用cloudera的一键包,或手动下载CDH5的.repo文件
rpm -Uvh
http://archive.cloudera.com/cdh5/one-click-install/redhat/6/x86_64/cloudera-cdh-5-0.x86_64.rpm
或
mv cloudera-cdh5.repo /ect/yum.repo.d/
2.安装yum工具
yum install -y yum-utils createrepo
3.同步CDH5的源
reposync -r cloudera-cdh5
注意,“cloudera-cdh5”应该与/ect/yum.repo.d/下的cdh的.repo文件名一致
4.链接或移动同步的rpm文件夹到web server下
mv cloudera-cdh5 /var/www/html/mirrors/cdh/
或 ln -s cloudera-cdh5 /var/www/html/mirrors/cdh/cloudera-cdh5
5.创建repo
cd /var/www/html/mirrors/cdh/cloudera-cdh5
createrepo .
6.修改指向CDH的.repo文件
vi /etc/yum.repo.d/cloudera-cdh5.repo
baseurl=http://<address:port>/mirrors/cdh/cloudera-cdh5/
7.验证yum源
yum update && yum install hadoop
正确显示hadoop的包即正确