Greenplum集群安装配置及最佳实践
视频地址
视频地址:https://www.bilibili.com/video/av82277973/
总体原则
1.1 硬件平衡
-
性能
-
成本
-
容量
1.2 高可用
-
节点
-
网络
-
磁盘
1.3 部署方案
-
Master与Standby Master分级部署
-
Primary Segment与Mirror Segment 分机部署
-
Segment Mirroring 部署方案
-
Group Mirroring
-
Spread Mirroring
-
Group + Spread Mirroring
-
-
Pivotal Supported Greenplum 必须部署Mirroring Segment
-
Pivotal Supported Greenplum 必须部署Mirroring Segment
-
同一主机Segment个数
-
CPU/Core 数据
-
查询并发数
-
单机Primary Segment 总数不能过多
-
1.3.1 Group Mirroring 部署方案

按照以下4台机器Group Mirroring的部署方案总结
缺点: 一台机器down掉后,会把流量全部放在下一个节点,下一个节点的流量会变成2倍的流量
优点: down掉一台机器后,集群能正常的提供服务,如果再down掉第二台集群就不可用
1.3.2 Spread Mirroring 部署方案
按照以下4台机器Spread Mirroring的部署方案总结
缺点: 一台机器down掉后,会把流量全部放在下两个节点
优点: down掉一台机器后,集群能正常的提供服务,如果再down掉第二台集群就不可用

1.3.3 Group + Spread Mirroring 部署方案
如果集群比较大建议使用Group + Spread Mirroring部署方案,如果集群由down流量会分流道其他的机器上,集群不可用的几率比较小。
2 硬件选型
2.1 Master 节点
-
网卡
-
2块万兆网卡内部互联
-
1-2块千兆网卡带外管理及接入客户网络
-
-
内存
-
DDR4 64GB以上,建议256G
-
-
磁盘
-
6块600G/900G 10k RPM SAS盘
-
采用RAID5或RAID10
-
单独预留hotspare 盘
-
1块RAID卡,cache 1GB以上,带有掉电保护功能
-
-
CPU
-
2路8核及以上
-
主频2.5G HZ以上
-
2.2 Segment 节点
-
网卡
-
2块万兆网卡内部互联
-
1-2块千兆网卡带外管理及接入客户网络
-
-
内存
-
DDR4 64GB以上,建议256G
-
-
磁盘
-
24块600G/900G 10k RPM SAS盘
-
采用RAID5或RAID10
-
单独预留hotspare 盘
-
1-2块RAID卡,cache 1GB以上,带有掉电保护功能
-
-
CPU
-
2路8核及以上
-
主频2.5G HZ以上
-
2.3 节点配置示例

2.4 经验总结
-
磁盘故障是Greenplum集群最常见故障
-
分析性查询:SAS盘>SATA盘
-
高并发IO查询:优先SSD或者NVMe
-
-
RAID级别
-
RAID5 VS RAID 10
容量 90% VS 50%
可靠性高
坏盘后性能保证
性价比
-
-
RAID卡一定带Cache功能
-
硬件监控
-
预留灾备机
3 硬件配置
3.1 主机配置

3.2 网络配置

每个网卡都配置流量网卡,保证流量网卡的均匀。
3.3 交换机配置

交换机配置是双机。
4 存储规划
4.1磁盘可用空间
-
原始磁盘容量
-
raw_capacity=disk_capacity*number_of_disks
-
-
文件系统开销
-
文件系统格式(10%)
-
RAID级别
-
RAID5:10%
-
RAID10:50%
-
-
formatted_disk_space=(raw_capacity*0.9)/2
-
-
性能因素
-
磁盘容量保持在70%最佳
-
usable_disk_space=formatted_disk_space*0.7
-
-
用户数据空间及临时空间
-
用户数据容量U,临时空间容量U/3
-
With Mirror:usable_disk_space=2*U+U/3
-
Without Mirror:usable_disk_space=U+U/3
-
4.2 用户数据容量
-
数据库用户数据=原始用户数据*1.4(为什么会增加)
-
Page开销
-
每32KB的Page需要20字节Header开销
-
-
Tuple开销
-
每个heap Tuple需要24字节Header开销
-
每个AO Tuple需要4字节Header开销
-
-
Attribute开销
-
类型有关
-
-
Index开销
-
Btree索引与唯一数目有关
-
4.3 系统数据容量
-
Catalog
-
每个Segment约300MB
-
-
Write Ahead Log
-
WAL分为多个64MB的段文件
-
段文件数据最多为2*checkpoint_segment+1(默认checkpoint_segment为8个)
-
每个Segment上WAL最多(2*8+1)*64MB=1088MB
-
-
Database Log文件
-
Log Rotation机制
-
4.4 容量总结
| RAID parity/mirroing | • Depends on RAID type chosen; i.e., 50% of storage for RAID 10 |
| Greenplum Database segment mirrors | • 50% of storage |
| File system overhead | • About 10% of storage |
| Used capacity | • Less than 70% recommended |
| Raw data size and database storage overhead | • Raw data may be 1.4 times larger on disk; depends on table types, indexes, compressions, etc. |
| System metadata | • About 20 MB per segment and master instance |
| Write ahead log (WAL) | • About 1088 MB per segment and master instance |
| Greenplum Database log files | • About 10 MB per segment and master instance |
5 集群配置
5.1 最近系统要求
以下是系统的最近的配置
| Operating System | SUSE Linux Enterprise Server 64-bit 11 SP4, 12 SP2 and SP3 with kernel version greater than 4.4.73-5. • CentOS 64-bit 6.x or 7.x • Red Hat Enterprise Linux (RHEL) 64-bit 6.x or 7.x • Oracle Linux 64-bit 7.4, using the Red Hat Compatible Kernel (RHCK) |
|---|---|
| Minimum CPU | • Pentium Pro compatible (P3/Athlon and above) |
| Memory | • 1 GB RAM per CPU core / 16 GB RAM per Server (The recommended amount of memory for optimal performance is 8-16GB per CPU core) |
| File Systems | • xfs required for data storage on SUSE Linux and Red Hat (ext3 supported for root file system, can be up to 60% slower than xfs on production-level workloads) |
| Disk Requirement | • 150MB per host for Greenplum installation • Approximately 300MB per segment instance for meta data • Appropriate free space for data with disks at no more than 70% capacity • High-speed, local storage |
| Network Requirement | • 10 Gigabit Ethernet within the array • Dedicated, non-blocking switch • NIC bonding is recommended when multiple interfaces are present |
| Software and Utilities | • zlib compression libraries, bash shell, perl, secure shell • GNU tars, GNU zip, GNU sed (used by Greenplum Database gpinitsystem) |
5.2 系统配置
详细配置请看5.10集群安装文档
6 集群安装
6.1 安装方式
RPM安装
Binary安装

本文详述了Greenplum集群的安装配置、硬件选型与最佳实践,包括Master与StandbyMaster的分级部署、Segment的镜像部署策略、磁盘与RAID的选择,以及如何规划存储与网络配置,确保集群的高可用性和性能。
&spm=1001.2101.3001.5002&articleId=105687118&d=1&t=3&u=6f85e5caef1e43688d17b55e0e3934fa)
993

被折叠的 条评论
为什么被折叠?



