sudo apt-get update
sudo apt-get install default-jdk
update-alternatives --display java
sudo apt-get install ssh
sudo apt-get install rsync
#产生 SSH Key
ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
#查看产生的SSH Key
ll ~/.ssh
#将产生的Key放置到许可证文件中
cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
sudo tar -zxvf hadoop-2.7.6.tar.gz
sudo mv hadoop-2.7.6 /usr/local/hadoop
ll /usr/local/hadoop/
#编辑~/.bashrc
sudo gedit ~/.bashrc
#设置JDK安装路径
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
export HADOOP_MAPRED_HOME=$HADOOP_HOME
export HADOOP_COMMON_HOME=$HADOOP_HOME
export HADOOP_HDFS_HOME=$HADOOP_HOME
export YARN_HOME=$HADOOP_HOME
#链接库的相关设置
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_HOME/lib"
export JAVA_LIBRARY_PATH=$HADOOP_HOME/lib/native:$JAVA_LIBRARY_PATH
source ~/.bashrc
sudo gedit /usr/local/hadoop/etc/hadoop/hadoop-env.sh
修改export JAVA_HOME=¥{JAVA_HOME}为export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
sudo gedit /usr/local/hadoop/etc/hadoop/core-site.xml
fs.default.namehdfs://localhost:9000
sudo gedit /usr/local/hadoop/etc/hadoop/yarn-site.xml
yarn.nodemanager.aux.servicesmapreduce_shuffleyarn.nodemanager.aux.services.mapreduce.shuffle.classorg.apache.hadoop.mapred.ShuffleHandler
sudo cp /usr/local/hadoop/etc/hadoop/mapred-site.xml.template /usr/local/hadoop/etc/hadoop/mapred-site.xml
sudo gedit /usr/local/hadoop/etc/hadoop/mapred-site.xml
mapreduce.framework.nameyarn
sudo gedit /usr/local/hadoop/etc/hadoop/hdfs-site.xml
dfs.replication3dfs.namenode.name.idfile:/usr/local/hadoop/hadoop_data/hdfs/namenodedfs.datanode.data.dirfile:/usr/local/hadoop/hadoop_data/hdfs/datanode
sudo mkdir -p /usr/local/hadoop/hadoop_data/hdfs/namenode
sudo mkdir -p /usr/local/hadoop/hadoop_data/hdfs/datanode
sudo chown hduser:hduser -R /usr/local/hadoop
#将HDFS进行格式化
hadoop namenode -format
start-dfs.sh
start-yarn.sh
#查看NameNode、DataNode进程是否启动
jps