Greenplum 是一款开源MPP数据分析平台,提供包括数据分析、机器学习和人工智能等特色功能。目前 Greenplum 的二进制发行版本只能运行在 X86 服务器。github上的Greenplum releases只有x86的发行版,没有提供ARM 发行版。Greenplum 是开源软件,我们可以通过编译 Greenplum 源代码自行构建 Greenplum 的 ARM 版本。
本文将详细讲述如何在 ARM 服务器上编译并打包开源版 Greenplum。
编译环境:CentOS Linux release 7.6.1810 (AltArch)
需要提前准备OS镜像、python依赖包、cmake、zstd-dev、Xerces、re2c、ninja、gporca等源码包配置编译环境,另外Greenplum编译需要Greenplum源码包。
- setuptools https://pypi.org/project/setuptools/33.1.1/#files
- psutil-5.7.2 https://pypi.org/project/psutil/#files
- pbr-5.4.5 https://pypi.org/project/pbr/#files
- lockfile-0.12.2 https://pypi.org/project/lockfile/#files
- pycparser-2.20 https://pypi.org/project/pycparser/#files
- cffi-1.14.1 https://pypi.org/project/cffi/#files
- bcrypt-3.1.7 https://pypi.org/project/bcrypt/#files
- six-1.15.0 https://pypi.org/project/six/#files
- PyNaCl-1.4.0 https://pypi.org/project/PyNaCl/#files
- cryptography-3.0 https://pypi.org/project/cryptography/#files
- ipaddress-1.0.23 https://pypi.org/project/ipaddress/#files
- enum34-1.1.10 https://pypi.org/project/enum34/#files
- paramiko-2.7.1 https://pypi.org/project/paramiko/#files
- epydoc-3.0.1 https://pypi.org/project/epydoc/#files
- cmake-3.9.2 https://cmake.org/files/v3.9/cmake-3.9.2.tar.gz
- zstd-dev-1.4.5 https://github.com/facebook/zstd
- Xerces-3.1.2-p1 https://github.com/greenplum-db/gp-xerces
- re2c-2.0 https://github.com/skvadrik/re2c
- ninja-1.10.0 https://github.com/ninja-build/ninja
- gporca-3.106.1 https://github.com/greenplum-db/gporca/tree/v3.65.3
- Greenplum-6.9.1 https://github.com/greenplum-db/gpdb/releases/download/6.9.1/6.9.1-src-full.tar.gz
下载并上传如下软件包到服务器上:
bcrypt-3.1.7.tar.gz
cffi-1.14.1.tar.gz
cryptography-3.0.tar.gz
enum34-1.1.10.tar.gz
epydoc-3.0.1.zip
gporca-3.106.1.tar.gz
gp-xerces-3.1.2-p1.tar.gz
greenplum-6.9.1-src-full.tar.gz
ipaddress-1.0.23.tar.gz
lockfile-0.12.2.tar.gz
ninja-1.10.0.tar.gz
paramiko-2.7.1.tar.gz
pbr-5.4.5.tar.gz
psutil-5.7.2.tar.gz
pycparser-2.20.tar.gz
PyNaCl-1.4.0.tar.gz
re2c-2.0.tar.gz
setuptools-33.1.1.zip
six-1.15.0.tar.gz
zstd-1.4.5.tar.gz
安装依赖包。
#yum -y install curl-devel bzip2-devel python-devel openssl-devel readline-devel perl-ExtUtils-Embed libxml2-devel openldap-devel pam pam-devel perl-devel apr-devel libevent-devel libyaml libyaml-devel libedit-devel libffi-devel
安装python依赖包:
安装setuptools
#cd setuptools-master
#python bootstrap.py
#python setup.py install
安装psutil
#cd psutil-5.7.2
#python setup.py install
安装pbr
#cd pbr-5.4.5
#python setup.py install
安装lockfile
#cd lockfile-0.12.2
#python setup.py install
安装pycparser
#cd pycparser-2.20
#python setup.py install
安装cffi
#cd cffi-1.14.1
#python setup.py install
安装six
#cd six-1.15.0
#python setup.py install
安装bcrypt
#cd bcrypt-3.1.7
#python setup.py install
安装PyNaCl
#cd PyNaCl-1.4.0
#python setup.py install
安装ipaddress
#cd ipaddress-1.0.23
#python setup.py install
安装enum34
#cd enum34-1.1.10
#python setup.py install
安装cryptography
#cd cryptography-3.0
#python setup.py install
安装paramiko
#cd paramiko-2.7.1
#python setup.py install
安装epydoc
#cd epydoc-3.0.1
#python setup.py install
安装cmake
#cd cmake-3.9.2
#./bootstrap
#make
#make install
#/usr/local/bin/cmake --version
![31728ac004c4b64a4a62606c4379b551.png](https://i-blog.csdnimg.cn/blog_migrate/7f652749f2ea1696054c852e0aa51842.jpeg)
cmake version
安装zstd
#cd zstd-1.4.5
#make
#make install
安装Xerces
# cd gp-xerces-3.1.2-p1
#./configure
#make
#make install
安装re2c
# cd re2c-2.0
#./autogen.sh
#./configure
#make
#make install
安装ninja
#cd ninja-1.10.0
#./configure.py --bootstrap
#cp ninja /usr/bin/
安装gporca
# cd gporca-3.106.1
#cmake -GNinja -H. -Bbuild
#vi libgpos/src/common/CStackDescriptor.cpp
第167行注释掉
![0333a7235706cfe37185de91365bc204.png](https://i-blog.csdnimg.cn/blog_migrate/0808713c1f8cab99a03ca69f1fb9702c.jpeg)
backtrace
#ninja install -C build
#echo /usr/local/lib >/etc/ld.so.conf
#ldconfig
编译greenplum6.9.1
准备完成后可以编译greenplum6.9.1了
# cd gpdb_src/
#./configure --with-perl --with-python --with-libxml --prefix=/usr/local/gpdb
#make
![531ea3b47e530ac6435d4524c36ba622.png](https://i-blog.csdnimg.cn/blog_migrate/b78f1d27d6cfae3d7904be068c881e64.jpeg)
greenplum make
如果make成功了,就可以开始制作rpm安装包了。
安装rpm-build
yum install rpm-build
在/root目录下建rpmbuild目录
mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/RPMS ~/rpmbuild/BUILDROOT ~/rpmbuild/SRPMS ~/rpmbuild/SOURCES ~/rpmbuild/SPECS
编辑greenplum6.9.1.spec
vi ~/rpmbuild/SPECS/greenplum6.9.1.spec
![7e15a35361106fd7e5e474e40349ed51.png](https://i-blog.csdnimg.cn/blog_migrate/6ca2eb36364b53458870dde0d65430ea.jpeg)
gp spec
修改greenplum源代码目录名为greenplum-6.9.1并压缩:
mv gpdb_src greenplum-6.9.1
tar czvf greenplum-6.9.1.tar.gz greenplum-6.9.1
把greenplum源码包复制到rpmbuild源代码目录
cp greenplum-6.9.1.tar.gz ~/rpmbuild/SOURCES/
制作rpm安装包:
rpmbuild -ba ~/rpmbuild/SPECS/greenplum6.9.1.spec
![0b871a04e1dfd66e99808fc20724f471.png](https://i-blog.csdnimg.cn/blog_migrate/c5b73870c8af7a5fa192bb6ff14da4ba.jpeg)
rpmbuild完成
查看制作好的rpm安装包:
![f082b94dff0119ec7041e300213c8727.png](https://i-blog.csdnimg.cn/blog_migrate/a674bd767d0cb6b6db6a5cc258f24ae1.jpeg)
rpmfile
完。