码迷,mamicode.com
首页 > 其他好文 > 详细

Hadoop之—— CentOS Warning: $HADOOP_HOME is deprecated解决方案

时间:2015-06-06 18:18:29      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:hadoop   mapreduce   centos   解决方案   deprecated   

转载请注明出处:http://blog.csdn.net/l1028386804/article/details/46389499

启动Hadoop时报了一个警告信息,我安装的Hadoop版本是hadoop1.0.4,具体警告信息如下:

[root@localhost hadoop-1.0.4]# ./bin/start-all.sh
Warning: $HADOOP_HOME is deprecated.
网上的说法是因为Hadoop本身对HADOOP_HOME做了判断,具体在bin/hadoop和bin/hadoop-config.sh里。在hadoop-config.sh里有如下的配置:
if [ "$HADOOP_HOME_WARN_SUPPRESS" = "" ] && [ "$HADOOP_HOME" != "" ]; then
  echo "Warning: \$HADOOP_HOME is deprecated." 1>&2
  echo 1>&2
fi
对于这个警告问题,解决方法如下: 

1.注释掉hadoop-config.sh里的上面给出的这段if fi配置(不推荐)

2.在/etc/profile里增加一个环境变量:

export HADOOP_HOME_WARN_SUPPRESS=1

注:修改完profile后需要执行source操作使其生效

source /etc/profile
备注:在ubuntu下应该是修改/home/.bashrc文件,增加一行 export HADOOP_HOME_WARN_SUPPRESS=1

 执行完后我们可以检验一下配置是否成功,重新执行start-all.sh脚本:

[root@localhost hadoop-1.0.4]# ./bin/start-all.sh 
starting namenode, logging to /root/hadoop-1.0.4/libexec/../logs/hadoop-root-namenode-localhost.out
localhost: starting datanode, logging to /root/hadoop-1.0.4/libexec/../logs/hadoop-root-datanode-localhost.out
localhost: starting secondarynamenode, logging to /root/hadoop-1.0.4/libexec/../logs/hadoop-root-secondarynamenode-localhost.out
starting jobtracker, logging to /root/hadoop-1.0.4/libexec/../logs/hadoop-root-jobtracker-localhost.out
localhost: starting tasktracker, logging to /root/hadoop-1.0.4/libexec/../logs/hadoop-root-tasktracker-localhost.out
没有出现Warning: $HADOOP_HOME is deprecated,说明问题已经解决。





Hadoop之—— CentOS Warning: $HADOOP_HOME is deprecated解决方案

标签:hadoop   mapreduce   centos   解决方案   deprecated   

原文地址:http://blog.csdn.net/l1028386804/article/details/46389499

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!