Hadoop之——Could not resolve hostname XX错误解决办法

来源:互联网 发布:大学练字钢笔推荐 知乎 编辑:程序博客网 时间:2024/06/06 19:57

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

安装hadoop2.x,启动报错,格式化namenode是成功的,但是在执行sbin/start-dfs.sh 的时候报错,错误信息如下:

hadoop@ubuntu:~/opt/hadoop-2.4.0$ sbin/start-dfs.sh

15/05/27 04:50:59 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable

Starting namenodes on [Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/hadoop/opt/hadoop-2.4.0/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.

It’s highly recommended that you fix the library with ‘execstack -c <libfile>’, or link it with ‘-z noexecstack’.

localhost]

sed: -e expression #1, char 6: unknown option to `s’

guard.: ssh: Could not resolve hostname guard.: Name or service not known

now.: ssh: Could not resolve hostname now.: Name or service not known

-c: Unknown cipher type ‘cd’

noexecstack’.: ssh: Could not resolve hostname noexecstack’.: Name or service not known

have: ssh: Could not resolve hostname have: Name or service not known

VM: ssh: Could not resolve hostname vm: Name or service not known

highly: ssh: Could not resolve hostname highly: Name or service not known

fix: ssh: Could not resolve hostname fix: Name or service not known

the: ssh: Could not resolve hostname the: Name or service not known

The: ssh: Could not resolve hostname the: Name or service not known

VM: ssh: Could not resolve hostname vm: Name or service not known

have: ssh: Could not resolve hostname have: Name or service not known

which: ssh: Could not resolve hostname which: Name or service not known

stack: ssh: Could not resolve hostname stack: Name or service not known

You: ssh: Could not resolve hostname you: Name or service not known

loaded: ssh: Could not resolve hostname loaded: Name or service not known

the: ssh: Could not resolve hostname the: Name or service not known

64-Bit: ssh: Could not resolve hostname 64-bit: Name or service not known

Server: ssh: Could not resolve hostname server: Name or service not known

try: ssh: Could not resolve hostname try: Name or service not known

………………………………………………

各种ssh错误不断的刷屏,给人一种很不爽的感觉,咋一看,还以为ssh没有那个啥没有实现无密码登录,搞定一切后发现问题还是没有解决,etc/profile也配置了如下的hadoop相关路径啊!

export HADOOP_HOME=/home/hadoop/opt/hadoop-2.4.0export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOOME/sbin:$HADOOP_HOME/lib 

解决办法:

修改etc/profile配置文件,添加:

export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/nativeexport HADOOP_OPTS=”-Djava.library.path=$HADOOP_HOME/lib” 
执行source /etc/profile使文件生效。再次运行相同的命令没有报错




0 0