准备完全分布式主机的ssh

1.删除所有主机上的/home/centos/.ssh/*

2.在s201主机上生成密钥对
	$>ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa

3.将s201的公钥文件id_rsa.pub远程复制到202 ~ 204主机上。
  并放置/home/centos/.ssh/authorized_keys
	$>scp id_rsa.pub root@s112:/~/.ssh/authorized_keys
	$>scp id_rsa.pub centos@s202:/home/centos/.ssh/authorized_keys
	$>scp id_rsa.pub centos@s203:/home/centos/.ssh/authorized_keys
	$>scp id_rsa.pub centos@s204:/home/centos/.ssh/authorized_keys

4.配置完全分布式(${hadoop_home}/etc/hadoop/)
	[core-site.xml]
	
	
	
			
					fs.defaultFS
					hdfs://s201/
			
	

	[hdfs-site.xml]
	
	
	
			
					dfs.replication
					3
			
	
	
	[mapred-site.xml]
		不变
	
	[yarn-site.xml]
	
	
			
					yarn.resourcemanager.hostname
					s201
			
			
					yarn.nodemanager.aux-services
					mapreduce_shuffle
			
	

	[slaves]
	s202
	s203
	s204

	[hadoop-env.sh]
	...
	export JAVA_HOME=/soft/jdk
	...

5.分发配置
	$>cd /soft/hadoop/etc/
	$>scp -r full root@s112:/soft/hadoop/etc/
	$>scp -r full centos@s203:/soft/hadoop/etc/
	$>scp -r full centos@s204:/soft/hadoop/etc/

6.删除符号连接
	$>cd /soft/hadoop/etc
	$>rm hadoop
	$>ssh s112 rm /soft/hadoop/etc/hadoop
	$>ssh s203 rm /soft/hadoop/etc/hadoop
	$>ssh s204 rm /soft/hadoop/etc/hadoop

7.创建符号连接
	$>cd /soft/hadoop/etc/
	$>ln -s full hadoop
	$>ssh s112 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop
	$>ssh s203 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop
	$>ssh s204 ln -s /soft/hadoop/etc/full /soft/hadoop/etc/hadoop

8.删除临时目录文件
	$>cd /tmp
	$>rm -rf hadoop-root
	$>ssh s112 rm -rf /tmp/hadoop-root
	$>ssh s203 rm -rf /tmp/hadoop-centos
	$>ssh s204 rm -rf /tmp/hadoop-centos

9.删除hadoop日志
	$>cd /soft/hadoop/logs
	$>rm -rf *
	$>ssh s112 rm -rf /soft/hadoop/logs/*
	$>ssh s203 rm -rf /soft/hadoop/logs/*
	$>ssh s204 rm -rf /soft/hadoop/logs/*

10.格式化文件系统
	$>hadoop namenode -format

11.启动hadoop进程
	$>start-all.sh

你可能感兴趣的:(hadoop)