【GP5安装配置】 Greenplum5.23 安装手记

本文记录了Greenplum 5.23的完整安装过程,包括安装前的系统参数修改、防火墙关闭、主机配置、安装Master和Segment节点、集群初始化、安装后的配置等内容。详细阐述了每个步骤的关键操作和注意事项,适用于初学者和有经验的管理员。
摘要由CSDN通过智能技术生成

作者:lianghc

时间:20191221

目录

作者:lianghc

时间:20191221

1.安装前准备

2. 安装步骤概述

2.1 常规安装

2.1 非常规安装法(先安装,再改参数)

3. 系统参数修改清单

3.1 /etc/host

3.2 /etc/sysctl.conf

3.2.1 /etc/sysctl.conf 原文件内容

3.3  /etc/security/limits.conf

3.4  /etc/security/limits.d/90-nproc.conf

3.5 iptables 关闭防火墙

3.6 blockdev 

3.7 scheduler

3.8 检查字符集

3.9 更改文件系统xfs

4.安装Greenplum

4.1  安装master

4.1.1 准备安装文件,安装目录

4.1.2 执行安装命令

4.1.3 准备gp集群host文件

4.1.4 集群互信,免密登陆

4.2 复制配置文件到其他节点

4.3 安装 gp节点 (gpseginstall)(gp6 无此工具)

4.3.1 安装 segment, 并创建 gpadmin用户

4.3.2 安装 segment, 不创建 gpadmin用户

​4.4 安装前集群参数校验

4.4.1 集群系统参数校验

4.4.2 集群时钟校验

4.4.3 集群网络性能测试

4.4.4 集群磁盘io性能测试

4.5.  集群初始化

4.5.1 创建master 数据目录

4.5.2 创建segment(primary,mirror) 数据目录

4.5.3 拷贝安装配置文件,并配置

4.5.4 集群初始化

4.5.5  实例化失败处理

 4.5.6  实例化失败回退

4.5.7 安装完毕

4.5.8 修改gpadmin 用户.bash_profile

4.5.9 安装成功后的数据目录详解

5. 安装成功后配置

5.1 psql 登陆gp 并设置密码

5.1.1 登陆到不同节点

5.2 客户端登陆gp

5.2.2. 修改postgresql.conf 

5.2.3. 加载修改的文件


1.安装前准备

1. 下载安装介质
pivotal 商业版 :https://network.pivotal.io/products/pivotal-gpdb
开源版 :https://github.com/greenplum-db/gpdb/releases

2. 软硬件说明
1. 下载安装文件,本次选取5.23版本,5.X的最后的版本
2. 本次在三台虚拟机上安装,规划安装1个master,4个segment,无standby.
3. 机器配置:2*2C cpu, 内存16G,硬盘50G。

附录:
视频教程:https://www.ixigua.com/i6740122076977299982

2. 安装步骤概述

2.1 常规安装

1. 修改系统参数(共享内存,磁盘调度算法,网络参数,用户资源等)
2. 关闭防火墙
3. 配置host
4. 创建安装目录
5. 解压安卓,或rpm安装master , 配置 host_all ,host_seg 
6. gpssh-exkeys 打通各个节点
7. gpseginstall 分发安装介质到各个节点
8.  gpcheck 检查参数,不合理再修改

2.1 非常规安装法(先安装,再改参数)

1. 关闭防火墙
2 配置host
3. 创建安装目录
4. 解压安卓,或rpm安装master , 配置 host_all ,host_seg 
5. gpssh-exkeys 打通各个节点
6. gpseginstall 分发安装介质到各个节点
8.  gpcheck 检查参数,不合理再修改
8. 修改系统参数(共享内存,磁盘调度算法,网络参数,用户资源等)(先不改参数,最后根据安装校验结果再改)

3. 系统参数修改清单

 相关参数具体数值,需要参考官方文档
《Greenplum5.0 最佳实践》 系统参数 :https://yq.aliyun.com/articles/225816?spm=a2c4e.11155435.0.0.a9756e1eIiHSoH

3.1 /etc/host

[root@mdw ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
172.28.25.204 mdw
172.28.25.205 sdw1
172.28.25.206 sdw2

3.2 /etc/sysctl.conf

 /etc/sysctl.conf 内核参数 可参考 /opt/greenplum-db/./etc/gpcheck.cnf
官方链接:https://gpdb.docs.pivotal.io/5230/install_guide/prep_os_install_gpdb.html#topic3

[root@mdw ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.

# Controls IP packet forwarding
# net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
# net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
# kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
# kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the default maxmimum size of a mesage queue
# kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
# kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
# kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
# kernel.shmall = 4294967296

net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.all.accept_redirects=0

kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 500 1024000 200 4096
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.ip_local_port_range = 10000 65535
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2

     将原参数文件清空,重写上述内容,不同的系统参数会有出入,正确的做法是,按照官方推荐参数 一一比对做修改,然后再通过gpscp 命令将 参数文件同步到各个子节点机器上。

[root@mdw greenplum523]# echo > /etc/sysctl.conf
[root@mdw greenplum523]# cat /etc/sysctl.conf
[root@mdw greenplum523]# vi  /etc/sysctl.conf

3.2.1 /etc/sysctl.conf 原文件内容


[root@sdw1 ~]# cat /etc/sysctl.conf
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.
#
# Use '/sbin/sysctl -a' to list all possible parameters.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.all.accept_redirects=0

3.3  /etc/security/limits.conf

[root@mdw ~]# cat /etc/security/limits.conf
# 前文省略 ... 追加以下内容
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

3.4  /etc/security/limits.d/90-nproc.conf

[root@mdw ~]# cat /etc/security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     131072
root       soft    nproc     unlimited

3.5 iptables 关闭防火墙

[root@mdw ~]# service iptables status
iptables: Firewall is not running.

3.6 blockdev 

[root@mdw ~]# lsblk
NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1 1024M  0 rom
sda                           8:0    0   50G  0 disk
├─sda1                        8:1    0  200M  0 part /boot
└─sda2                        8:2    0 49.8G  0 part
  ├─VolGroup-lv_swap (dm-0) 253:0    0    4G  0 lvm  [SWAP]
  └─VolGroup-lv_root (dm-1) 253:1    0 45.8G  0 lvm  /
[root@mdw ~]# /sbin/blockdev --setra 16384 /dev/sda
[root@mdw ~]# /sbin/blockdev --getra /dev/sda
16384

例如:

[root@mdw ~]# /sbin/blockdev --setra 16384 /dev/sr0
[root@mdw ~]# /sbin/blockdev --setra 16384 /dev/sda
[root@mdw ~]# /sbin/blockdev --getra /dev/sda
16384

3.7 scheduler

[root@mdw ~]# more  /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
[root@mdw ~]# echo deadline > /sys/block/sda/queue/scheduler
[root@mdw ~]# echo deadline > /sys/block/sr0/queue/scheduler

3.8 检查字符集

echo $LANG

3.9 更改文件系统xfs

# 查看文件系统
du -T 
# 修改xfs 

本次安装未做修改,影响未知
xfs和ext 对比:https://github.com/digoal/blog/blob/master/201610/20161002_02.md

4.安装Greenplum

安装分为三步
1. 安装master
2. 安装 节点
3. 初始化集群(创建segment,mirror ,schema 等)

4.1  安装master

4.1.1 准备安装文件,安装目录

# 解压
mv greenplum-db-5.23.0-rhel6-x86_64.zip /opt/
cd /opt/
unzip greenplum-db-5.23.0-rhel6-x86_64.zip
mkdir greenplum523

4.1.2 执行安装命令

./greenplum-db-5.23.0-rhel6-x86_64.bin

# 查看安装目录,设置环境变量
cd greenplum523/
source greenplum_path.sh

4.1.3 准备gp集群host文件

vi host_all
mdw
sdw1
sdw2
vi host_seg
sdw1
sdw2

4.1.4 集群互信,免密登陆

[root@mdw greenplum523]# gpssh-exkeys -f host_all
[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] authorize current user on 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
[root@mdw greenplum523]#

4.2 复制配置文件到其他节点

可以先进行步骤 4.4 再进行步骤4.2 
方法一:
使用s

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

百事悠弦

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

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

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

打赏作者

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

抵扣说明:

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

余额充值