Cloudera Manager CDH 离线安装

注:离线安装只是针对CM、CDH、数据库等较大的模块,中途如果需要安装其它相关依赖的组件,还是选择的在线安装,这些组件都很小不会有什么影响。如果使用的虚拟机实在没有网络,那么下载到宿主机之后上传安装也可以,只是需要自己处理一些依赖。

一、环境准备

1.1 虚拟机准备

由于环境限制,我这里准备四台虚拟机,并且固定ip为:192.168.0.198、192.168.0.210、192.168.0.211、192.168.0.212

1.2、配置hostname和hosts。

首先我们每个主机的hostname不能重复,同时/etc/hosts中每个主机的规范名称按照FQDN格式(比如host01.example.com)设置。然后我们需要把每个节点的主机名解析都定义到其它节点的hosts中。所以现在我们为4台虚拟机配置hosts如下:

ip 主机名 hosts配置
192.168.0.198 cdh-01.echatsoft.com

192.168.0.198 cdh-01.echatsoft.com cdh-01

192.168.0.210 cdh-02.echatsoft.com cdh-02

192.168.0.211 cdh-03.echatsoft.com cdh-03

192.168.0.212 cdh-04.echatsoft.com cdh-04

192.168.0.210 cdh-02.echatsoft.com

192.168.0.198 cdh-01.echatsoft.com cdh-01

192.168.0.210 cdh-02.echatsoft.com cdh-02

192.168.0.211 cdh-03.echatsoft.com cdh-03

192.168.0.212 cdh-04.echatsoft.com cdh-04

192.168.0.211 cdh-03.echatsoft.com

192.168.0.198 cdh-01.echatsoft.com cdh-01

192.168.0.210 cdh-02.echatsoft.com cdh-02

192.168.0.211 cdh-03.echatsoft.com cdh-03

192.168.0.212 cdh-04.echatsoft.com cdh-04

192.168.0.212 cdh-04.echatsoft.com

192.168.0.198 cdh-01.echatsoft.com cdh-01

192.168.0.210 cdh-02.echatsoft.com cdh-02

192.168.0.211 cdh-03.echatsoft.com cdh-03

192.168.0.212 cdh-04.echatsoft.com cdh-04

注:修改主机名,通过vim /etc/hostname修改即可;修改hosts,通过vim /etc/hosts修改即可

1.3 配置各个主机ssh免密登录

后面使用CM管理节点的时候需要ssh服务,所以我们先把免密登录配置了。

1.3.1 生成公钥和私钥

假设我们要实现cdh-02(192.168.0.210)和cdh-03(192.168.0.211)互相免密登录,需要做以下步骤:

首先cd到 ~/.ssh目录(如果没有该目录,创建即可),执行ssh-keygen指令,一路回车,如下所示:

[root@cdh-02 ~]# cd ~/.ssh
[root@cdh-02 .ssh]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
8b:70:f0:b3:db:6e:2c:ae:81:20:e9:79:07:cb:4c:b7 root@cdh-02.echatsoft.com
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|    .            |
| .   o           |
|+  o..+ S        |
|o.=.+o.+ .       |
| o.=.Eo..        |
|  . ...oo        |
|    .oo+o        |
+-----------------+
[root@cdh-02 .ssh]# ll
total 16
-rw-------. 1 root root 1675 May 17 00:30 id_rsa
-rw-r--r--. 1 root root  407 May 17 00:30 id_rsa.pub
-rw-r--r--. 1 root root  346 May 17 00:30 known_hosts
[root@cdh-02 .ssh]# 

在cdh-02和cdh-03上都执行上述步骤,然后两台机器上都会生成~/.ssh/id_rsa.pub文件,我们将cdh-02上的该文件发送到cdh-03机器的~/.ssh/authorized_keys 文件中,使用ssh-copy-id指令完成发送,如下所示:

[root@cdh-02 .ssh]# ssh-copy-id -i ./id_rsa.pub 192.168.0.211
The authenticity of host '192.168.0.211 (192.168.0.211)' can't be established.
ECDSA key fingerprint is b1:98:56:7b:ec:6e:c6:3a:43:1f:f0:dd:88:8a:47:72.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@192.168.0.211's password: 

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '192.168.0.211'"
and check to make sure that only the key(s) you wanted were added.

[root@cdh-02 .ssh]# 

然后再cdh-02机器上就可以免密登录到cdh-03了:

[root@cdh-02 .ssh]# ssh 192.168.0.211
Last login: Fri May 17 00:14:30 2019 from 192.168.0.61
[root@cdh-03 ~]# 

同样,把cdh-03的id_rsa.pub添加到cdh-02的authorized_keys ,也就能实现cdh-03免密登录到cdh-02了。

所以要我们所有节点都相互实现ssh免密登录,只需要在每个节点上到~/.ssh目录使用ssh-keygen指令生成id_rsa.pub,然后将每个节点的id_rsa.pub通过ssh-copy-id发送到其它所有节点的authorized_keys即可。

1.3 关闭防火墙

在每台机器上都执行以下操作,以关闭防火墙:

[root@cdh-03 ~] systemctl disable firewalld
[root@cdh-03 ~] systemctl stop firewalld

1.4 关闭SELINUX

执行getenforce指令查看selinux状态,如果输出为:enforcing,则需要处理一下,否则可以跳过这一步。

修改/etc/selinux/config文件(在某些系统中,可能是/etc/sysconfig/selinux文件),将SELINUX=enforcing修改为SELINUX=permissive:

更新配置之后要重启服务器生效,或者执行:setenforce 0,使其立即生效。

1.5 配置NTP(网络时间协议)服务

集群中的节点要求时钟同步,我们使用NTP来同步时间(这里简单使每个主机与外部server同步,如果要自己组建ntp同步集群,在网上搜搜就有教程了哈)。

每个节点安装ntp:

[root@cdh-03 ~] yum -y install ntp

然后修改每个节点的:/etc/ntp.conf文件,增加server:

server 0.pool.ntp.org

server 1.pool.ntp.org

server 2.pool.ntp.org

启动ntpd服务:

[root@cdh-03 ~] service ntpd start

使用ntpstat查看同步状态,可能需要几分钟时间:

[root@cdh-04 ~]# ntpstat
unsynchronised
  time server re-starting
   polling server every 8 s
[root@cdh-04 ~]# 

输出synchornised to NTP server表示完成同步:

[root@cdh-04 ~]# ntpstat
synchronised to NTP server (119.28.206.193) at stratum 3 
   time correct to within 119 ms
   polling server every 64 s
[root@cdh-04 ~]# 

1.6 确认Python环境

由于Hue是基于Python的Django框架的,所以需要在Hue主机上安装Python环境。CDH 6+需要Python2.7版本,博主使用的Centos-7中默认集成了该版本Python,所以不用处理。如果要集成CDH 6+版本下的Hue,则需要保证对应的Python版本。

1.7 安装JDK

这步就不说了哈,需要使用1.8版本,同时将jdk目录指定到/usr/java/jdk{version}。比如我们安装jdk1.8,那么JAVA_HOME就指定为:/usr/java/jdk1.8

export JAVA_HOME=/usr/java/jdk1.8

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

二、安装Cloudera Manager

由于安装包上G,在线下载巨慢,所以这里采取离线安装的方式。

2.1 版本选择

目前最高版本为6.2.0,我就直接选择6.2.0版本进行安装。

2.2 下载所需文件

确定好自己的系统和所需版本之后,到https://archive.cloudera.com下载对应的rpm包,博主当前下载redhat 7下的6.2.0版本:

这里我们暂时只需要用到cloudera-manager-agent、cloudera-manager-daemons和cloudera-manager-server三个rpm包,先下载这三个rpm就可以了。

2.3 安装

为了避免安装过程的一些奇葩问题,我们则直接使用root用户进行安装,并且我们选一个节点当做server节点,来布置server,这里我们选择192.168.0.211节点,也就是cdh-03节点。

接下来我们要在该节点上安装agent、daemons和server。

2.3.1 安装daemons

执行以下命令即可安装daemons:

rpm -ivh cloudera-manager-daemons-6.2.0-968826.el7.x86_64.rpm

2.3.2 安装agent

执行以下命令即可安装agent:

rpm -ivh cloudera-manager-agent-6.2.0-968826.el7.x86_64.rpm 

注:当前环境可能由于缺少agent需要依赖的组件导致安装失败,根据提示进行安装即可。博主简单整理了一下依赖的组件和对应的安装命令(可能不全,根据实际环境安装依赖):

httpd yum -y install httpd
mod_ssl yum -y install mod_ssl
openssl-devel yum -y install openssl-devel
python-psycopg2 yum -y install python-psycopg2
MySQL-python yum -y install MySQL-python
libpq.so.5()(64bit) yum -y install postgresql-libs.x86_64
init-functions yum -y  install redhat-lsb

如果还有异常,则根据提示进行解决。

2.3.3 安装 server

执行以下命令即可安装server:

rpm -ivh cloudera-manager-server-6.2.0-968826.el7.x86_64.rpm
  • 29
    点赞
  • 56
    收藏
    觉得还不错? 一键收藏
  • 10
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值