hadoop安装和维护05--配置yum源

本文介绍如何在没有互联网接入的情况下设置本地仓库,并详细解释了安装httpd服务、搭建yum源的过程,包括Ambari和HDP源的配置方法。

To get started setting up your local repository, complete the following prerequisites:

  • Select an existing server in, or accessible to the cluster, that runs a supported operating system.
  • Enable network access from all hosts in your cluster to the mirror server.
  • Ensure the mirror server has a package manager installed such as yum (RHEL / CentOS / Oracle Linux), zypper (SLES), or apt-get (Debian/Ubuntu).
  • Optional: If your repository has temporary Internet access, and you are using RHEL/CentOS/Oracle Linux as your OS, install yum utilities:
      yum install yum-utils createrepo

一. 安装httpd服务

1.1、安装httpd:

yum install httpd 

1.2、Apache启动出现错误:

[root@ www.linuxidc.com bin]# service httpd restart
AH00557: httpd: apr_sockaddr_info_get() failed for linux.64.114
AH00558: httpd: Could not reliably determine the server's fully qualified domain

name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

1.3、解决:

修改ServerName

vi /etc/httpd/conf/httpd.conf
#ServerName www.example.com:80
#添加这行
ServerName localhost:80
"/etc/httpd/conf/httpd.conf" 1011L, 34444C written

1.4 、启动httpd

service httpd start 
或
/etc/initd/httpd start

启动成功:
[root@rhel1 yum.repos.d]# ps -ef | grep httpd
root       5936      1  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5939   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5940   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5941   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5942   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5943   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5944   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5945   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
apache     5946   5936  0 13:04 ?        00:00:00 /usr/sbin/httpd
root       5976   3487  0 13:09 pts/0    00:00:00 grep httpd

这时,直接在浏览器中输入服务器的IP地址,即可看到Apache2的默认页面。此时的Apache仅仅能提供HTTP服务,不能执行php、也不能连接MySQL数据库。

二、搭建yum源

2.1 Setting Up a Local Repository with No Internet Access

参考:
2.1.1、 下载需要的包:

2.1.2、 复制到你的httpd设置的web server 目录:

vi /etc/httpd/cong/httpd.conf:
搜索web server 目录:/Document

这里写图片描述

2.1.3、解压你的tarball,
ambari , hdp的解压有区别:
这里写图片描述
2.1.4、Confirm you can browse to the newly created local repositories:
这里写图片描述

FQDN:(Fully Qualified Domain Name)完全合格域名/全称域名,是指主机名加上全路径,全路径中列出了序列中所有域成员。
import: 记录这些urls, 但你在安装Ambari和集群时需要。
2.1.5、Optional: If you have multiple repositories configured in your environment, deploy the following plug-in on all the nodes in your cluster.

  • Install the plug-in.
    - yum install yum-plugin-priorities

  • 编辑/etc/yum/pluginconf.d/priorities.conf , 添加下列属性:

[main]

enabled=1

gpgcheck=0

2.2 Setting Up a Local Repository with No Internet Access

2.2.1、获取Ambari和HDP的 repository configuration文件:

2.2.2、确保库的可用性

yum repolist

2.2.3、同步镜像服务器和本地库
浏览服务器目录:

cd /var/www/html

对Ambari ,创建目录, 同步库:

mkdir -p ambari/<OS>
cd ambari/<OS>
reposync -r Updates-Ambari-2.4.2.0

对HDP Stack Repositories, 创建目录, 同步库:

mkdir -p hdp/<OS>
cd hdp/<OS>
reposync -r HDP-<latest.version>
reposync -r HDP-UTILS-<version>

Generate the repository metadata:

  • For Ambari:
    createrepo <web.server.directory>/ambari/<OS>/Updates-Ambari-2.4.2.0
  • For HDP Stack Repositories:
createrepo <web.server.directory>/hdp/<OS>/HDP-<latest.version>

createrepo <web.server.directory>/hdp/<OS>/HDP-UTILS-<version>

2.2.4、确保可以浏览创建的库:
这里写图片描述

2.3 配置本地DVD yum源(主要是解决linux系统包的依赖)

[root@logs01 ~]# mount -o loop /opt/software/RHEL_6.3\ x86_64.iso /mnt/
[root@logs03 ~]# vim /etc/yum.repos.d/rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/Server  #注意
enabled=1    #注意
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

三、总结

  安装HDP 需要配置四个yum源:

  • 配置本地DVD yum源(主要是解决linux系统包的依赖)
  • ambari源配置文件三个
    • ambari
    • HDP
    • HDP-UTILS

注意:将四个YUM源配置文件都COPY到所有要安装HDP的节点上

yum源配置: http://blog.itpub.net/25313300/viewspace-708509
官网的安装教程,很详细。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值