ssh -keygen -t rsa
这里模拟本机登录本机
cd ~/.ssh/
cat id_rsa.pub >> authorized_keys
chmod 644 authorized_keys
直接ssh 主机名免密码登录
ssh bigdata-test01.mykine.cn
vim /etc/profile
JAVA_HOME=/usr/local/java/jdk1.8
JRE_HOME=/usr/local/java/jdk1.8/jre
GOROOT=/usr/local/go
GOPATH=/usr/local/goapps
HADOOP_HOME=/usr/local/hadoop-2.7.2
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$GOROOT/bin:$HADOOP_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH GOROOT GOPATH HADOOP_HOME
重启环境变量
source /etc/profile
2.7旧版本的配置文件目录在etc/hadoop中
cd /usr/local/hadoop-2.7.2/etc/hadoop
以下配置文件中的设置的文件夹不存在要手动创建,例如:
mkdir -p /usr/local/hadoop-2.7.2/current/tmp
fs.default.name
hdfs://bigdata-test01.mykine.cn:9000
hadoop.tmp.dir
/usr/local/hadoop-2.7.2/current/tmp
fs.trash.interval
4320
dfs.namenode.name.dir
/usr/local/hadoop-2.7.2/current/dfs/name
dfs.datanode.data.dir
/usr/local/hadoop-2.7.2/current/data
dfs.replication
1
dfs.webhdfs.enabled
true
dfs.permissions.superusergroup
staff
dfs.permissions.enabled
false
yarn.resourcemanager.hostname
bigdata-test01.mykine.cn
yarn.nodemanager.aux-services
mapreduce_shuffle
yarn.nodemanager.aux-services.mapreduce.shuffle.class
org.apache.hadoop.mapred.ShuffleHandler
yarn.resourcemanager.address
bigdata-test01.mykine.cn:18040
yarn.resourcemanager.scheduler.address
bigdata-test01.mykine.cn:18030
yarn.resourcemanager.resource-tracker.address
bigdata-test01.mykine.cn:18025
yarn.resourcemanager.admin.address
bigdata-test01.mykine.cn:18141
yarn.resourcemanager.webapp.address
bigdata-test01.mykine.cn:18088
yarn.log-aggregation-enable
true
yarn.log-aggregation.retain-seconds
86400
yarn.log-aggregation.retain-check-interval-seconds
86400
yarn.nodemanager.remote-app-log-dir
/tmp/logs
yarn.nodemanager.remote-app-log-dir-suffix
logs
cp mapred-site.xml.template mapred-site.xml
mapreduce.framework.name
yarn
mapreduce.jobtracker.http.address
bigdata-test01.mykine.cn:50030
mapreduce.jobhisotry.address
bigdata-test01.mykine.cn:10020
mapreduce.jobhistory.webapp.address
bigdata-test01.mykine.cn:19888
mapreduce.jobhistory.done-dir
/jobhistory/done
mapreduce.intermediate-done-dir
/jobhisotry/done_intermediate
mapreduce.job.ubertask.enable
true
配置datanode的nodemanager在bigdata-test01.mykine.cn这台机器运行
bigdata-test01.mykine.cn
配置jdk目录
export JAVA_HOME=/usr/local/java/jdk1.8
hdfs namenode -format
当显示类似INFO common.Storage: Storage directory /usr/local/hadoop-2.7.2/current/dfs/name has been successfully formatted ,表示格式化成功
/usr/local/hadoop-2.7.2/sbin/start-all.sh
期间会提示是否启动Secondary NameNode服务,输入yes回车即可
(Secondary NameNode详解参考)