【GP6安装配置】 Greenplum6.2.1 安装手记(下)

本文详细记录了Greenplum6.2.1的安装配置过程,包括集群软件安装、集群互信、初始化、性能测试等步骤。作者通过生成密钥、设置免密登录、批量配置系统参数、模拟gpseginstall脚本等方式,逐步完成集群搭建,并提供了网络和磁盘性能测试的标准。文章还包括了集群初始化的参数配置、错误处理及环境变量设置等关键环节。
摘要由CSDN通过智能技术生成

作者:lianghc
本文分为两部分

参数配置:【GP6安装配置】 Greenplum6.2.1 安装手记(上) 

执行安装:【GP6安装配置】 Greenplum6.2.1 安装手记(下)

目录

3. 集群软件安装

3.1 执行安装程序

3.2 创建hostfile_exkeys

3.3 集群互信,免密登陆

3.3.1  生成密钥

3.3.2 将本机的公钥复制到各个节点机器的authorized_keys文件中

3.3.3 使用gpssh-exkeys 工具,打通n-n的免密登陆

3.3.4 验证gpssh

3.4 同步master 配置到各个主机(非官方教程步骤)

3.4.1 批量添加gpadmin用户

3.4.2 打通gpadmin 用户免密登录

3.4.3 批量设置greenplum在gpadmin用户的环境变量

3.4.4  批量复制系统参数到其他节点

3.5 集群节点安装

3.5.1 模拟gpseginstall 脚本

3.5.2 创建集群数据目录

3.6 集群性能测试

3.6.1 网络性能测试

3.6.2 磁盘I/O 性能测试

3.6.3 集群时钟校验(非官方步骤)

4.  集群初始化

4.1  编写初始化配置文件

4.1.1 拷贝配置文件模板

4.1.2 根据需要修改参数

4.2 集群初始化

4.2.1 集群初始化命令参数

4.2.2 执行报错处理

4.3 初始化完成后续操作

4.3.2 设置环境变量

4.3.3 若删除重装,使用gpdeletesystem

4.3.4 配置pg_hba.conf

5 安装成功后配置

5.1 psql 登陆gp 并设置密码

5.1.1 登陆到不同节点

5.2 客户端登陆gp

5.2.1. 配置 pg_hba.conf

5.2.2. 修改postgresql.conf 

5.2.3. 加载修改的文件


3. 集群软件安装

参考:https://gpdb.docs.pivotal.io/6-2/install_guide/install_gpdb.html
# 与旧版本差异点

gp4.x/gp5.x 以前安装分为三部分
   1. 安装master(一般是个bin的可执行文件,安装,并可以指定安装目录)
   2. gpseginstall 安装各个seg
   3. gp群参数校验  
   4. gpinitsystem 集群初始化
   
gp6.2 开始不提供zip 格式压缩包,仅提供rpm包,安装分为两步
   1. 安装master(rpm -ivh / yum install -y),不可以指定安装目录,默认安装到/usr/local/
  2. gp6 没有 gpseginstall工具。所以要么自己打包master 安装好的gp目录并传到seg上,要么各个节点单独yum 安装。
     1.每个节点主机,单独yum
     2.打包主节点的安装目录,并分发给seg主机。
  3. 集群性能校验
  4. gpinitsystem 集群初始化 

3.1 执行安装程序

       执行安装脚本,默认安装到/usr/local/ 目录下。

 yum install -y ./greenplum-db-6.2.1-rhel6-x86_64.rpm

或者使用rpm 安装

rpm -ivh greenplum-db-6.2.1-rhel6-x86_64.rpm

       本次测试是内网机,无法联网下载所有的依赖包,也没有提前外网下载好依赖包。而是等安装时缺什么,再下载什么。现在缺少 libyaml,下载并上传至服务器,安装后再试运行gp安装程序。libyaml下载地址 http://rpmfind.net/linux/rpm2html/search.php?query=libyaml(x86-64)


[root@mdw gp_install_package]#  yum install -y ./greenplum-db-6.2.1-rhel6-x86_64.rpm
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Examining ./greenplum-db-6.2.1-rhel6-x86_64.rpm: greenplum-db-6.2.1-1.el6.x86_64
Marking ./greenplum-db-6.2.1-rhel6-x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package greenplum-db.x86_64 0:6.2.1-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================
 Package                         Arch                      Version                           Repository                                           Size
=======================================================================================================================================================
Installing:
 greenplum-db                    x86_64                    6.2.1-1.el6                       /greenplum-db-6.2.1-rhel6-x86_64                    493 M

Transaction Summary
=======================================================================================================================================================
Install       1 Package(s)

Total size: 493 M
Installed size: 493 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : greenplum-db-6.2.1-1.el6.x86_64                                                                                                     1/1
  Verifying  : greenplum-db-6.2.1-1.el6.x86_64                                                                                                     1/1

Installed:
  greenplum-db.x86_64 0:6.2.1-1.el6

Complete!


3.2 创建hostfile_exkeys

在$GPHOME目录创建两个host文件(all_host,seg_host),用于后续使用gpssh,gpscp 等脚本host参数文件
all_host : 内容是集群所有主机名或ip,包含master,segment,standby等。
seg_host: 内容是所有 segment主机名或ip
若一台机器有多网卡,且网卡没有绑定成bond0模式时,需要将多网卡的ip 或者host都列出来。

[root@mdw ~]# cd /usr/local/
[root@mdw local]# ls
bin  etc  games  greenplum-db  greenplum-db-6.2.1  include  lib  lib64  libexec  openssh-6.5p1  sbin  share  src  ssl
[root@mdw local]# cd greenplum-db
[root@mdw greenplum-db]# ls
bin  docs  etc  ext  greenplum_path.sh  include  lib  open_source_license_pivotal_greenplum.txt  pxf  sbin  share
[root@mdw greenplum-db]# vi all_host
[root@mdw greenplum-db]# vi seg_host
[root@mdw greenplum-db]# cat all_host
mdw
sdw1
sdw2
[root@mdw greenplum-db]# cat seg_host
sdw1
sdw2

修改文件夹权限

[root@mdw greenplum-db]# chown -R gpadmin:gpadmin /usr/local/greenplum*

3.3 集群互信,免密登陆

## 与旧版本差异点
   gp6.x 以前无需3.3.1 ssh-keygen生成密钥,3.3.2 的ssh-copy-id 步骤,直接gpssh-exkeys -f all_host。


3.3.1  生成密钥

我的Linux还没有公私钥对,所以,要先生成一个

[root@mdw greenplum-db]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
88:c0:be:87:6a:c2:40:ed:fd:ab:34:f0:35:60:47:0f root@mdw
The key's randomart image is:
+--[ RSA 2048]----+
|       E         |
| .    . o        |
|  +  o . .       |
| o o..o.         |
|. o.o .oS        |
|.  +o.. .        |
|o o .+.          |
|.+ .. ..         |
|+    ....        |
+-----------------+

3.3.2 将本机的公钥复制到各个节点机器的authorized_keys文件中

[root@mdw greenplum-db]# ssh-copy-id sdw1

[root@mdw greenplum-db]# ssh-copy-id sdw2


3.3.3 使用gpssh-exkeys 工具,打通n-n的免密登陆

[root@mdw greenplum-db]# gpssh-exkeys -f all_host
Problem getting hostname for gpzq-sh-mb: [Errno -3] Temporary failure in name resolution
Traceback (most recent call last):
  File "/usr/local/greenplum-db/./bin/gpssh-exkeys", line 409, in <module>
    (primary, aliases, ipaddrs) = socket.gethostbyaddr(hostname)
socket.gaierror: [Errno -3] Temporary failure in name resolution
# 没有做章节( 2.2.1 配置每台机器host )的内容,导致上述错误
[root@gjzq-sh-mb greenplum-db]# hostname mdw
[root@gjzq-sh-mb greenplum-db]# gpssh-exkeys -f all_host
[STEP 1 of 5] create local ID and authorize on local host
  ... /root/.ssh/id_rsa file exists ... key generation skipped

[STEP 2 of 5] keyscan all hosts and update known_hosts file

[STEP 3 of 5] retrieving credentials from remote hosts
  ... send to sdw1
  ... send to sdw2

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with sdw1
  ... finished key exchange with sdw2

[INFO] completed successfully

3.3.4 验证gpssh

[root@mdw ~]# source /usr/local/greenplum-db/greenplum_path.sh
[root@mdw ~]# g
  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

百事悠弦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值