Hadoop之 叢集機器免密登入操作
1 先檢查叢集中的機器中ssh是否存在 :yum -yinstallssh
2 如果不存在就搜尋ssh : yum list | grep ssh ,搜尋到的ssh為 :openssh-clients.X86_64
3 一步就位 ,給叢集中的機器都安裝上ssh
1) View ==> Command Window(開啟命令視窗)
2) 在命令視窗中輸入 :yum -y install openssh-clients.X86.64
3) "右鍵"單擊命令視窗
4) Send Command to ==>All Sessions
5) enter(回車鍵)確定 ,即可給叢集中的機器都安裝上ssh
(新版本 VMware Workstation - 15.5.6)
4 如果不確定叢集中的機器是否設定過免密操作 ,可通過命令確定,比如以下案例 :
[[email protected] ~]# sshlinux02 --原本是linux01在控制 ,輸入命令ssh linux02之後
Last login: Wed Oct 7 22:57:48 2020 from linux03
[[email protected] ~]# --轉換到了linux02 ,這種切換操作成功說明已經進行過免密設定~]# exit --退出linux02操控 ,切換會linux01[[email protected] ~]#
5 叢集中的機器如果沒有設定過免密操作 ,可以根據一下步驟進行設定
5.1 建立密碼操作前準備 ,保證各個機器之間或者和外網(www.baidu.com)和 window都能保持網路連線,都可以ping通
比如如果在linux01機器上
[[email protected] ~]#ping linux01 ---ping自己
[[email protected] ~]#ping linux02 ---pinglinux02
~]#ping linux03 ---pinglinux03[[email protected] ~]#pingwww.baidu.com ---ping外網
[[email protected] ~]#pingwindows ---pingwindows
5.2 建立一對鑰匙 (私鑰 +金鑰) : ssh-keygen ;
將公鑰發給自己和叢集中的每一臺機器 :ssh-copy-id linux01 ;ssh-copy-id linux02 ;ssh-copy-id linux03