1.启动HDFS,命令如下:
$ sbin/start-dfs.sh
遇到如下错误:14/10/29 16:49:01 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Starting namenodes on [OpenJDK Server VM warning: You have loaded library /home/baisong/hadoop-2.5.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'
VM: ssh: Could not resolve hostname vm: Name or service not known
library: ssh: Could not resolve hostname library: 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
might: ssh: Could not resolve hostname might: Name or service not known
warning:: ssh: Could not resolve hostname warning:: Name or service not known
loaded: ssh: Could not resolve hostname loaded: Name or service not known
have: ssh: Could not resolve hostname have: Name or service not known
Server: ssh: Could not resolve hostname server: Name or service not known 分析原因知,没有设置 HADOOP_COMMON_LIB_NATIVE_DIR和HADOOP_OPTS环境变量,在 ~/.bashrc文件中添加如下内容并编译。 export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib" $ source ~/.bashrc
重新启动HDFS,输出如下,表示启动成功。
2.报log不能写入
chown hauser用户:hdoop用户组 -R hadoop目录
版权归原作者 白毛大侠 所有, 如有侵权,请联系我们删除。