快速搭建Ambari和相关集群

Posted by Blog of JackerWang on December 4, 2017

环境准备

相关包检查

首先需要在环境里面检查相关包版本是否正确,确保后面的安装过程能够顺利进行,检查项如下: rpm -qa|grep libdb

1 Requires: libdb(x86-64) = 5.3.21-19.el7

注意这个包的版本少数系统是 Installed: libdb-5.3.21-20.el7.x86_64

2 安装hive元数据mysql过程可能会出现mariadb-lib冲突(会产生冲突),如有冲突要先yum remove。卸载mariadb要在安装集群之前处理,因为集群对这个包有依赖。

平台环境

平台所有机器均为(CentOS7.2,16核|128GB),此平台有8太机器,3台机器作为管理节点,5台作为数据节点,具体分配如:

IP(私有IP) 节点说明 节点服务
172.16.100.37 master1 ambari-server,zookeeper,HbaseMaster
172.16.100.241 master2 ambari-agent, zookeeper,HbaseMaster
172.16.100.225 master3 ambari-agent, zookeeper,HbaseMaster
172.16.100.174 slave1 ambari-agent
172.16.100.242 slave2 ambari-agent
172.16.100.3 slave3 ambari-agent
172.16.100.198 slave4 ambari-agent
172.16.100.106 slave5 ambari-agent

预安装

因为这里需要在8台机器上执行相同的操作,所有的操作尽量以shell脚本的形式运行

一: 拿到一台新机器需要先挂在硬盘 挂载硬盘的步骤如下:

分配和挂载硬盘之前使用df -TH和fdisk -l查看当前硬盘以及挂载的情况,然后以此为根据对硬盘进行分区和选择相应目录进行挂载。这里fdisk -l查看到还有4T大小的硬盘/dev/xvde未分区

#安装fuser命令用于kill对应硬盘的进程(用于分区的卸载)
yum -y install psmisc

#硬盘分区
fdisk /dev/xvde
:n(添加新分区)
:p(注明是主分区)
:回车(默认的起始扇区)
:+500G(分区大小为500G)
:w(将改变写入)

#格式化分区
mkfs -t ext4(ext3) -c /dev/xdve1
ext4为设定的文件系统格式。这里需要等待waiting...........

#挂在分区到相应的文件系统目录
 mkdir /data
 mount /dev/xvde1 /data

二:免密登录 这里需要3台master能够免密ssh登录到所有其它的主机,免密登录脚本如下:

vim copyIdToCluster.sh

#若没有配置/etc/hosts文件,需要将主机名改为对应的内网ip
hosts=(m1 m2 m3 s1 s2 s3 s4 s5)
ssh-keygen -t rsa
count=0
for host in ${hosts[*]}
do
    server=$host
    ssh-copy-id -i /root/.ssh/id_rsa.pub $host
    ((count++))
done
echo "复制文件数目 $count "

执行copyIdToCluster.sh,根据提示输入机器密码即可完成此机器到所有其它机器的免密登录。由于其它3台机器也需要相同操作,这里使用文件复制脚本完成脚本copyIdToCluster.sh到其它3台master的复制。复制脚本如下:

vim cpFileToCluster.sh

hosts=(m1 m2 m3 s1 s2 s3 s4 s5)
currentPath=`pwd`
argPath=$1
if [ ${argPath:0:1} != "/" ]
then
    argPath=${currentPath}"/"${argPath}
fi

#根据原文件路径获得目的文件路径(父目录)
destDir=${argPath%/*}
echo "目标目录为>>>$destDir<<<"

for host in ${hosts[*]}
do
    echo "复制文件  $argPath->$host:$desDir"
    scp $argPath root@$host:$destDir
    if [ ${argPath##*.} = "sh" ]
    then
        echo "执行文件 $argPath"
        ssh $host "sh $argPath"
    fi
done

执行以下命令完成脚本文件的复制和异地执行 chmod 755 cpFileToCluster.sh cpFileToCluster.sh copyIdToCluster.sh

三:配置/etc/hosts和主机名称

1 修改主机名

在8台机器上分别执行以下命令完成所有机器的名称修改

vim /etc/hostname
m1
reboot

这里主机名需要重启生效,在后面步骤进行重启。

2 配置/etc/hosts

vim /etc/hosts

#添加以下映射关系
172.16.100.37   m1.cluster.com m1
172.16.100.241  m2.cluster.com m2
172.16.100.225  m3.cluster.com m3
172.16.100.174  s1.cluster.com s1
172.16.100.242  s2.cluster.com s2
172.16.100.3    s3.cluster.com s3
172.16.100.198  s4.cluster.com s4
172.16.100.106  s5.cluster.com s5

使用复制脚本复制/etc/hosts到所有机器

四:关闭防火墙和SELINUX

1 关闭防火墙 vim stopFireWalld.sh

#关闭
service firewalld stop
#随着系统启动自动关闭
chkconfig firewalld off

使用复制脚本复制stopFireWalld.sh到所有机器

2 关闭SELINUX

vim /etc/selinux/config

修改 SELINUX=disabled

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

使用复制脚本复制/etc/selinux/config到所有机器

五:设置最大文件打开数和最大进程数量

vim /etc/security/limits.conf

#添加
* - nofile 65536
* - nproc 16384

RHEL6之后nproc受到文件/etc/security/limits.d/90-nproc.conf的影响 vim /etc/security/limits.d/90-nproc.conf

#修改数字为16384
16384

ulimit -a进行检测(需要重新登录生效)

六:关闭THP特性 vim /etc/rc.local

#添加
echo never > /sys/kernel/mm/redhat_transparent_hugepage/enabled
echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag

source /etc/rc.local使生效

七:确保使用su命令切换用户是拥有过权限的

如果su - hdfs出现Permissions Denied。请检查/etc/pam.d/su文件,将

auth required pam_wheel.so group=wheel

这一行注释掉 如果没有解决su命令的权限问题,后面设置ambari-server的数据库,启动集群的时候都会失败。

八:重启机器使主机名生效并检查防火墙状态

reboot

Ambari搭建

搭建本地yum源

一:安装httpd服务

1:在m1上安装httpd服务

yum install httpd

在目录 /etc/httpd/conf/下面修改httpd.conf文件

httpd.conf配置实例


#启动httpd
service httpd start
#开机启动
chkconfig httpd on

httpd的默认根目录为/var/www/html,在/var/www/html下面新建测试文件index.html

vim index.html

<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Welcome access LinuxProbe.org,This is Test Page!
</div>
</body>
</html>

2:在m1和其它机器测试httpd服务是否能够访问

curl localhost

如果httpd启动成功,则会获取index.html内容

二:配置本地yum源

1:获取相应集群所需要的包

需要的包:

ambari-2.4.2.0-centos7.tar.gz

HDP-2.5.3.0-centos7-rpm.tar.gz

HDP-UTILS-1.1.0.21-centos7.tar.gz

CentOS-7-x86_64-DVD-1611.iso

将前面3个hdp的包放在httpd的根目录下面,然后解压。镜像文件 CentOS-7-x86_64-DVD-1611.iso需要挂在在httpd根目录下面

挂载系统镜像文件

在httpd根目录下面新建文件夹centosIOS

mount -o loop CentOS-7-x86_64-DVD-1611.iso $HTTPD_HOME/centosIOS。

目录$HTTPD_HOME/centosIOSi下面此时应有了repodata文件夹了。

2:在目录/etc/yum.repo.d下面新建yum配置文件

vim /etc/yum.repos.d/ambari.repo

[AMBARI-2.4.2.0-136]
name=Ambari 2.x
baseurl=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136
gpgcheck=1
gpgkey=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-UTILS-1.1.0.21]
name=HDP-UTILS Version - HDP-UTILS-1.1.0.21
baseurl=http://172.16.100.37/HDP-UTILS-1.1.0.21/repos/centos7/
gpgcheck=0
gpgkey=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[HDP-2.5.3.0]
name=HDP Version - HDP-2.5.3.0
baseurl=http://172.16.100.37/HDP/centos7/
gpgcheck=1
gpgkey=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

[Updates-AMBARI-2.4.2.0-1.4.4.23]
name=AMBARI-2.4.2.0-1.4.4.23 - Updates
baseurl=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136
gpgcheck=1
gpgkey=http://172.16.100.37/AMBARI-2.4.2.0/centos7/2.4.2.0-136/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1

#VERSION_NUMBER=2.5.3.0-37
[local]
name=local-CentOS
baseurl=http://192.168.25.97/mnt
gpgcheck=0
enabled=1
priority=1

3:yum源检测

执行yum repolist获取相关yum源,能够获取到hdp的本地yum源和centos本地yum源,说明此时yum源已经配置正确。

4:yum安装必要插件

以下包需要在外网环境下面安装(每台主机都需要安装)

yum install nc yum install psmisc yum install redhat-lsb

三:安装ambari-server

只需要在m1上安装ambari-server

yum install ambari-server
#修改配置文件
vim /etc/ambari-server/conf/ambari.properties
#添加
java.home=$JAVA_HOME
#修改
client.threadpool.size.max = 50

四:安装ambari-agent 所有机器安装ambari-agent vim installAgent.sh

yum -y install ambari-agent
#修改配置文件
vim /etc/ambari-agent/conf/ambari-agent.ini
#修改hostname
hostname=m1.cluster.com

复制installAgent.sh到所有机器并执行

五:启动ambar-server和ambari-agent

1:设置ambari-server ambari-server setup

ambari-server setup设置ambari-server
Using python  /usr/bin/python2.6
Setup ambari-server
Checking SELinux...
SELinux status is 'enabled'
SELinux mode is 'permissive'
WARNING: SELinux is set to 'permissive' mode and temporarily disabled.
OK to continue [y/n] (y)? y
Customize user account for ambari-server daemon [y/n] (n)? n
Adjusting ambari-server permissions and ownership...
Checking firewall...
Checking JDK...
Do you want to change Oracle JDK [y/n] (n)? n
Completing setup...
Configuring database...
Enter advanced database configuration [y/n] (n)? y
==============================================================================
Choose one of the following options:
[1] - PostgreSQL (Embedded)
[2] - Oracle
[3] - MySQL
[4] - PostgreSQL
==============================================================================
Enter choice (1): 1
Database Name (ambari): ambari
Postgres schema (ambari): ambari
Username (ambari): ambari
Enter Database Password (bigdata): xxxxx
Re-enter password: xxxxx
Default properties detected. Using built-in database.
Checking PostgreSQL...
Running initdb: This may take upto a minute.
Initializing database: [  OK  ]

About to start PostgreSQL
Configuring local database...
Connecting to local database...done.
Configuring PostgreSQL...
Restarting PostgreSQL
Extracting system views...
.ambari-admin-1.7.0.169.jar
.
Adjusting ambari-server permissions and ownership...
Ambari Server 'setup' completed successfully.

2:启动ambari-server

service ambari-server start

chkconfig ambari-server on

3:启动所有ambari-agent

service ambari-agent start

六:连接ambari

浏览器输入m1的ip://8080检测


使用Ambari安装相关集群

使用ambar管理界面安装相关集群即可,剩下工作交给Ambari即可。 —

组件验证

hdfs文件系统验证

http://xx.xx.xx.xx:50070/ 从本地拷贝文件到hdfs文件系统,展示hdfs文件系统文件,删除文件 hadoop fs -copyFromLocal 本地文件 hdfs系统目录 hadoop fs -rmr hdfs系统目录

yarn计算框架验证

http://xx.xx.xx.xx:8088/ 拷贝文件到hdfs文件系统 hadoop fs -copyFromLocal ts-compact-dpi-j2a1.log /apps/eops/ 调用计算框架例子 yarn jar /usr/hdp/2.2.0.0-2041/hadoop-mapreduce/hadoop-mapreduce-examples.jar wordcount /apps/eops/ts-compact-dpi-j2a1.log /apps/eops/out

hbase验证

http://xx.xx.xx.xx:60010/ 运行hbase shell list,count等命令有返回

zookeeper验证

hbase能正常运行,实际上zookeeper就已经验证是正常的了 /usr/hdp/2.2.0.0-2041/zookeeper/bin/zkCli.sh -server j2a1.ecld.com

Q&A

Q:

1 ambari注册集群机器的步骤,查看日志文件/var/log/ambari-agent.log:

_ERROR 2017-12-01 15:24:00,991 NetUtil.py:89 - SSLError: Failed to connect. Please check openssl library versions. _

A:

所有ambari-agent执行以下命令并重启

sed -i 's/verify=platform_default/verify=disable/' /etc/python/cert-verification.cfg


#在agent的配置,主要针对ambari 2.6.2
[security]
force_https_protocol=PROTOCOL_TLSv1_2

Q:

2 ambari-setup的阶段 /dev/null无权限访问导致postgresql无法启动

A: #删除/dev/null rm -f /dev/null #新建不同权限的字符设备文件(面向字符)/dev/null mknod -m 666 /dev/null c 1 3

Q__

3 ambari客户端连不上服务端

ERROR 2015-02-21 16:46:16,798 NetUtil.py:67 - SSLError: Failed to connect. Please check openssl library versions.

A

下载安装rpm -ivh –replacefiles openssl-1.0.1e-30.el6.x86_64.rpm

Q__

4 nagios安装失败

Fail: Execution of ‘/usr/bin/yum -d 0 -e 0 -y install hdpmonnagiosaddons’ returned 1. Error: Package: nagios-plugins-1.4.9-1.x8664 (HDP-UTILS-1.1.0.17) Requires: libssl.so.10(libssl.so.10)(64bit)

Error: Package: nagios-plugins-1.4.9-1.x86_64 (HDP-UTILS-1.1.0.17) Requires: libcrypto.so.10(libcrypto.so.10)(64bit) You could try using –skip-broken to work around the problem You could try running: rpm -Va –nofiles –nodigest

A__ 修改

/var/lib/ambari-agent/cache/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/nagios_server.py文件 def remove_conflicting_packages(): Package( ‘hdp_mon_nagios_addons’, action = “remove” )

Package( ‘nagios-plugins’, action = “remove” )

if System.get_instance().os_family in [“redhat”,”suse”]: Execute( “rpm -e –allmatches –nopostun nagios”, path = “/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”, ignore_failures = True ) 删除 Package( ‘nagios-plugins’, action = “remove” ) 强制安装rpm -ivh nagios-plugins-1.4.9-1.x86_64.rpm –nodeps –force

Q

5 nodemanager启动不成功,container-executor无权限

A

chmod 6050 /usr/hdp/current/hadoop-yarn-nodemanager/bin/container-executor

Q

6 yarn启动找不到配置文件

A

使用的是fairscheduler,配置文件要手工创建 vim /etc/hadoop/conf/fair-scheduler.xml

<?xml version="1.0"?>
<allocations>
<queue name="default">
<minResources>6000 mb,0vcores</minResources>
<weight>1</weight>
<schedulingPolicy>fair</schedulingPolicy>
<aclSubmitApps>default</aclSubmitApps>
<aclAdministerApps>default</aclAdministerApps>
</queue>
</allocations>

/etc/hadoop/conf/mapred-queues,文件内容
<?xml version="1.0"?>
<queues>
  <queue>
    <name>default</name>
    <state>running</state>
    <acl-submit-job> </acl-submit-job>
    <acl-administer-jobs> </acl-administer-jobs>
  </queue>
</queues>

每次新创建应用用户,要按照这个格式添加用户部分到这两个文件,主备RM的配置目录都要有,更新完成之后,刷新

sudo -u yarn /usr/hdp/current/hadoop-client/bin/yarn rmadmin –refreshQueues

sudo -u yarn /usr/hdp/current/hadoop-client/bin/yarn rmadmin -refreshQueues

Q

7 日志不按天分

A

/usr/hdp/2.2.0.0-2041/hadoop/sbin/hadoop-daemon.sh /usr/hdp/2.2.0.0-2041/hbase/bin/hbase-daemon.sh 修改RAF为DRFA(hbase中的HBASE_SECURITY_LOGGER不用改RFAS,因为没有DRFAS) yarn日志按天分,在ambari中可以设置

Q

8 Python script has been killed due to timeout after waiting 900 secs

ambari启动hiveserver2(或者别的服务)过程中,出现执行超时的错误,因为某些环境的问题,导致执行某些服务的速度很慢,超过了ambari-server设置的超时时间,这需要加长ambari-server的超时时间。

A

vim /etc/ambari-server/conf/ambari.properties

agent.task.timeout=2000(默认是900)

server.connection.max.idle.millis=2000000(默认是900000)

Q

9 namenode链接不上journalnodes导致挂掉!!!

namenode的日志报错信息如下:

2018-04-21 11:06:20,442 FATAL namenode.FSEditLog (JournalSet.java:mapJournalsAndReportErrors(398)) - Error: flush failed for required journal (JournalAndStream(mgr=QJM to [192.168.24.66:8485, 192.168.24.122:8485, 192.168.26.121:8485], stream=QuorumOutputStream starting at txid 74565654)) java.io.IOException: Timed out waiting 20000ms for a quorum of nodes to respond.

A

增大连接JNS的超时时间

dfs.qjournal.write-txns.timeout.ms(默认是20000 ms)

10 journalnodes日志报错

会从ambari的警告看出来指定的journalnodes受到影响(affected),journalnodes日志报错信息如下

java.io.IOException: Can’t scan a pre-transactional edit log.

A

ambari搜索dfs.journalnode.edits.dir(journalnod的edits目录)的值,${dfs.journalnode.edits.dir}/$user/current这个目录下面的数据收到了损坏(比如目录对应的磁盘写满文件了)。 解决办法是从正常的节点的相同目录下拷贝所有edits文件(原目录下面的VERSION保存),然后重点是修改所有拷贝文件的owner和权限(参考正常节点的owner和权限),不然会报错!

11 解决ambari中超时问题

A

关于ambari-agent任务的超时设置是在ambari的配置文件中设置。


关于各个服务组建的超时设置,比与解决超时1200 sec。
/var/lib/ambari-server/resources/common-services/YARN/2.1.0.2.0/metainfo.xml

12 hbase regionserver挂掉, 查看regionserver日志,是kerberos认证失败(failue to get password for user)

A

chown hbase:hadoop /etc/security/keytabs/hbase.service.keytab

13 hbase 超时60000ms,

hbase regionserver挂掉, 查看regionserver日志,是kerberos认证失败(failue to get password for user)   _**A**_

设置Phoenix timeout(默认为1m)为更长时间

14 RegionServer挂掉

Q1:[JvmPauseMonitor] util.JvmPauseMonitor: Detected pause in JVM or host machine (eg GC): pause of approximately 3578ms

A

调整参数(降低)

hbase.bucketcache.size
HBase off-heap MaxDirectMemorySize Q2: 2018-06-13 10:56:43,139 INFO  [regionserver/s7.wss.com/192.168.26.147:16020] regionserver.HRegionServer: STOPPED: Unhandled: org.apache.hadoop.hb ase.ClockOutOfSyncException: Server s7.wss.com,16020,1528858599383 has been rejected; Reported time is too far out of sync with master.  Time dif ference of 54870ms > max allowed of 30000ms

A

时间未同步

15 Ambari重装集群失败(重装完成后,只看得见配置文件)

一般重装完成后在/usr/hdp/hadoop目录下面只看得见conf目录,这种情况是之前安装的相关包没有被卸载掉,所以安装失败,这个在注册ambari-agent的时候会有提醒哪些包没有被卸载掉。

重装集群前需要删除所有相关目录并且卸载所有包,以下是删除相关目录和卸载包的脚本。

ambari 2.4.2 卸载所有包

yum remove -y  zookeeper_2_5_3_0_37.noarch
yum remove -y  hadoop_2_5_3_0_37-hdfs.x86_64
yum remove -y  hbase_2_5_3_0_37.noarch
yum remove -y  hdp-select.noarch
yum remove -y  hadoop_2_5_3_0_37-yarn.x86_64
yum remove -y  hadoop_2_5_3_0_37-libhdfs.x86_64
yum remove -y  hive2_2_5_3_0_37.noarch
yum remove -y  spark_2_5_3_0_37-yarn-shuffle.noarch
yum remove -y  ranger_2_5_3_0_37-hdfs-plugin.x86_64
yum remove -y  atlas-metadata_2_5_3_0_37-hive-plugin.noarch
yum remove -y  ranger_2_5_3_0_37-yarn-plugin.x86_64
yum remove -y  zookeeper_2_5_3_0_37-server.noarch
yum remove -y  hive_2_5_3_0_37-hcatalog.noarch
yum remove -y  pig_2_5_3_0_37.noarch
yum remove -y  ranger_2_5_3_0_37-hbase-plugin.x86_64
yum remove -y  sqoop_2_5_3_0_37.noarch
yum remove -y  hive_2_5_3_0_37.noarch
yum remove -y  spark2_2_5_3_0_37.noarch
yum remove -y  mysql-community-release.noarch
yum remove -y  hive_2_5_3_0_37-webhcat.noarch
yum remove -y  spark2_2_5_3_0_37-python.noarch
yum remove -y  hadoop_2_5_3_0_37.x86_64
yum remove -y  spark2_2_5_3_0_37-yarn-shuffle.noarch
yum remove -y  storm_2_5_3_0_37-slider-client.x86_64
yum remove -y  tez_2_5_3_0_37.noarch
yum remove -y  datafu_2_5_3_0_37.noarch
yum remove -y  tez_hive2_2_5_3_0_37.noarch
yum remove -y  hadoop_2_5_3_0_37-client.x86_64
yum remove -y  hadoop_2_5_3_0_37-mapreduce.x86_64
yum remove -y  hive2_2_5_3_0_37-jdbc.noarch
yum remove -y  ranger_2_5_3_0_37-hive-plugin.x86_64
yum remove -y  hive_2_5_3_0_37-jdbc.noarch
yum remove -y  slider_2_5_3_0_37.noarch
yum remove -y  bigtop-jsvc.x86_64

ambari 2.4.2 删除所有目录

rm -fr /usr/hdp /data/hdfs/ /data/log /var/log  /hadoop  /var/lib/*hadoop* /var/lib/*hive*  /var/lib/*spark*

rm -fr /etc/hadoop        /etc/hbase      /etc/hive       /etc/sqoop      /etc/zookeeper          /etc/hive-hcatalog      /etc/tez        /etc/hive-webhcat        /etc/slider     /etc/storm-slider-client        /etc/pig        /var/run/hadoop         /var/run/hbase          /var/run/hive /var/run/zookeeper         /var/run/webhcat        /var/run/hadoop-yarn    /var/run/hadoop-mapreduce       /var/run/spark  /var/lib/slider         /var/tmp/sqoop   /tmp/hive     /tmp/ambari-qa  /tmp/sqoop-ambari-qa /tmp/hadoop-hdfs     /tmp/hdfs

ambari 2.6.2 卸载所有包

yum remove -y hadoop_2_6_4_0_91 hadoop_2_6_4_0_91-hdfs spark2_2_6_4_0_91-yarn-shuffle hdp-select ranger_2_6_4_0_91-hbase-plugin ranger_2_6_4_0_91-yarn-plugin bigtop-jsvc ranger_2_6_4_0_91-hdfs-plugin hadoop_2_6_4_0_91-client  smartsense-hst ambari-metrics-collector spark_2_6_4_0_91-yarn-shuffle ambari-metrics-monitor hadoop_2_6_4_0_91-mapreduce zookeeper_2_6_4_0_91 hadoop_2_6_4_0_91-libhdfs zookeeper_2_6_4_0_91-server hbase_2_6_4_0_91 ambari-metrics-grafana hadoop_2_6_4_0_91-yarn  ambari-metrics-hadoop-sink /etc/ambari-metrics-collector   /var/run/ambari-metrics-monitor

ambari 2.6.2 删除所有目录

rm -fr /usr/hdp /data/hdfs/    /hadoop  /var/lib/*hadoop* /var/lib/*hive*  /var/lib/*spark*

rm -fr /etc/hadoop        /etc/hbase      /etc/hive       /etc/sqoop      /etc/zookeeper          /etc/hive-hcatalog      /etc/tez        /etc/hive-webhcat        /etc/slider     /etc/storm-slider-client        /etc/pig        /var/run/hadoop         /var/run/hbase          /var/run/hive /var/run/zookeeper         /var/run/webhcat        /var/run/hadoop-yarn    /var/run/hadoop-mapreduce       /var/run/spark  /var/lib/slider         /var/tmp/sqoop   /tmp/hive     /tmp/ambari-qa  /tmp/sqoop-ambari-qa /tmp/hadoop-hdfs     /tmp/hdfs

rm -fr /var/log/hadoop
rm -fr /var/log/hbase
rm -fr /var/log/zookeeper
rm -fr /var/log/hadoop-hdfs
rm -fr /var/log/hadoop-yarn
rm -fr /var/log/hadoop-mapreduce
rm -fr /var/log/ambari-metrics-collector
rm -fr /var/log/ambari-metrics*

rm -fr  /usr/lib/flume
rm -fr  /usr/lib/storm
rm -fr  /usr/lib/ambari-metrics-collector
rm -fr  /var/lib/zookeep*
rm -fr  /var/lib/ambari-metrics-collector
rm -fr  /etc/ambari-metrics-monitor

JackerWang 于2017年冬(12月4日)下午的广州