hadoop 启动提示输入password的问题

hadoop启动时,如果没有配置ssh免秘钥登录的话,会提示要求输入password:

[xxx@*** /home/q/www/hadoop-2.6.4]$ sudo -u tomcat sbin/start-all.sh 
This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh
16/12/27 16:41:36 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
tomcat@localhost's password: 
tomcat@localhost's password: localhost: Permission denied, please try again.


此时,需要配置本机的免秘钥登录

cd ~/.ssh
ssh-keygen -t rsa
cat id_rsa.pub >> authorized_keys 


然后再次执行:sudo -u tomcat sbin/start-all.sh (公司要求项目尽可能以tomcat用户启动),仍然报相同的错误。因为配的秘钥是当前用户的,所以对tomcat用户无法生效。所以用默认账户启动:

sbin/start-all.sh 
此时可能会报如下错误:

16/12/27 17:42:07 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [localhost]
localhost: Error: JAVA_HOME is not set and could not be found.
localhost: Error: JAVA_HOME is not set and could not be found.
Starting secondary namenodes [0.0.0.0]
0.0.0.0: Error: JAVA_HOME is not set and could not be found.
16/12/27 17:42:10 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable



需要修改hadoop-env.sh,将JAVA_HOME改为绝对路径:

export JAVA_HOME=/usr/local/jdk1.7.0_79
1
再次启动,问题就解决了。
--------------------- 
作者:xiongjiezk 
来源:CSDN 
原文:https://blog.csdn.net/xiongjiezk/article/details/53898234 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/SuperstarSteven/article/details/88951602
今日推荐