(新手)解决Hadoop安装完毕后的启动报错 ssh: Could not resolve hostname Java: Name or service not known

环境:

CentOS 6.5(64bit)

JDK1.7.0_79(64bit)

Hadoop-2.4.1

问题描述:

安装时无异常,cd到sbin目录下启动start-dfs.sh时控制台报错,如ssh: Could not resolve hostname Java: Name or service not known。起初认为是windows或linux端的hosts配置域名有误,核对后发现无问题。接下来到网上查询了一遍,stackoverflow论坛中有类似贴,hadoop 2.2.0 64bit installing but cannot start与我这边的问题很接近,就尝试着按照贴中方法解决。

经验分享:

ssh: Could not resolve hostname Java: Name or service not known
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
用法见:SSH本机免登陆密码
控制台中出现lib类似问题可能是hadoop无法调取包内第三方类库,以下为解决办法
vi ~/.bashrc 或 /etc/profile,输入
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
 
  

 
  


你可能感兴趣的:(hadoop)