标签:
sudo
apt-get install openssh-server
Generate a SSH key:ssh-keygen
-t rsa -P ""
Enable SSH key:cat
$HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
(Optional) Disable SSH login from remote addresses by setting in /etc/ssh/sshd_config:ListenAddress
127.0.0.1
Test local connection:ssh
localhost
If Ok, then exit:exit
Otherwise
debug tar
xvf hadoop-2.2.0.tar.gz
mv
hadoop-2.2.0 ~/hadoop
mkdir
-p ~/hadoop/data/namenode
mkdir
-p ~/hadoop/data/datanode
export
JAVA_HOME="`dirname $(readlink /etc/alternatives/java)`/../"export HADOOP_COMMON_LIB_NATIVE_DIR="~/hadoop/lib"export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=~/hadoop/lib"
<property>
<name>fs.default.name</name> <value>hdfs://localhost:9000</value></property>
<property>
<name>dfs.replication</name> <value>1</value></property><property> <name>dfs.namenode.name.dir</name> <value>${user.home}/hadoop/data/namenode</value></property><property> <name>dfs.datanode.data.dir</name> <value>${user.home}/hadoop/data/datanode</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>
cp
~/hadoop/etc/hadoop/mapred-site.xml.template ~/hadoop/etc/hadoop/mapred-site.xml
And insert (inside <configuration> tag):<property>
<name>mapreduce.framework.name</name> <value>yarn</value></property>
echo
"export PATH=$PATH:~/hadoop/bin:~/hadoop/sbin" >> ~/.bashrc
source
~/.bashrc
hdfs
namenode -format
start-dfs.sh
&& start-yarn.sh
If you get the warning:
WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicableIt is because you are running on 64bit but Hadoop native library is 32bit. This is not a big issue. If you want (optional) to fix it, check this.
jps
Expected
output (PIDs may change!):10969
DataNode11745 NodeManager11292 SecondaryNameNode10708 NameNode11483 ResourceManager13096 Jps
N.B. The old JobTracker has been replaced by the ResourceManager.hadoop
jar ~/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar TestDFSIO -write -nrFiles 20 -fileSize 10
Check the results and remove files:hadoop
jar ~/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-client-jobclient-2.2.0-tests.jar TestDFSIO -clean
And:hadoop
jar ~/hadoop/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.2.0.jar pi 2 5
stop-dfs.sh
&& stop-yarn.sh
标签:
原文地址:http://blog.csdn.net/yechaodechuntian/article/details/44245591