Hadoop 在启动的时候出现以下问题:

bhbase6: Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop/lib/native/libhadoop.so which might have disabled stack guard. The VM will try to fix the stack guard now.
bhbase6: It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
bhbase2: Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop/lib/native/libhadoop.so which might have disabled stack guard. The VM will try to fix the stack guard now.
bhbase2: It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
bhbase5: Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop/lib/native/libhadoop.so which might have disabled stack guard. The VM will try to fix the stack guard now.
bhbase5: It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.


出现这个问题基本都是在64位操作系统上,这主要是因为Hadoop官网上下载的本地库文件都是基于32位系统编译的,如果在64位系统上运行会出现这个问题错误。解决的方法 有两种:


一、在64为操作系统上重写编译Hadoop文件


二、在etc/hadoop/目录中的 hadoop-env.sh和yarn-env.sh 这两个文件中添加如下两行代码:


export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_PREFIX}/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_PREFIX/lib"