1. Problem

We wrote a shell script to uninstall Cloudera Manager(CM) that run in a cluster with 3 linux server. After run the script, we reinstalled the CM normally. But when we established Hdfs encountered a problem: **failed to format NameNode. Cannot find CDH's bigtop-detect-javahome. **

2.Thinking

  1. By google we found if it caused by the exist of floder "/dfs", but after used command rm -rf /dfs the problem still happen.
  2. We found the error reported: /usr/libexec/bigtop-detect-javahome, so we thought if caused by JAVA_HOME variable exception. At first, we disable the file: /etc/profile's JAAVA_HOME variable. To make the change effect, we shouldsource /etc/profile and disconnect the xshell. however, the problem still happen.
  3. Recheck the uninstall script, we found the script delete files: /usr/bin/hadoop* which was important.

    now /etc/profile as follow:
#export JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
#export PATH=$JAVA_HOME/bin:$PATH
#export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

3. Slove

follwing step you should do in each server of the cluster.

3.1 Check file hadoop avaliable

cd to the floder /usr/bin and check if file hadoopis avaliable. the content of file as follows:

#!/bin/bash
# Autodetect JAVA_HOME if not defined
. /usr/lib/bigtop-utils/bigtop-detect-javahome
export HADOOP_HOME=/usr/lib/hadoop
export HADOOP_MAPRED_HOME=/usr/lib/hadoop
export HADOOP_LIBEXEC_DIR=//usr/lib/hadoop/libexec
export HADOOP_CONF_DIR=/etc/hadoop/conf
exec /usr/lib/hadoop/bin/hadoop "$@"

we found it load file bigtop-detect-javahome and set HADOOP_HOME.

It's a pity that /usr/lib/hadoop* and /usr/lib/hadoop* was delete by our uninstall script, so we copied those file and floder from another cluster to our cluster.

3.2 Check file bigtop-detect-javahome avaliable

cd to the floder /usr/lib/bigtop-utils and check if filebigtop-detect-javahome is avaliable, the content of file as follows:

# attempt to find java
if [ -z "${JAVA_HOME}" ]; then
for candidate_regex in ${JAVA_HOME_CANDIDATES[@]}; do
for candidate in `ls -rvd ${candidate_regex}* 2>/dev/null`; do
if [ -e ${candidate}/bin/java ]; then
export JAVA_HOME=${candidate}
break 2
fi
done
done
fi

the file is used to set JAVA_HOME variable when system doesn't define JAVA_HOME in /etc/profile.

Finally, I found no matter the file /etc/profile with JAVA_HOME variable or without it, Hdfs can be installed.

3.3 More and more

Go through the first two steps can slove the problem, but more google let me know /etc/default/ is real config floder !

refer: http://blog.sina.com.cn/s/blog_5d9aca630101pxr1.html

addexport JAVA_HOME=path into /etc/default/bigtop-utils, then source /etc/default/bigtop-utils.

You only need to do it once and all CDH components would use that variable to figure out where JDK is.

4. Conclusion

  1. Always focus on the log file content and error's relation is.
  2. Make the best use of your time and modest ask for advise to other. otherwise, the problem always exists.

Problem of Uninstall Cloudera: Can't Add Hdfs and Reported Cannot Find CDH's bigtop-detect-javahome的更多相关文章

  1. Problem of Uninstall Cloudera: Cannot Add Hdfs and Reported Cannot Find CDH's bigtop-detect-javahome

    1. Problem We wrote a shell script to uninstall Cloudera Manager(CM) that run in a cluster with 3 li ...

  2. Cloudera Manager5安装总结遇到问题及解决办法 CDH 5.8 on CentOS 7

    问题导读:1.Cloudera Manager在线安装你认为有什么优点和缺点?2.Cloudera Manager安装过程中遇到,你认为该如何解决?3.在线安装addr.arpa domain nam ...

  3. How-to: Do Real-Time Log Analytics with Apache Kafka, Cloudera Search, and Hue

    Cloudera recently announced formal support for Apache Kafka. This simple use case illustrates how to ...

  4. 离线安装Cloudera Manager 5和CDH5(最新版5.1.3) 完全教程

    关于CDH和Cloudera Manager CDH (Cloudera's Distribution, including Apache Hadoop),是Hadoop众多分支中的一种,由Cloud ...

  5. UVA 10954 Add All 哈夫曼编码

    题目链接: 题目 Add All Time Limit:3000MS Memory Limit:0KB 问题描述 Yup!! The problem name reflects your task; ...

  6. 利用 Docker 搭建单机的 Cloudera CDH 以及使用实践

    想用 CDH 大礼包,于是先在 Mac 上和 Centos7.4 上分别搞个了单机的测试用.其实操作的流和使用到的命令差不多就一并说了: 首先前往官方下载包: https://www.cloudera ...

  7. hadoop系列 第一坑: hdfs JournalNode Sync Status

    今天早上来公司发现cloudera manager出现了hdfs的警告,如下图: 解决的思路是: 1.首先解决简单的问题,查看警告提示的设置的阀值时多少,这样就可以快速定位到问题在哪了,果然Journ ...

  8. Cloudera Manager5及CDH5在线(cloudera-manager-installer.bin)安装详细文档

    问题导读:1.Cloudera Manager5如何使用cloudera-manager-installer.bin安装?2.Cloudera Manager5安装被中断该如何继续安装?还是重新安装? ...

  9. 【转】XZip and XUnzip - Add zip and/or unzip to your app with no extra .lib or .dll

    原文:http://www.codeproject.com/Articles/4135/XZip-and-XUnzip-Add-zip-and-or-unzip-to-your-app-w Downl ...

随机推荐

  1. 【Android Developers Training】 30. 允许其它应用启动你的Activity

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  2. ajax数据请求3(数组json格式)

    ajax数据请求3(数组json格式) <!doctype html> <html> <head> <meta charset="utf-8&quo ...

  3. Struts2之初识篇(一)——与struts的区别和基本配置

    Struts2资源下载地址: Struts官方地址:http://struts.apache.org/ 我这里下载了struts2的最新版本struts2-2.5.10.1-all.所有内容如下图: ...

  4. win32SDK的hello,world程序(二)

    接上篇,原生的控件都不太好看,所以决定自己画一个,稍微处理下消息就能用了.不过,美化这东西是需要天赋的.即使技术再好,没有对UI布局调整和良好的审美能力,做出来的东西还是很挫. 主要把消息逻辑和画的过 ...

  5. webpack初步介绍

    我们通过npm -g可以安装一个webpack的东西. npm -g叫做全局安装,通常是安装CLI程序(commond line interface). 我们只用过一次,装了cnpm.此时就能在CMD ...

  6. dict-字典功能介绍

    叨逼叨:#字典 可变类型 意思就是修改的是自己本身#可变类型,当修改后,内存里的值也会对应着修改#不可变类型,当修改后,会在内存里开启一块新的空间,放新的值#1.清空 # name = { # 'na ...

  7. DotNetCore跨平台~EFCore连接Mysql的方式

    回到目录 在.net frameworks的ef里连接mysql我们已经测试通过了,而在dotnet core里的efCore上去连接mysql我们需要测试一下,并且在测试过程中出现了一些问题,当然最 ...

  8. objc[20556]:Class JavaLaunchHelper is implemented in both xxx 警告处理

    今天在Mac上对IntelliJ Idea 进行了升级 升级到2017.01后,运行程序时,出现以下红色警告: objc[20556]: Class JavaLaunchHelper is imple ...

  9. ES6——块级作用域

    前面的话 过去,javascript缺乏块级作用域,var声明时的声明提升.属性变量等行为让人困惑.ES6的新语法可以帮助我们更好地控制作用域.本文将详细介绍ES6新引入的块级作用域绑定机制.let和 ...

  10. 途虎养车Tuhu商城系统开发

    途虎养车Tuhu商城系统开发,咨询:何经理152-2217-7508(微信同号)途虎养车商城小程序开发,途虎养车商城小程序平台开发,途虎养车商城小程序系统开发. 为什么能做得这么好,里面的门道确实不少 ...