Ambari是apache的顶级项目, 是一套类似一键包安装hadoop集群的快速部署工具.
地址在这里: https://ambari.apache.org/Apache Ambari
本文是因为配置kerberos 授权的时候, 需要加安装一些功能, 比如tez的时候, 某个包(pig 安装失败,) 导致禁用kerberos 无效.
进而陷入死循环不得不重装. 因为是物理机没有回滚机制. 所以记录下重装的步骤.
Ambari安装请参考
http://docs.hortonworks.com/HDPDocuments/Ambari/Ambari-2.2.1.0/index.html#bk_ambari_views_guide
我这里因为是集群, 所以需要配置centos7的ambari, HDP和HDP-UTILS的本地源,
简单写一下. 找一台国外的速度快的centos7的机器,
yum install yum-utils createrepo yum-plugin-priorities
cd /etc/yum.repos.d/
wget repo_file
wget http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0/ambari.repo
http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.2.1.0/ambari-2.2.1.0-centos7.tar.gz
wget http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.0.0/hdp.repo
http://public-repo-1.hortonworks.com/HDP/centos7/2.x/updates/2.4.0.0/HDP-2.4.0.0-centos7-rpm.tar.gz
http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/HDP-UTILS-1.1.0.20-centos7.tar.gz
cd /tmp
mkdir ambari
mkdir hdp
reposync -r repo_soft_name
reposync -r Updates-ambari-2.2.1.0
reposync -r HDP-2.4.0.0
reposync -r HDP-UTILS-1.1.0.20
把包传回本地,并解压到某个目录下, 然后安装apache 或者nginx提供web服务器功能的工具.
install apache or others web services
Repository Base URL
Ambari Base URL http://<web.server>/ambari/<OS>/Updates-ambari-2.2.1.0
HDP Base URL http://<web.server>/hdp/<OS>/HDP-<latest.version>
HDP-UTILS Base URL http://<web.server>/hdp/<OS>/HDP-UTILS-<version>
创建repofile
createrepo filepath
createrepo Updates-ambari-2.2.1.0
createrepo HDP-2.4.0.0
createrepo HDP-UTILS-1.1.0.20
编辑本地的repo.file, 增加三个对应的repofile,
分别是ambari.repo, HDP.repo, HDP-UTILS.repo
vim /etc/yum.repos.d/repo.file
touch ambari.repo HDP.repo HDP-UTILS.repo
分别加入下面的内容
#VERSION_NUMBER=2.2.1.00
[Updates-ambari-2.2.1.0]
name=ambari-2.2.1.0 - Updates
baseurl=http://<web.server>/ambari_repo_rpms/centos7/Updates-ambari-2.2.1.0
gpgcheck=0
gpgkey=http://public-repo-1.hortonworks.com/ambari/centos7/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins
enabled=1
priority=1
make gpgcheck=0
[HDP-2.4]
name=HDP-2.4
baseurl=http://<web.server>/hdp_repo_rpms/centos7/HDP-2.4.0.0/
path=/
enabled=1
gpgcheck=0
[HDP-UTILS-1.1.0.20]
name=HDP-UTILS-1.1.0.20
baseurl=http://<web.server>/hdp_repo_rpms/centos7/HDP-UTILS-1.1.0.20/
#baseurl=http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/centos7/
path=/
enabled=1
gpgcheck=0
接下来yum clean metadata后就可以开始重新安装了.
需要删除掉以下的包
yum remove -y hadoop_* zookeeper* ranger* hbase_* ranger* hbase_* ambari-* hadoop_* zookeeper_* hbase* range* pig* hive* tez* mysql-* bigtop-* tuned-* ambari-* apache-maven* postgresql*
同时需要删除对应的目录和配置, 数据备份
cd /usr/lib/
rm -rf hadoop hbase zookeeper hcatalog hive ambari-* storm ams-hbase flume hadoop-* falcon* slider* pgsql*
cd /var/lib/
rm -rf ambari-* hadoop-* pgsql oozie* hive* falcon* slider*
cd /var/log/
rm -rf hadoop hbase spark tuned ambari-* zookeeper hadoop-* hive* oozie* storm* kafka* falcon* slider*
find ./ -type f | grep -E "[a-z]+-[0-9]+" | xargs rm
cd /etc/
rm -rf hadoop hbase hive* ambari-* spark tez tuned zookeeper maven* oozie* storm* ams-* hadoop-* falcon* slider*
rm -rf /hadoop/*
cd /usr/share
rm -rf apache-maven HDP-oozie maven-* falcon*
rm /usr/hdp
cd /usr/bin
rm -rf mvnyjp
ls -la | grep hdp | awk '{ print $9 }' | xargs rm
cd /home #删除对应的用户目录
rm -rf oozie mapred zookeeper storm yarn hive spark tez kafka hcat hdfs hbase ams ambari-* knox
cd /var/spool/mail
rm -rf ambari-* ams hadoop hbase hcat hdfs hive kafka knox mapred oozie slider spark storm tez yarn zookeeper
cd /
rm -rf kafka-logs hadoop
cd /tmp
rm -rf hadoop* hsperfdata* Jetty* hbase* ambari* jetty* MIME* ehcache* oozie* hive
cd /usr/lib/python2.6/site-packages
rm -rf ambari* resource_*
ps aux | grep ambari | awk '{ print NR=$2 }' | xargs kill -9
yum clean metadata
yum repolist
接下来删除里面对应的用户和组.
vim /etc/passwd
vim /etc/group
然后就可以重启下然后开始重新安装了.