今天在通过./start-all.sh启动Hadoop集群的时候报了如下的错误
root@master:/usr/local/hadoop-2.7.2/sbin# ./start-all.shThis script is Deprecated. Instead use start-dfs.sh and start-yarn.sh16/06/16 17:54:32 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicableStarting namenodes on [Java HotSpot(TM) Client VM warning: You have loaded library /usr/local/hadoop-2.7.2/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', or link it with '-z noexecstack'.master]sed: -e expression #1, char 6: unknown option to `s'HotSpot(TM): ssh: Could not resolve hostname hotspot(tm): Temporary failure in name resolutionJava: ssh: Could not resolve hostname java: Temporary failure in name resolutionYou: ssh: Could not resolve hostname you: Temporary failure in name resolutionhave: ssh: Could not resolve hostname have: Temporary failure in name resolutionnow.: ssh: Could not resolve hostname now.: Temporary failure in name resolutionhave: ssh: Could not resolve hostname have: Temporary failure in name resolutionloaded: ssh: Could not resolve hostname loaded: Temporary failure in name resolutionstack: ssh: Could not resolve hostname stack: Temporary failure in name resolution
好了去查查,解决方法如下 在 /etc/profile 中添加如下信息:
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/nativeexport HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
执行 source /etc/profile 使之立即生效。