栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

集群免密配置

集群免密配置

逻辑

全部生成公钥和私钥
将第1台的公钥拷到该目录特定文件authorized_keys中,
将第1台的authorized_keys scp到第2台机器,
将第2台的公钥拷到该目录特定文件authorized_keys中
将第2台的authorized_keys scp到第3台机器
将第3台的公钥拷到该目录特定文件authorized_keys中
将第3台的authorized_keys scp到第1台机器

具体操作

所有集群机器
cd /root/
ssh-keygen -t rsa
#然后三个回车
[root@hadoop26 ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
此时authorized_keys只有hadoop26的公钥
[root@hadoop26 ~]# scp /root/.ssh/authorized_keys root@hadoop27:/root/.ssh/authorized_keys
[root@hadoop27 ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
此时authorized_keys有hadoop26,hadoop27的公钥
[root@hadoop27 ~]# cat /root/.ssh/authorized_keys
[root@hadoop27 ~]# scp /root/.ssh/authorized_keys root@hadoop28:/root/.ssh/authorized_keys

[root@hadoop28 ~]# cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
此时只有hadoop28的authorized_keys有hadoop26,hadoop27,hadoop28的公钥
[root@hadoop28 ~]# cat /root/.ssh/authorized_keys
[root@hadoop28 ~]# scp /root/.ssh/authorized_keys root@hadoop26:/root/.ssh/authorized_keys
此时hadoop26,hadoop28的authorized_keys有hadoop26,hadoop27,hadoop28的公钥
[root@hadoop28 ~]# scp /root/.ssh/authorized_keys root@hadoop27:/root/.ssh/authorized_keys
此时全部节点的authorized_keys有hadoop26,hadoop27,hadoop28的公钥

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/604616.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号