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

再次启动,问题就解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值