在CentOS上安装GreenPlum

Refer: https://docs.vmware.com/en/VMware-Tanzu-Greenplum/6/greenplum-database/GUID-install_guide-prep_os.html

主机规划

IP地址 主机名 节点类型 Server
10.0.0.100 gpdb-master master CentOS 8
10.0.0.101 gpdb-segment-01 segment CentOS 8
10.0.0.102 gpdb-segment-02 segment CentOS 8
10.0.0.103 gpdb-segment-03 segment CentOS 8

配置操作系统参数

Disable SELinux

查看SELinux状态:

1
sestatus

输出:

1
2
3
4
5
6
7
8
9
10
11
09:05:47 root@gpdb-master ~ → sestatus 
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33

关闭SELinux

修改配置文件:/etc/selinux/config

1
SELINUX=disabled

修改完成后重启服务器。

关闭iptables/firewalld

CentOS8是firewalld,检查firewalld状态:

1
systemctl status firewalld

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
09:15:27 root@gpdb-master ~ → systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-12-18 04:55:03 CST; 7h left
Docs: man:firewalld(1)
Main PID: 986 (firewalld)
Tasks: 2 (limit: 49426)
Memory: 38.2M
CGroup: /system.slice/firewalld.service
└─986 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

Dec 18 04:55:01 gpdb-master systemd[1]: Starting firewalld - dynamic firewall daemon...
Dec 18 04:55:03 gpdb-master systemd[1]: Started firewalld - dynamic firewall daemon.
Dec 18 04:55:03 gpdb-master firewalld[986]: WARNING: AllowZoneDrifting is enabled. This is considere

关闭Firewalld:

1
2
systemctl stop firewalld.service
systemctl disable firewalld

优化系统参数(/etc/sysctl.conf)

查看当前状态:

1
sysctl -a

调整之后/etc/sysctl.con如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
## Shared Memory: 用于操作系统不同进程之间的内存共享。可通过`ipcs -lm`查看
##
## kernel.shmall = _PHYS_PAGES / 2 # See Shared Memory Pages
## Segment的配置,通过这个命令获取:echo $(expr $(getconf _PHYS_PAGES) / 2)
kernel.shmall = 993697
# kernel.shmmax = kernel.shmall * PAGE_SIZE
## Segment的配置,通过这个命令获取:echo $(expr $(getconf _PHYS_PAGES) / 2 \* $(getconf PAGE_SIZE))
kernel.shmmax = 4070182912
## 操作系统内,共享内存片段(Shared Memory Segment)的数量。
kernel.shmmni = 4096
#kernel.shmall = 18446744073692774399
#kernel.shmmax = 18446744073692774399
#kernel.shmmni = 4096

## Virtal Memory的一些参数
# 2:允许应用程序分配不多于swap剩余可用空间 并且 不高于overcommit_ratio*物理内存
vm.overcommit_memory = 2 # See Segment Host Memory
#vm.overcommit_memory = 0
vm.overcommit_ratio = 80 # See Segment Host Memory
#vm.overcommit_ratio = 50

## 允许本地使用的端口号
net.ipv4.ip_local_port_range = 10000 65535 # See Port Settings
#net.ipv4.ip_local_port_range = 32768 60999

## SEMMSL, SEMMNS, SEMOPM, and SEMMNI
## SEMMSL:每个信号量集中最多的信号量数量
## SEMMNS:系统中所有信号量的数量上限
## SEMOPM:每个系统调用可以操作的信号量数量
## SEMMNI:信号量集的数量上限
kernel.sem = 250 2048000 200 8192
#kernel.sem = 32000 1024000000 500 32000

## 1: 启用所有的sysrq
kernel.sysrq = 1
#kernel.sysrq=16
kernel.core_uses_pid = 1

## 单个消息队列的总大小上限
kernel.msgmnb = 65536
## 消息队列中单个消息大小的上限
kernel.msgmax = 65536
## 消息队列中消息的个数上限
kernel.msgmni = 2048

# TODO: tcp的这几个优化还没有明确
net.ipv4.tcp_syncookies = 1
net.ipv4.conf.default.accept_source_route = 0
#net.ipv4.conf.default.accept_source_route = 1
net.ipv4.tcp_max_syn_backlog = 4096
#net.ipv4.tcp_max_syn_backlog = 256
net.ipv4.conf.all.arp_filter = 1
#net.ipv4.conf.all.arp_filter = 1

# UDP优化
net.ipv4.ipfrag_high_thresh = 41943040
net.ipv4.ipfrag_low_thresh = 31457280
net.ipv4.ipfrag_time = 60
#net.ipv4.ipfrag_time = 30
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152

vm.swappiness = 10
vm.zone_reclaim_mode = 0
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100

# 以下四个是针对内存64GB以上的服务器
#vm.dirty_background_ratio = 0 # See System Memory
#vm.dirty_ratio = 0
#vm.dirty_background_bytes = 1610612736
#vm.dirty_bytes = 4294967296

# 针对内存64GB及以下的服务器,用以下两个替代:
vm.dirty_background_ratio = 3
#vm.dirty_background_ratio = 10
vm.dirty_ratio = 10
#vm.dirty_ratio = 30

安装软件包

下载

1
wget https://github.com/greenplum-db/gpdb/releases/download/6.22.2/open-source-greenplum-db-6.22.2-rhel8-x86_64.rpm

安装

安装依赖

// TODO: To be continued..



转载请注明出处:在CentOS上安装GreenPlum
原文地址:https://www.xiaotanzhu.com/linux/2022-12-17-gpdb-6-install-on-centos.html