Hadoop 2.2.0设置(伪分布式模式):错误//警告util.NativeCodeLoader:无法加载本地hadoop库 [英] Hadoop 2.2.0 Setup (Pseudo-Distributed Mode): ERROR// Warn util.NativeCodeLoader: unable to load native-hadoop library

查看:81
本文介绍了Hadoop 2.2.0设置(伪分布式模式):错误//警告util.NativeCodeLoader:无法加载本地hadoop库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Ubuntu 12.04LTS(64位)上安装了hadoop新版本(2.2.0).

I have recently installed the hadoop new version(2.2.0) on the Ubuntu 12.04LTS (64bit).

并且测试hadoop示例不起作用.

And testing the hadoop example dont work.

如何解决此问题??

Java HotSpot(TM)64位服务器VM警告:您已加载库 /usr/local/hadoop/lib/native/libhadoop.so.1.0.0,其中可能包含 禁用堆栈保护. VM将立即尝试修复堆栈保护.它是 强烈建议您使用'execstack -c修复库 ",或将其链接到"-z noexecstack". 13/11/22 20:44:58警告 util.NativeCodeLoader:无法为您的本机-hadoop库加载 平台...在适当的地方使用内建的Java类 java.net.ConnectException:从ssel-PEGATRON/127.0.1.1调用 本地主机:9000在连接异常时失败: java.net.ConnectException:连接被拒绝;有关更多详细信息,请参见: http://wiki.apache.org/hadoop/ConnectionRefused sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法) 在 sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 在 sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 在java.lang.reflect.Constructor.newInstance(Constructor.java:526) 在org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783) 在org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:730) 在org.apache.hadoop.ipc.Client.call(Client.java:1351)处 org.apache.hadoop.ipc.Client.call(Client.java:1300)在 org.apache.hadoop.ipc.ProtobufRpcEngine $ Invoker.invoke(ProtobufRpcEngine.java:206) 在com.sun.proxy.$ Proxy9.getFileInfo(未知源)处 sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)位于 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:606)在 org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:186) 在 org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102) 在com.sun.proxy.$ Proxy9.getFileInfo(未知源)处 org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:651) 在org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1679) 在 org.apache.hadoop.hdfs.DistributedFileSystem $ 17.doCall(DistributedFileSystem.java:1106) 在 org.apache.hadoop.hdfs.DistributedFileSystem $ 17.doCall(DistributedFileSystem.java:1102) 在 org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) 在 org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1102) 在org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1397)处 org.apache.hadoop.examples.QuasiMonteCarlo.estimatePi(QuasiMonteCarlo.java:278) 在 org.apache.hadoop.examples.QuasiMonteCarlo.run(QuasiMonteCarlo.java:354) 在org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)处 org.apache.hadoop.examples.QuasiMonteCarlo.main(QuasiMonteCarlo.java:363) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:606)在 org.apache.hadoop.util.ProgramDriver $ ProgramDescription.invoke(ProgramDriver.java:72) 在org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144) 在 org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:606)在 org.apache.hadoop.util.RunJar.main(RunJar.java:212)由以下原因引起: java.net.ConnectException:连接在处被拒绝 sun.nio.ch.SocketChannelImpl.checkConnect(本机方法)位于 sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735) 在 org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) 在org.apache.hadoop.net.NetUtils.connect(NetUtils.java:529)处 org.apache.hadoop.net.NetUtils.connect(NetUtils.java:493)在 org.apache.hadoop.ipc.Client $ Connection.setupConnection(Client.java:547) 在 org.apache.hadoop.ipc.Client $ Connection.setupIOstreams(Client.java:642) 在 org.apache.hadoop.ipc.Client $ Connection.access $ 2600(Client.java:314) 在org.apache.hadoop.ipc.Client.getConnection(Client.java:1399) org.apache.hadoop.ipc.Client.call(Client.java:1318)...还有33个

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /usr/local/hadoop/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'. 13/11/22 20:44:58 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable java.net.ConnectException: Call From ssel-PEGATRON/127.0.1.1 to localhost:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.hadoop.net.NetUtils.wrapWithMessage(NetUtils.java:783) at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:730) at org.apache.hadoop.ipc.Client.call(Client.java:1351) at org.apache.hadoop.ipc.Client.call(Client.java:1300) at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:206) at com.sun.proxy.$Proxy9.getFileInfo(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:186) at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102) at com.sun.proxy.$Proxy9.getFileInfo(Unknown Source) at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.getFileInfo(ClientNamenodeProtocolTranslatorPB.java:651) at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1679) at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1106) at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1102) at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1102) at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1397) at org.apache.hadoop.examples.QuasiMonteCarlo.estimatePi(QuasiMonteCarlo.java:278) at org.apache.hadoop.examples.QuasiMonteCarlo.run(QuasiMonteCarlo.java:354) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70) at org.apache.hadoop.examples.QuasiMonteCarlo.main(QuasiMonteCarlo.java:363) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72) at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144) at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.hadoop.util.RunJar.main(RunJar.java:212) Caused by: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735) at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:529) at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:493) at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:547) at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:642) at org.apache.hadoop.ipc.Client$Connection.access$2600(Client.java:314) at org.apache.hadoop.ipc.Client.getConnection(Client.java:1399) at org.apache.hadoop.ipc.Client.call(Client.java:1318) ... 33 more

推荐答案

hadoop-env.sh yarn-env.sh 中添加以下几行:

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

这篇关于Hadoop 2.2.0设置(伪分布式模式):错误//警告util.NativeCodeLoader:无法加载本地hadoop库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆