GBase 8a集群在用户修改了sshd默认端口时如何安装
Linux 下ssh默认服务端口是22, 如果用户修改了该端口,比如2222,则会导致ssh无法连接22端口而报错。本文介绍在这种情况下,GBase 8a集群安装的方法。
sshd配置了2222端口
[root@gbase_rh7_003 ~]# grep Port /etc/ssh/sshd_config
Port 2222
#GatewayPorts no
[root@gbase_rh7_003 ~]#
默认ssh连接该服务器报错
[root@gbase_rh7_004 ~]# ssh 10.0.2.103
ssh: connect to host 10.0.2.103 port 22: Connection refused
必须指定-p 参数
[root@gbase_rh7_004 ~]# ssh 10.0.2.103 -p 2222
root@10.0.2.103's password:
修改用户级ssh配置实现指定端口
用户级ssh配置文件为 ~/.ssh/config, 其权限可以设置为600。
[root@gbase_rh7_003 ~]# cat /home/gbase/.ssh/config
Host 10.0.2.10?
port 2222
该配置的详细用户可以自行搜索,已知的
- 可以指定多个IP,每个部分用Host作为开头
- IP可以用通配符,比如?或者*
- IP可以用CIDR,比如192.168.1.0/24
- IP【不支持】范围,比如100-106,有些郁闷
- host的IP可以一次指定多个,中间用空格分隔。如果你的版本不支持,又无法用通配符,那就每个IP写一段。
多个host的测试结果
[gbase@gbase_rh7_003 gcinstall]$ cat ~/.ssh/config
Host 10.0.2.103 10.0.2.104
port 2222
[gbase@gbase_rh7_003 gcinstall]$
[gbase@gbase_rh7_003 ~]$
[gbase@gbase_rh7_003 ~]$ ssh 10.0.2.103
gbase@10.0.2.103's password:
[gbase@gbase_rh7_003 ~]$ ssh 10.0.2.104
gbase@10.0.2.104's password:
安装
配置文件demo.options其他参数正常配置即可,sshPort参数改为2222
由于gcware服务用ssh探测机器是否在线,所以通过sshPort参数指定。该参数将写入到gcware.conf里。
[gbase@gbase_rh7_003 gcinstall]$ cat demo.options | grep sshPort
sshPort = 2222
[gbase@gbase_rh7_003 gcinstall]$
安装成功
10.0.2.104 install gcware and cluster on host 10.0.2.104 successfully.
10.0.2.103 install gcware and cluster on host 10.0.2.103 successfully.
Starting all gcluster nodes ...
adding new datanodes to gcware ...
InstallCluster Successfully
评论
热门帖子
- 12025-12-01浏览数:100754
- 22023-05-09浏览数:23328
- 42023-09-25浏览数:16295
- 52020-05-11浏览数:15638