Home > Blockchain >  Still connect 22 ssh port when using gpinitsystem command of Greenplum withing different ssh port of
Still connect 22 ssh port when using gpinitsystem command of Greenplum withing different ssh port of

Time:03-07

I want to install Greenplum in CentOS7.9 which is changed default ssh port to 10022. I changed 'gpssh-exkeys' script to add '-p 10022' for all of ssh command and add '-P 10022' for all of scp command. And run it is ok. Then I changed '/usr/local/greenplum-db/lib/python/gppylib/commands/base.py' script to add '-p 10022' in a ssh command line.

        # Escape " for remote execution otherwise it interferes with ssh
        cmd.cmdStr = cmd.cmdStr.replace('"', '\\"')
        cmd.cmdStr = "ssh -p 10022 -o StrictHostKeyChecking=no -o ServerAliveInterval=60 " \
                     "{targethost} \"{gphome} {cmdstr}\"".format(targethost=self.targetHost,
                                                                 gphome=". %s/greenplum_path.sh;" % self.gphome,
                                                                 cmdstr=cmd.cmdStr)

But I got the error that present still try to connent port 22 when run 'gpinitsystem'.

[gpadmin@mdw ~]$ gpinitsystem -c /home/gpadmin/gpinitsystem_config --locale=zh_CN -h /home/gpadmin/seg_hosts
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file /home/gpadmin/gpinitsystem_config
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20220303:21:55:40:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
.ssh: connect to host sdw1 port 22: Connection refused
.ssh: connect to host sdw2 port 22: Connection refused

20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for multi-home array
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 630: ((: REMAINDER=2 % 0: division by 0 (error token is "0")
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 631: ((: MULTIPLE=2 / 0: division by 0 (error token is "0")
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 632: [: -ne: unary operator expected
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 632: [: -eq: unary operator expected
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 640: [: -gt: unary operator expected
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...

20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...

20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
ssh: connect to host sdw1 port 22: Connection refused
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 704: [: -eq: unary operator expected
ssh: connect to host mdw port 22: Connection refused
/usr/local/greenplum-db-6.19.3/bin/gpinitsystem: line 732: [: -lt: unary operator expected
ssh: connect to host mdw port 22: Connection refused
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-[WARN]:-Postgres version does not match. [postgres (Greenplum Database) 6.19.3 build commit:33e10eef63ae25aeb33afbefdda46b6367353800 Open Source != ]
20220303:21:55:41:005293 gpinitsystem:mdw:gpadmin-Postgres version does not match Script Exiting!

And I didn't find official documents, https://docs.greenplum.org/, for guiding how to install withing the different ssh port.

Thank you!

CodePudding user response:

Do not modify delivered utilities. Recommend leveraging ~gpadmin/.ssh/config specifying Port for your hosts. All Greenplum utilities should honor settings in that file.

Example ~gpadmin/.ssh/config where all hosts are known as sdw1-pri, sdw2-pri and so on:

Host sdw*-pri
    Port 10022

CodePudding user response:

Can you specify the 10022 port in /etc/sshd_config and try again.

  • Related