欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

connect to host slavenode1 port 22: No route to host

程序员文章站 2024-03-14 10:48:52
...

报错信息:

[root@masternode1 ~]# ssh-copy-id -i /root/.ssh/id_dsa.pub slavenode1
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_dsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: ERROR: ssh: connect to host slavenode1 port 22: No route to host

分析解决:

  1. 检查网络状态,尝试ping百度和自己
 ping www.baidu.com
 ping+自己ip

如果网络可以ping通没有问题,再进行下一步:

  1. 关闭防火墙
systemctl stop firewalld.service #关闭防火墙
systemctl disable firewalld.service #禁止开机自启
  1. 重启网卡
service network restart
  1. 启动sshd服务
/usr/sbin/sshd 
  1. 仔细检查 /etc/hosts文件
vim /etc/hosts

至此,检查完这些,问题应该得以解决了,很高心能帮到你