Greenplum 是一款全球领先的开源大数据平台,为全球各行各业提供具备实时处理、弹性扩容、弹性计算、混合负载、云原生和集成数据分析能力的强大的大数据引擎,目前广泛的应用于包括金融、保险、证券、通信、航空、物流、零售、媒体、政府、医疗、制造、能源等行业。
目前 Greenplum 的二进制发行版本只能运行在 X86 服务器。无论是 Greenplum 的官方开发商 Pivotal 公司,还是其他 Greenplum 发行商,都没有提供 Greenplum 的 ARM 发行版。不过,Greenplum 是开源软件,我们可以通过编译 Greenplum 源代码自行构建 Greenplum 的 ARM 版本。
本文将详细讲述如何在 ARM 服务器上编译并运行开源版 Greenplum。
环境准备
编译环境:CentOS 7.X。
- 安装 EPEL 软件库
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum makecache
- 关闭防火墙
# systemctl stop firewalld# systemctl disable firewalld
- 配置Linux内核,修改 /etc/sysctl.conf 文件,添加下列内容
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 512000 100 2048
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.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.defalut.arp_filter = 1
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.overcommit_memory = 2
- 修改 /etc/security/limits.conf 文件
* soft nofile 524288
* hard nofile 524288
* soft nproc 131072
* hard nproc 131072
- 关闭 SELinux,编辑 /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
- 创建gpadmin用户
# useradd gpadmin
# passwd gpadmin
- 安装编译所需的工具及软件包
# yum groupinstall 'Development Tools' # GCC, libtools etc
# yum install curl-devel bzip2-devel python-devel openssl-devel readline-devel perl-ExtUtils-Embed libxml2-devel perl-devel zstd git
# wget https://bootstrap.pypa.io/get-pip.py
# python get-pip.py
# pip install psutil lockfile paramiko setuptools epydoc conan
- 重启服务器,是配置生效
# reboot
- 使用 gpadmin 登入,配置 ssh 免密码登录
$ ssh-keygen -t rsa
$ ssh-copy-id -i ~/.ssh/id_rsa gpadmin@localhost
编译源代码
- 下载 Greenplum 源代码
$ git clone https://github.com/greenplum-db/gpdb
- 编译
$ cd gpdb
$ git checkout 6X_STABLE #假设编译6.X版本
$ CFLAGS="-O0 -g3 -ggdb3" \
./configure --with-perl --with-python --with-libxml --enable-debug --enable-cassert \
--disable-orca --disable-gpcloud --disable-gpfdist \
--disable-gpfdist
$ make
$ sudo make install
编译安装完成
总结
由此可见,Greenplum 作为一款为通用平台设计的 MPP 数据库,在 ARM 服务器上的编译安装流程和在普通 X86 服务器上几乎没有区别,感兴趣的小伙伴可以自行在 ARM 服务器上尝试一下 Greenplum 的编译。
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。