Hadoop 2.2.0安装程序(伪分布式模式):错误//警告util.NativeCodeLoader:无法加载native-hadoop库

时间:2013-11-22 11:57:19

标签: hadoop install installation

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

测试hadoop示例不起作用。

如何解决这个问题????

  

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:无法加载native-hadoop库   platform ...在适用的地方使用builtin-java类   java.net.ConnectException:从ssel-PEGATRON / 127.0.1.1调用   localhost:9000连接异常失败:   java.net.ConnectException:连接被拒绝;有关更多详情,请参阅   http://wiki.apache.org/hadoop/ConnectionRefused at   sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)     在   sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)     在   sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at 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)at   org.apache.hadoop.ipc.Client.call(Client.java:1300)at   org.apache.hadoop.ipc.ProtobufRpcEngine $ Invoker.invoke(ProtobufRpcEngine.java:206)     在com.sun.proxy。$ Proxy9.getFileInfo(未知来源)at   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:606)at   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(未知来源)at   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)at   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)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)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:606)at   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)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:606)at   org.apache.hadoop.util.RunJar.main(RunJar.java:212)引起:   java.net.ConnectException:拒绝连接   sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)at   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)at   org.apache.hadoop.net.NetUtils.connect(NetUtils.java:493)at   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)at   org.apache.hadoop.ipc.Client.call(Client.java:1318)... 33更多

1 个答案:

答案 0 :(得分:1)

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"