gpdb-5.28.1源码编译安装

简单记录一下源码编译时遇到的问题

1.获取源码

从github上下载release的代码:https://github.com/greenplum-db/gpdb/releases/tag/5.28.1

2.编译安装

将源代码上传到CentOS 7服务器,本次编译不带有gporca,并且指定了安装路径,编译安装属于正常套路,比较简单的3条命令:

tar -xzvf gpdb-5.28.1.tgz
cd gpdb-5.28.1
./configure --prefix=/home/gposs5/gpdb --disable-orca
make 
make install

3.初始化及问题解决

1)安装完成后,我们可以查看/home/gposs5/gpdb下面已经存在相应的可执行文件。

[gposs5@centos7 ~]$ ls gpdb
bin  doc  docs  etc  greenplum_path.sh  include  lib  sbin  share

2)此时我们将环境变量文件增加到.bashrc并使其生效:

[gposs5@centos7 ~]$ vim .bashrc
[gposs5@centos7 ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
source /home/gposs5/gpdb/greenplum_path.sh
[gposs5@centos7 ~]$ source .bashrc

环境变量生效后,理论上,我们可以直接调用gp的相关命令了,如果没法调用,请检查环境变量是否生效。

3)下面开始交换机器密钥:

[gposs5@centos7 ~]$ gpssh-exkeys -h centos7
Error: unable to import module: No module named paramiko

啊哈,paramiko库不存在,手工安装:

sudo pip install paramiko

再次尝试交换机器密钥:

[gposs5@centos7 ~]$ gpssh-exkeys -h centos7
/usr/lib/python2.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
Error: unable to import module: No module named psutil

啊哈,psutil库不存在,手工安装,注意,psutil这个库安装时有可能需要更新pip和setuptools,我在安装过程中,遇到了以下的问题,经过更新这2个工具才安装成功:

[gposs5@centos7 ~]$ gpssh-exkeys -h centos7
/usr/lib/python2.7/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
Error: unable to import module: No module named psutil

[parallels@centos7 ~]$ sudo /usr/bin/python2 -m pip install --upgrade pip
/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py:47: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
  from cryptography import x509
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting pip
  Downloading pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 19 kB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.0.2
    Uninstalling pip-20.0.2:
      Successfully uninstalled pip-20.0.2
Successfully installed pip-20.2.2

[parallels@centos7 tmp]$ sudo pip install psutil
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting psutil
  Using cached psutil-5.7.2.tar.gz (460 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jvYEp9/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jvYEp9/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-EPLC_9
         cwd: /tmp/pip-install-jvYEp9/psutil/
    Complete output (3 lines):
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    error in psutil setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
[parallels@centos7 tmp]$ sudo pip install --upgrade setuptools

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 8.6 kB/s
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 0.9.8
    Uninstalling setuptools-0.9.8:
      Successfully uni
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

阿福Chris

你的鼓励是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值