ssh:连接到主机从端口22:连接超时

rnmwe5a2  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(826)

edited:-
我在两台不同的机器上完成了单节点集群,我将一台作为主机(192.168.1.1),另一台m/c作为从机(192.168.1.2),我成功地能够在两台机器之间ping,我做了以下更改以进入2节点集群更新:-
/两台计算机上的etc/hosts hosts.allow

All :  Ashish-PC 192.168.1.1 : allow
All  : slave 192.168.1.2 : allow

主文件

Ashish-PC

从属文件

Ashish-PC 
  slave

将本地主机公钥复制到远程主机(从机):端口22时出错

ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@slave
 /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 slave port 22: Connection timed out

以及当我在主服务启动所有dfs时,然后:-

bin/start-dfs.sh
starting namenode, logging to /usr/local/hadoop/libexec/../logs/hadoop-Ashish-namenode-  Ashish-PC.out
slave: ssh: connect to host slave port 22: Connection timed out
Ashish-PC: starting secondarynamenode, logging to       /usr/local/hadoop/libexec/../logs/hadoop-Ashish-secondarynamenode-Ashish-PC.out
slave: ssh: connect to host slave port 22: Connection timed out

复制时key:-

ssh-copy-id -i ~/.ssh/id_rsa.pub hadoop@slave
/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 slave port 22: Connection timed out

我用过cygwin,ssh在这两台电脑上都运行得很好,我也考虑过一些修改端口号22的建议(因为isp的问题),但我不想仅仅因为这个就这么做。提前感谢您的帮助和回复。

vd2z7a6w

vd2z7a6w1#

允许主通信通过windows防火墙添加sshd在家里以及公共。。。

确保在每个节点上启动sshd服务以进行通信。

piv4azn7

piv4azn72#

这对我有用:
1

sudo vi /etc/ssh/sshd_config

2删除注解


# Port 22

# Protocol 2

相关问题