准备完全分布式主机的ssh

本文将指导如何准备和配置SSH以实现完全分布式主机之间的安全通信。内容涵盖设置密钥对、信任主机、配置SSH配置文件等关键步骤,确保在多主机环境中无缝远程访问。
摘要由CSDN通过智能技术生成
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]
	<?xml version="1.0" encoding="UTF-8"?>
	<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
	<configuration>
			<property>
					<name>fs.defaultFS</name>
					<value>hdfs://s201/</value>
			</property>
	</configuration>

	[hdfs-site.xml]
	<?xml version="1.0" encoding="UTF-8"?>
	<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
	<configuration>
			<property>
					<name>dfs.replication</name>
					<value>3</value>
			</property>
	</configuration>
	
	[mapred-site.xml]
		不变
	
	[yarn-site.xml]
	<?xml version="1.0"?>
	<configuration>
			<property>
					<name>yarn.resourcemanager.hostname</name>
					<value>s201</value>
			</property>
			<property>
					<name>yarn.nodemanager.aux-services</name>
					<value>mapreduce_shuffle</value>
			</property>
	</configuration>

	[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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值