暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GreenPlum6源码编译安装ORCA优化器

原创 多米爸比 2020-02-23
3051

参考 https://github.com/greenplum-db/gporca
ORCA 是PostgreSQL的下一代优化器,在QUERY的优化上比自带的优化器更先进。

1.安装cmake

$ wget https://cmake.org/files/v3.16/cmake-3.16.4.tar.gz

$ tar -zxvf cmake-3.16.4.tar.gz

$ cd cmake-3.16.4

$ ./configure --prefix=/home/jerome/cmake

$ make && make install

$ export PATH=/home/jerome/cmake/bin:$PATH

2.安装GPOS

$ cd ~

$ git clone https://github.com/greenplum-db/gpos

$ cd gpos

$ mkdir build && cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/home/jerome/gpos_home ../

$ make install

3.安装gp-xerces

$ cd ~

$ git clone https://github.com/greenplum-db/gp-xerces

$ cd gp-xerces

$ mkdir build && cd build

$ ../configure --prefix=/home/jerome/gp-xerces_home

$ make -j 32 && make install

4.安装gporca

$ cd ~

$ git clone https://github.com/greenplum-db/gporca.git

$ cd gporca

$ mkdir build && cd build

$ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/home/jerome/gporca_home \
-D XERCES_INCLUDE_DIR=/home/jerome/gp-xerces_home/include \
-D XERCES_LIBRARY=/home/jerome/gp-xerces_home/lib/libxerces-c.so ../

$ make -j 32 && make install

5.安装greenplum6.0

$ git clone https://github.com/greenplum-db/gpdb.git

$ cd gpdb

$ ./configure --prefix=/home/jerome/gp \
--enable-orca --with-perl \
--with-python --with-libxml \
--with-includes=/home/jerome/gporca_home/include:/home/jerome/gpos_home/include:/home/jerome/gp-xerces_home/include \
--with-libraries=/home/jerome/gporca_home/lib:/home/jerome/gpos_home/lib:/home/jerome/gp-xerces_home/lib

上面编译命令提示错误如下:
checking Checking ORCA version... configure: error: 
Your ORCA version is expected to be 3.88.XXX

于是重新下载一个3.88.1的orca版本
重新安装完后还是报上面的错

仔细查看错误日志文件,发现下面一行
$ cat config.log |more
./conftest: error while loading shared libraries: libgpopt.so.3: cannot open shared object file: No such file or directory

大概知道是so未找到,并不是提示的orca版本的问题,于是设置环境变量如下:
$ export LD_LIBRARY_PATH=/home/jerome/gpos_home/lib:\
/home/jerome/gp-xerces_home/lib:\
/home/jerome/gporca_home/lib:\
$LD_LIBRARY_PATH

重新编译configure通过,然后继续安装 
$ make -j 32 && make install
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论