Trouble mounting external disk for hadoop pod in kubernetes cluster

8/25/2015

Background : I have a kubernetes cluster which has a spark cluster (with driver outside the cluster) and hadoop pod. I mounted the folder path of hadoop pod to one of the external disk.

Issue : I'm getting below exception when spark cluster tries to create a checkpointing folder in 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)

This works well if I do not mount a path to external disk.

-- Phagun Baya
hadoop
kubernetes

1 Answer

3/21/2016

This issue is resolved. The docker image I was using for hadoop container does not format external mounted disks on startup. I edited the dockerfile and made it to format the external mounted paths. Updated dockerfile https://github.com/Falkonry/docker-hadoop/blob/master/Dockerfile

-- Phagun Baya
Source: StackOverflow