dnordgren / CSCE835

Workspace for Group 8 of CSCE 435/835 (Cluster & Grid Computing)
head.pi.cluster.unl.edu :)
0 stars 0 forks source link

Install and configure HDFS #14

Closed bhushit closed 9 years ago

bhushit commented 9 years ago

Install cloudera's packaging of hadoop,

sudo yum install http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm

sudo yum install hadoop-hdfs-namenode
sudo yum install hadoop-hdfs-datanode

Added the following config to /etc/hadoop/conf/core-site.xml,

<configuration>
 <property>
 <name>fs.default.name</name>
 <value>hdfs://hcc-group8head.unl.edu:9000</value>
 </property>
 <property>
 <name>dfs.replication</name>
 <value>2</value>
 </property>
 <property>
 <name>dfs.block.size</name>
 <value>16777216</value>
 </property>
</configuration>

Start condor service sudo service hadoop-hdfs-namenode start

Format namenode hadoop namenode -format

This failed, so checked the logs and it said,

2015-11-13 00:25:37,157 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: NameNode metrics system shutdown complete.
2015-11-13 00:25:37,158 FATAL org.apache.hadoop.hdfs.server.namenode.NameNode: Exception in namenode join
org.apache.hadoop.hdfs.server.common.InconsistentFSStateException: Directory /var/lib/hadoop-hdfs/cache/hdfs/dfs/name is in an inconsistent state: storage directory does not exist or is not accessible.
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverStorageDirs(FSImage.java:302)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:207)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:741)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:531)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:403)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:445)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:621)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:606)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1177)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1241)
2015-11-13 00:25:37,163 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2015-11-13 00:25:37,165 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG: 

Tried changing permissions of the folder as suggested on internet, but it caused another exception,

2015-11-13 11:04:30,022 INFO org.apache.hadoop.metrics2.impl.MetricsSystemImpl: NameNode metrics system shutdown complete.
2015-11-13 11:04:30,023 FATAL org.apache.hadoop.hdfs.server.namenode.NameNode: Exception in namenode join
java.io.FileNotFoundException: /var/lib/hadoop-hdfs/cache/hdfs/dfs/name/current/VERSION (Permission denied)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
        at org.apache.hadoop.hdfs.server.common.Storage.readPropertiesFile(Storage.java:966)
        at org.apache.hadoop.hdfs.server.common.Storage.readProperties(Storage.java:915)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverStorageDirs(FSImage.java:314)
        at org.apache.hadoop.hdfs.server.namenode.FSImage.recoverTransitionRead(FSImage.java:207)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFSImage(FSNamesystem.java:741)
        at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.loadFromDisk(FSNamesystem.java:531)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.loadNamesystem(NameNode.java:403)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:445)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:621)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:606)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1177)
        at org.apache.hadoop.hdfs.server.namenode.NameNode.main(NameNode.java:1241)
2015-11-13 11:04:30,027 INFO org.apache.hadoop.util.ExitUtil: Exiting with status 1
2015-11-13 11:04:30,029 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: SHUTDOWN_MSG: 

Then changed the owner of the folder /var/lib/hadoop-hdfs/cache/hdfs/dfs/name/current/ to hdfs,

chown -R hdfs:hdfs /var/lib/hadoop-hdfs/cache/hdfs/dfs/name/current/

Restarted the hadoop service, sudo service hadoop-hdfs-namenode restart

Found --No errors in logs--, YAYY

Format the namenode, hadoop namenode -format

One node is up and working, can be tested using, http://hcc-group8head.unl.edu:50070/dfshealth.jsp

Start the datanode now, sudo service hadoop-hdfs-datanode start

bhushit commented 9 years ago

Need to repeat this on workers

bhushit commented 9 years ago

Did not have to repeat all steps on workers, workers just need a datanode and not namenode, hence

sudo yum install http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm

sudo yum install hadoop-hdfs-datanode

Create and add the following to the config file, /etc/hadoop/conf/core-site.xml,

<configuration>
 <property>
 <name>fs.default.name</name>
 <value>hdfs://hcc-group8head.unl.edu:9000</value>
 </property>
 <property>
 <name>dfs.replication</name>
 <value>2</value>
 </property>
 <property>
 <name>dfs.block.size</name>
 <value>16777216</value>
 </property>
</configuration>

Start the datanode,

sudo service hadoop-hdfs-datanode start

All the nodes are visible as live nodes on the health check page