设为首页 加入收藏

TOP

hadoop格式化(或者启动hadoop)的时候出现名称和服务不识别错误
2018-12-07 00:40:09 】 浏览:5
Tags:hadoop 格式 或者 启动 时候 出现 名称 服务 识别 错误

在第一次格式化hadoop的时候,可能会出现以下错误信息:

  1. 14/08/1007:07:57WARNutil.NativeCodeLoader:Unabletoloadnative-hadooplibraryforyourplatform...usingbuiltin-javaclasseswhereapplicable
  2. Stoppingnamenodeson[JavaHotSpot(TM)64-BitServerVMwarning:Youhaveloadedlibrary/home/hadoop/hadoop-2.2.0/lib/native/libhadoop.so.1.0.0whichmighthavedisabledstackguard.TheVMwilltrytofixthestackguardnow.
  3. It'shighlyrecommendedthatyoufixthelibrarywith'execstack-c<libfile>',orlinkitwith'-znoexecstack'.
  4. cluster1]
  5. sed:-eexpression#1,char6:unknownoptionto`s'
  6. -c:Unknownciphertype'cd'
  7. ^Ccluster1:stoppingnamenode
  8. cluster1:stoppingdatanode
  9. VM:ssh:CouldnotresolvehostnameVM:Nameorservicenotknown
  10. stack:ssh:Couldnotresolvehostnamestack:Nameorservicenotknown
  11. warning::ssh:Couldnotresolvehostnamewarning::Nameorservicenotknown
  12. will:ssh:Couldnotresolvehostnamewill:Nameorservicenotknown
  13. which:ssh:Couldnotresolvehostnamewhich:Nameorservicenotknown
  14. fix:ssh:Couldnotresolvehostnamefix:Nameorservicenotknown
  15. disabled:ssh:Couldnotresolvehostnamedisabled:Nameorservicenotknown
  16. have:ssh:Couldnotresolvehostnamehave:Nameorservicenotknown
  17. 64-Bit:ssh:Couldnotresolvehostname64-Bit:Nameorservicenotknown
  18. guard:ssh:Couldnotresolvehostnameguard:Nameorservicenotknown
  19. HotSpot(TM):ssh:CouldnotresolvehostnameHotSpot(TM):Nameorservicenotknown
  20. Java:ssh:CouldnotresolvehostnameJava:Nameorservicenotknown
  21. VM:ssh:CouldnotresolvehostnameVM:Nameorservicenotknown
  22. stack:ssh:Couldnotresolvehostnamestack:Nameorservicenotknown
  23. The:ssh:CouldnotresolvehostnameThe:Nameorservicenotknown
  24. recommended:ssh:Couldnotresolvehostnamerecommended:Nameorservicenotknown
  25. have:ssh:Couldnotresolvehostnamehave:Nameorservicenotknown
  26. guard.:ssh:Couldnotresolvehostnameguard.:Nameorservicenotknown
  27. Server:ssh:CouldnotresolvehostnameServer:Nameorservicenotknown
  28. loaded:ssh:Couldnotresolvehostnameloaded:Nameorservicenotknown
  29. It's:ssh:CouldnotresolvehostnameIt's:Nameorservicenotknown
  30. try:ssh:Couldnotresolvehostnametry:Nameorservicenotknown
  31. the:ssh:Couldnotresolvehostnamethe:Nameorservicenotknown
  32. You:ssh:CouldnotresolvehostnameYou:Nameorservicenotknown
  33. that:ssh:Couldnotresolvehostnamethat:Nameorservicenotknown
  34. might:ssh:Couldnotresolvehostnamemight:Nameorservicenotknown
  35. you:ssh:Couldnotresolvehostnameyou:Nameorservicenotknown
  36. library:ssh:Couldnotresolvehostnamelibrary:Nameorservicenotknown
  37. fix:ssh:Couldnotresolvehostnamefix:Nameorservicenotknown
  38. to:ssh:Couldnotresolvehostnameto:Nameorservicenotknown
  39. highly:ssh:Couldnotresolvehostnamehighly:Nameorservicenotknown
  40. library:ssh:Couldnotresolvehostnamelibrary:Nameorservicenotknown
  41. the:ssh:Couldnotresolvehostnamethe:Nameorservicenotknown
  42. 'execstack:ssh:Couldnotresolvehostname'execstack:Nameorservicenotknown
  43. '-z:ssh:Couldnotresolvehostname'-z:Nameorservicenotknown
  44. now.:ssh:Couldnotresolvehostnamenow.:Nameorservicenotknown

以上错误可以在/etc/profile加入以下配置

export HADOOP_HOME=/usr/local/hadoop
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"


然后重新格式化,这时将不会提示错误信息,但是还是有警告信息。

4/08/1007:07:57WARNutil.NativeCodeLoader:Unabletoloadnative-hadooplibraryforyourplatform...usingbuiltin-javaclasseswhereapplicable


为了能彻底解决这些问题,我们还需要在/etc/profile文件中添加以下环境变量

export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native

加入了该环境变量,此时如果主机的位数和hadoop库文件的位数不一致也会出现以上的错误。

可以通过uname -a 查看当前系统的信息。

Linux yitian1 2.6.32-573.8.1.el6.x86_64 #1 SMP Tue Nov 10 18:01:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

从以上信息可知,当前系统的linux内核是2.6.32-573.8.1.el6.x86_64,位数是64位



还有通过以下命令查看当前hadoop的库文件是多少位的

file /usr/local/hadoop/lib/native/*


/usr/local/hadoop/lib/native/libhadoop.a: current ar archive
/usr/local/hadoop/lib/native/libhadooppipes.a: current ar archive
/usr/local/hadoop/lib/native/libhadoop.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
/usr/local/hadoop/lib/native/libhadoop.so.1.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
/usr/local/hadoop/lib/native/libhadooputils.a: current ar archive
/usr/local/hadoop/lib/native/libhdfs.a: current ar archive
/usr/local/hadoop/lib/native/libhdfs.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
/usr/local/hadoop/lib/native/libhdfs.so.0.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped


从以上输出信息可以看出,hadoop的版本也是64位的,如果hadoop的版本和系统的版本不一致,则必须要保证他们一致,不一致的情况下,一般是更换hadoop的核心库


注意:记得修改了/etc/profile文件之后,为了让配置立即生效,执行source /etc/profile命令





编程开发网
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇hadoop--谷歌三大论文 下一篇2018-3-7      ..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

array(4) { ["type"]=> int(8) ["message"]=> string(24) "Undefined variable: jobs" ["file"]=> string(32) "/mnt/wp/cppentry/do/bencandy.php" ["line"]=> int(214) }