三主机配置互信
--配置三個(gè)機(jī)器的SSH互信
1.首先確保三個(gè)機(jī)器能相互ping通
2.三臺(tái)機(jī)器分別執(zhí)行Keygen命令
//rsa可用dsa替換
//最好不要對(duì)root用戶配置互信
ssh-keygen -t rsa
3.在主節(jié)點(diǎn)執(zhí)行
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
//將主機(jī)slave1.hadoop和slave2.hadoop的公鑰取到本地authorized_keys文件中
ssh slave1.hadoop cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh slave2.hadoop cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
//分發(fā)公鑰
scp ~/.ssh/authorized_keys slave1.hadoop:~/.ssh/
scp ~/.ssh/authorized_keys slave2.hadoop:~/.ssh/
4.三臺(tái)機(jī)器分別執(zhí)行 更改權(quán)限
chmod 644 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
5.驗(yàn)證
ssh master.hadoop date
ssh slave1.hadoop date
ssh slave2.hadoop date
不需要輸入密碼,即可取得相應(yīng)主機(jī)的時(shí)間,就完成了配置
1.首先確保三個(gè)機(jī)器能相互ping通
2.三臺(tái)機(jī)器分別執(zhí)行Keygen命令
//rsa可用dsa替換
//最好不要對(duì)root用戶配置互信
ssh-keygen -t rsa
3.在主節(jié)點(diǎn)執(zhí)行
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
//將主機(jī)slave1.hadoop和slave2.hadoop的公鑰取到本地authorized_keys文件中
ssh slave1.hadoop cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh slave2.hadoop cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
//分發(fā)公鑰
scp ~/.ssh/authorized_keys slave1.hadoop:~/.ssh/
scp ~/.ssh/authorized_keys slave2.hadoop:~/.ssh/
4.三臺(tái)機(jī)器分別執(zhí)行 更改權(quán)限
chmod 644 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
5.驗(yàn)證
ssh master.hadoop date
ssh slave1.hadoop date
ssh slave2.hadoop date
不需要輸入密碼,即可取得相應(yīng)主機(jī)的時(shí)間,就完成了配置
來(lái)自 “ ITPUB博客 ” ,鏈接:http://blog.itpub.net/26129555/viewspace-2139865/,如需轉(zhuǎn)載,請(qǐng)注明出處,否則將追究法律責(zé)任。
轉(zhuǎn)載于:http://blog.itpub.net/26129555/viewspace-2139865/
總結(jié)
- 上一篇: mysql财务数据分析_财务数据分析3大
- 下一篇: js密室逃脱微信小游戏源码