标签:
. Required Software
yum install openssh-server rsync java-1.8.0-openjdk-devel
. Setup Hostname
/etc/hosts
x.x.x.x yourhostname
. Prepare to Start the Hadoop Cluster
etc/hadoop/hadoop-env.sh:
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
?
. Standalone Operation
mkdir input
cp etc/hadoop/*.xml input
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar grep input output ‘dfs[a-z.]+‘
cat output/*
. Pseudo-Distributed Operation
etc/hadoop/core-site.xml:
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
etc/hadoop/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
. Setup passphraseless ssh
. Execution
bin/hdfs namenode -format
sbin/start-dfs.sh
. Make the HDFS directories
bin/hdfs dfs -mkdir /user
bin/hdfs dfs -mkdir /user/root
. Copy the input files into the distributed filesystem:
bin/hdfs dfs -put etc/hadoop input
. Run some of the examples
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.2.jar grep input output ‘dfs[a-z.]+‘
. Copy the output files from the distributed filesystem to the local filesystem
bin/hdfs dfs -get output output
. Stop
sbin/stop-dfs.sh
. YARN on a Single Node
etc/hadoop/mapred-site.xml:
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
etc/hadoop/yarn-site.xml:
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
. Start ResourceManager daemon and NodeManager daemon
sbin/start-yarn.sh
ResourceManager - http://localhost:8088/
NameNode - http://localhost:50070/
Hadoop Standalone and Pseudo Mode
标签:
原文地址:http://www.cnblogs.com/wuzhenzhou/p/5788809.html