First of all, the 64-bit Ubuntu,hadoop officially only provide 32-bit version, so that the start of the local library is not compatible, you need to compile themselves into a 64-bit version, or download someone else compiled 64-bit version.
Download good need to change the following configuration in the Etc/hadoop directory
Where you need to specify Java_home in hadoop-env.sh
Export java_home=/usr/lib/jvm/jdk1.7.0_75
Core-site.xml Configuration
<Configuration>< Property><name>Fs.default.name</name><value>Hdfs://xiao:9000/</value></ Property>< Property><name>Hadoop.native.lib</name><value>True</value><Description>Should native Hadoop libraries, if present, be used.</Description></ Property>< Property><name>Hadoop.tmp.dir</name><value>/home/xiao/download/hadoop-2.4.0/tmp/</value></ Property></Configuration>
Hdfs-site.xml Configuration
<Configuration>< Property><name>Dfs.replication</name><value>1</value></ Property></Configuration>
Mapred-site.xml Configuration
<Configuration>< Property><name>Mapreduce.framework.name</name><value>Yarn</value></ Property></Configuration>
Yarn-site.xml Configuration
<Configuration>< Property><name>Yarn.resourcemanager.hostname</name><value>Xiao</value></ Property>< 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></Configuration>
After configuration, you need to shut down the firewall and install SSH.
sudo apt-get update
sudo apt-get install Openssh-server
Then format Namenode
Hadoop Namenode-format
Then switch to the Sbin directory to start
start-dfs.sh
start-yarn.sh
View files in the directory
Hadoop Fs-ls Hdfs://xiao:9000/
Copy Local files to HDFs
Hadoop fs-put a.txt Hdfs://xiao:9000/
This step landlord encountered a fault
Tried the online various methods invalid.
Look at the logs inside the log where Datanode log no error, Namenode log reported above error, visible and Datanode unrelated, with the command to view datanode status
According to the data of the report Dfs is still the size of (541.63 MB), it should be possible to create, but this exception is thrown, it must be a limit to the remaining minimum capacity of datanode.
Check out the source code for Hadoop 2.2.0, In the Org.apache.hadoop.hdfs.server.blockmanagement.BlockPlacementPolicyDefault method Isgoodtarget, the remaining capacity of the Datanode is judged:
LongRemaining = Node.getremaining ()-(node.getblocksscheduled ()*blockSize); //Check the remaining capacity of the target machine if(blocksize* hdfsconstants.min_blocks_for_write>remaining) { if(log.isdebugenabled ()) {Threadlocalbuilder.get (). Append (Node.tostring ()). Append (": "). Append ("Node"). Append (Nodebase.getpath (node)). Append ("Isn't chosen because the node does not has enough space"); } return false; }
Then the blogger emptied the file under the directory, the remaining size of more than 900 m, and then execute the next command, success.
Hadoop configuration and inability to move files to HDFs fault resolution