绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
GreenPlum6源码编译安装ORCA优化器
2022-06-06 14:43:11

参考 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
分享好友

分享这个小栈给你的朋友们,一起进步吧。

Greenplum
创建时间:2022-04-08 15:36:19
Greenplum
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

技术专家

查看更多
  • itt0918
    专家
戳我,来吐槽~