集群安装:http://blog.csdn.net/linghe301/article/details/9184453
https://www.cnblogs.com/andy6/p/7440804.html
export JAVA_HOME=/usr/lib/jdk1.6.0_45
export PATH=$JAVA_HOME/bin:$PATH
#source ~/.bash_profile
java -version
java version “1.6.0_45”
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
cd ~/.ssh/
ssh-keygen -t dsa
cat id_dsa.pub >> authorized_keys
chmod 600 ./authorized_keys
验证ssh
# ssh localhost
不需要输入密码即可登录。
#tar -xzvf hadoop-2.6.0.tar.gz
解压,解压后目录为:/root/hadoop/hadoop-2.6.0
#mkdir /root/hadoop/tmp
#mkdir /root/hadoop/hdfs
#mkdir /root/hadoop/hdfs/data
#mkdir /root/hadoop/hdfs/name
#vi ~/.bash_profile
# set hadoop path
#vi ~/.bash_profile
# set hadoop path
输入以下内容:
export HADOOP_HOME=/root /hadoop/hadoop-2.6.0
export PATH=$PATH:$HADOOP_HOME/bin
#source ~/.bash_profile
#source ~/.bash_profile
hadoop-2.6.0/etc/hadoop/hadoop-env.sh
hadoop-2.6.0/etc/hadoop/yarn-env.sh
hadoop-2.6.0/etc/hadoop/core-site.xml
hadoop-2.6.0/etc/hadoop/hdfs-site.xml
hadoop-2.6.0/etc/hadoop/mapred-site.xml
hadoop-2.6.0/etc/hadoop/yarn-site.xml
# The java implementation to use.
#export JAVA_HOME=${JAVA_HOME}
export JAVA_HOME=/usr/lib/jdk1.6.0_45
#export JAVA_HOME=/home/y/libexec/jdk1.6.0/
export JAVA_HOME=/usr/lib/jdk1.6.0_45
fs.default.name
hdfs://localhost:9000
HDFS的URI,文件系统://namenode标识:端口号
hadoop.tmp.dir
/root/hadoop/tmp
namenode上本地的hadoop临时文件夹
dfs.name.dir
/root/hadoop/hdfs/name
namenode上存储hdfs名字空间元数据
dfs.data.dir
/root/hadoop/hdfs/data
datanode上数据块的物理存储位置
dfs.replication
1
副本个数,配置默认是3,应小于datanode机器数量
mapreduce.framework.name
yarn
yarn.nodemanager.aux-services
mapreduce_shuffle
yarn.resourcemanager.webapp.address
${yarn.resourcemanager.hostname}:8099
# bin/hdfs namenode –format
# sbin/start-dfs.sh
# sbin/start-yarn.sh
# jps
54679 NameNode
54774 DataNode
15741 Jps
9664 Master
55214 NodeManager
55118 ResourceManager
54965 SecondaryNameNode
http://datanode-4:8099/
即可看到YARN的ResourceManager的界面。注意:默认端口是
8088,这里我设置了yarn.resourcemanager.webapp.address为:${yarn.resourcemanager.hostname}:8099。