虚拟机安装的Ubuntu为32位14.04版
启动 Hadoop : $ sbin/start-dfs.sh
接着出现包含以下内容的错误:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [Java HotSpot(TM) Client VM warning: You have loaded library /home/<user>/hadoop/hadoop-2.5.1/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]
Client: ssh: Could not resolve hostname client: Name or service not known
have: ssh: Could not resolve hostname have: Name or service not known
library: ssh: Could not resolve hostname library: Name or service not known
fix: ssh: Could not resolve hostname fix: Name or service not known
-c: Unknown cipher type 'cd'
fix: ssh: Could not resolve hostname fix: Name or service not known
the: ssh: Could not resolve hostname the: Name or service not known
....
需要在Ubuntu的环境变量文件(etc/profile)内增加以下参数
#以用户实际路径为准
export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib"
在 hadoop-env.sh 内增加 JAVA_HOME 路径
export JAVA_HOME=/home/<user>/jdk7