1.驗證詞統計程序。————無法加載本地庫
出現錯誤:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/10/22 17:31:38 INFO Configuration.deprecation: session.id is deprecated. Instead, use dfs.metrics.session-id
16/10/22 17:31:38 INFO jvm.JvmMetrics: Initializing JVM Metrics with processName=JobTracker, sessionId=
Exception in thread "main" java.net.ConnectException: Call From master/192.168.164.111 to master: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:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
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:1415)
at org.apache.hadoop.ipc.Client.call(Client.java:1364)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:187)
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:707)
at org.apache.hadoop.hdfs.DFSClient.getFileInfo(DFSClient.java:1785)
at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1068)
at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:1064)
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81)
at org.apache.hadoop.hdfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:1064)
at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1398)
:1463)
at org.apache.hadoop.ipc.Client.call(Client.java:1382)
... 33 more
解決辦法:
1.覆蓋本地/lib/native中的jar配置文件———改成64位. hadoop-native-64-2.5.2 http://pan.baidu.com/s/1nv4irnb
2.在hadoop-env.sh 中添加:
export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/program/hadoop-2.5.2/lib/native/"
export HADOOP_COMMON_LIB_NATIVE_DIR="/usr/program/hadoop-2.5.2/lib/native/"
3.命令 ldd libhadoop.so 查看版本。觀察是否需要更新glibc,
主要在/etc/hadoop/log4j.properties中添加:進行錯誤的跟蹤定位。
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=DEBUG
2.無法啟動datanode
這個問題一般是由於兩次或兩次以上的格式化NameNode造成的,有兩種方法可以解決,第一種方法是刪除DataNode的所有資料(及將集群中每個datanode的/hdfs/data/current中的VERSION刪掉,然后執行hadoop namenode -format重啟集群,錯誤消失。<推薦>);第二種方法是修改每個DataNode的namespaceID(位於/hdfs/data/current/VERSION文件中)<優先>或修改NameNode的namespaceID(位於/hdfs/name/current/VERSION文件中),使其一致。
3.遇到錯誤:INFO: Task Id : attempt_201007191410_0002_m_000000_0, Status : FAILED;“The auxService:mapreduce_shuffle does not exist
解決辦法:
主要是因為yarn-site.xml文件沒有配置好,在文件中添加如下:
<property> <name>yarn.nodemanager.aux-services</name> <value>mapreduce_shuffle</value> </property> <property> <name>yarn.nodemanager.aux-services.mapreduce.shuffle.class</name> <value>org.apache.hadoop.mapred.ShuffleHandler</value> </property>
4.在詞統計程序中,沒有辦法對文件進行操作,只能對文本之類的進行統計。如果在文件內包含有別的文件或者目錄,那么會出現以下錯誤:java.io.FileNotFoundException:Path is not a file:
解決辦法:
將目錄中的文件刪除,使用命令 hadoop fs rm -r 文件名 可以刪除非空目錄