openGauss你得装(七十四)

32 阅读1分钟

#openGauss #入门 #安装 #数据库 #开源

手工建立互信

如果openGauss各主机的root密码不一致,gs_preinstall脚本无法建立互信,可以手工建立互信。

说明:

建立互信的过程中需要生成如下4个文件:authorized_keys、id_rsa、id_rsa.pub、known_hosts。请勿删除或破坏这些互信相关的文件。

手工建立信任关系,步骤如下,plat1、plat2、plat3是主机名:

1.在其中一个主机上,生成root用户的本机授权文件。假设在主机plat1上执行。

a. 生成密钥。

ssh-keygen -t rsa

示例如下:

plat1:~ # ssh-keygen -t rsa 
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
d5:35:46:33:27:22:09:f0:1e:12:a7:87:fa:33:3f:ab root@plat1
The key's randomart image is:
+--[ RSA 2048]----+
|      o.o.....O .|
|       *  .o + * |
|      + + . .    |
|     . + o       |
|    .   S        |
|     .           |
|      +          |
|       +.        |
|      E.oo       |
+-----------------+

b. 生成本机授权文件。

cat .ssh/id_rsa.pub >> ~/.ssh/authorized_keys

示例如下:

plat1:~ # cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

#openGauss #入门 #安装 #数据库 #开源