Greenplum集群安装配置及最佳实践
视频地址
视频地址:https://www.bilibili.com/video/av82277973/
[TOC]
总体原则
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安装
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
外国CTO也感兴趣的开源数据库项目——openHalo
小满未满、
1961次阅读
2025-04-21 16:58:09
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
382次阅读
2025-04-15 14:48:05
中国PostgreSQL培训认证体系新增PGAI应用工程师方向
开源软件联盟PostgreSQL分会
190次阅读
2025-05-06 10:21:13
4月“墨力原创作者计划”获奖名单公布!
墨天轮编辑部
189次阅读
2025-05-13 16:21:59
QPlus V6.3 更新,新增PostgreSQL与PolarDB PG支持,OceanBase 容灾管理重磅上线
沃趣科技
188次阅读
2025-05-13 09:39:27
华象新闻 | PostgreSQL 18 Beta 1、17.5、16.9、15.13、14.18、13.21 发布
严少安
169次阅读
2025-05-09 11:34:10
PG生态赢得资本市场青睐:Databricks收购Neon,Supabase融资两亿美元,微软财报点名PG
老冯云数
160次阅读
2025-05-07 10:06:22
SQL 优化之 OR 子句改写
xiongcc
148次阅读
2025-04-21 00:08:06
告别老旧mysql_fdw,升级正当时
NickYoung
128次阅读
2025-04-29 11:15:18
PostgreSQL中文社区亮相于第八届数字中国峰会
PostgreSQL中文社区
118次阅读
2025-05-07 10:06:20