I am having my students use bdutil
to create a Google Compute Engine cluster with persistent disks and HDFS as the default filesystem. We want to have persistent disks so that the students can work on projects over a period of weeks. However, HDFS doesn’t seem usable after I redeploy the cluster.
My question is really "How do I maintain a persistent HDFS filesystems across redeployments of a cluster?"
Here is what I have tried
Everything works fine on the initial deployment, which creates the persistent disk. I create a directory with the command
$ hadoop fs -mkdir /foo
$ hadoop fs –put foo.txt /foo/foo.txt
$ hadoop fs –cat /foo/foo.txt
foo
I then delete and redeply the cluster with DELETE_ATTACHED_PDS_ON_DELETE=false
and CREATE_ATTACHED_PDS_ON_DEPLOY=false
to preserve the persistent disks across the redeployment
When I ssh into the redeployed cluster, I can see the file I created
$ hadoop fs –ls /foo
Found 1 items
-rw-r--r-- 3 mpcs supergroup 4 2014-10-01 13:16 /foo/foo.txt
However, any attempt to access the contents of the files fails:
$ hadoop fs –cat /foo/foo.txt
cat: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Zero blocklocations for /foo/foo.txt. Name node is in safe mode
Manually turning off safe code doesn't help
$ hadoop dfsadmin -safemode leave
Safe mode is OFF
$ hadoop fs –cat /foo/foo.txt
14/10/01 13:31:20 INFO hdfs.DFSClient: No node available for: blk_2908405986797013125_1002 file=/foo/foo.txt
14/10/01 13:31:20 INFO hdfs.DFSClient: Could not obtain blk_2908405986797013125_1002 from any node: java.io.IOException: No live nodes contain current block. Will get new block locations from namenode and retry...
*etc*
Any suggestions on how to create an HDFS store that can persist across redeploying a cluster would be greatly appreciated
Thanks,
Mike