在kubernetes集群中为hadoop pod安装外部磁盘时出现问题

k2arahey  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(380)

背景:我有一个kubernetes集群,它有一个spark集群(集群外有驱动程序)和hadoop pod。我将hadoop pod的文件夹路径挂载到一个外部磁盘上。
问题:spark cluster尝试在hdfs中创建检查点文件夹时出现以下异常。

java.io.EOFException: End of File Exception between local host is: "jfgubq745vn2ym-tg1isslukll1u3/10.92.0.135"; destination host is: "dev-dev-hadoop":9000; : java.io.EOFException; For more details see: http://wiki.apache.org/hadoop/EOFException 
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:791) 
at org.apache.hadoop.net.NetUtils.wrapException(NetUtils.java:764) 
at org.apache.hadoop.ipc.Client.call(Client.java:1472) 
at org.apache.hadoop.ipc.Client.call(Client.java:1399) 
at org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:232) 
at com.sun.proxy.$Proxy28.mkdirs(Unknown Source) 
at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolTranslatorPB.mkdirs(ClientNamenodeProtocolTranslatorPB.java:539) 
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:187) 
at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102) 
at com.sun.proxy.$Proxy29.mkdirs(Unknown Source) 
at org.apache.hadoop.hdfs.DFSClient.primitiveMkdir(DFSClient.java:2753) 
at org.apache.hadoop.hdfs.DFSClient.mkdirs(DFSClient.java:2724) 
at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:870) 
at org.apache.hadoop.hdfs.DistributedFileSystem$17.doCall(DistributedFileSystem.java:866) 
at org.apache.hadoop.fs.FileSystemLinkResolver.resolve(FileSystemLinkResolver.java:81) 
at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirsInternal(DistributedFileSystem.java:866) 
at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirs(DistributedFileSystem.java:859) 
at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:1817) 
at org.apache.spark.streaming.StreamingContext.checkpoint(StreamingContext.scala:233) 
...
at scala.util.Try$.apply(Try.scala:161) 
at falkonry.tercel.process.Main$.main(Main.scala:54) 
at falkonry.tercel.process.Main.main(Main.scala) 
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.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$runMain(SparkSubmit.scala:664) 
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:169) 
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:192) 
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:111) 
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) 

Caused by: java.io.EOFException 
at java.io.DataInputStream.readInt(DataInputStream.java:392) 
at org.apache.hadoop.ipc.Client$Connection.receiveRpcResponse(Client.java:1071) 
at org.apache.hadoop.ipc.Client$Connection.run(Client.java:966)

如果我没有挂载到外部磁盘的路径,这将很好地工作。

piztneat

piztneat1#

这个问题解决了。我用于hadoop容器的docker映像在启动时不格式化外部装入的磁盘。我编辑了dockerfile并将其设置为外部挂载路径的格式。更新的dockerfilehttps://github.com/falkonry/docker-hadoop/blob/master/dockerfile

相关问题