Greenplum编译安装

2020-09-22 10:47:00 浏览数 (1)

Greenplum部署手册

一、环境准备

  • 操作系统
代码语言:javascript复制
ARM-Neokylin7.6-64bit
  • 安装包
代码语言:javascript复制
 greenplum6.9.1(源码)
  • 设置语言
代码语言:javascript复制
echo "export LANG=en_US.UTF-8" >> /etc/profile
source /etc/profile
  • 编译环境
代码语言:javascript复制
yum install -y 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 autoconf libtool automake flex wget zlib* openssl openssl-devel libffi-devel

二、安装

  • 机器
代码语言:javascript复制
ip地址
  • 架构
  • 磁盘目录
代码语言:javascript复制
说明	位置
安装源码	/opt/gpsrc
数据存储	/opt/gpdb/data
运行日志	/opt/gpdb
运行	/opt/gpdb
配置目录	/opt/gpdbß
  • 创建目录
  • 安装依赖包
代码语言:javascript复制
安装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 
安装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行注释掉 
# ninja install -C build# echo /usr/local/lib >/etc/ld.so.conf# ldconfig
  • 安装gp
代码语言:javascript复制
源码:
greenplum-6.9.1-src-full.tar.gz


# cd gpdb_src/
#./configure --with-perl --with-python --with-libxml --prefix=/opt/gpdb --disable-orca
# make
# make install

7.	创建用户和组gpadmin
#groupadd -g  3030 gpadmin
#useradd -u 3030 gpadmin -g gpadmin -d /opt/gpdb/gpadmin
#passwd gpadmin
       设置密码,例如gpadmin

 #vim /etc/hosts 
 添加30.23.111.45 gpmaster

 #su – gpadmin
 #mkdir ~/.ssh
 #chmod 700 ~/.ssh
 #cd .ssh/
 #ssh-keygen -t rsa
 #ssh gpmaster cat ~/.ssh/id_rsa.pub >>authorized_keys
        #chmod 600 authorized_keys
      #ssh gpmaster date

8.	GP初始化

Root用户:
#mkdir -p /opt/gpdb/data/master
#mkdir -p /opt/gpdb/data/gp1
#mkdir -p /opt/gpdb/data/gp2
#mkdir -p /opt/gpdb/data/gp3
#mkdir -p /opt/gpdb/data/gp4

      chown -R gpadmin:gpadmin /opt/gpdb

      su - gpadmin


#cd /opt/gpdb
#vim greenplum_path.sh

添加
export MASTER_DATA_DIRECTORY=/opt/gpdb/data/master/gpseg-1
export PGPORT=5432
export PGUSER=gpadmin
export PGDATABASE=gpmaster

#source greenplum_path.sh

#vim ~/.bash_profile
添加source /opt/gpdb/greenplum_path.sh
#source ~/.bash_profile

# vim all_hosts_file
添加当前主机名称:gpmaster

cd ~/.ssh
ssh-keygen -t rsa
cat id_rsa.pub >>authorized_keys

      # gpssh-exkeys -f all_hosts_file


9.	初始化gp

 #su - gpadmin
        # cp docs/cli_help/gpconfigs/gpinitsystem_config .
        # vim gpinitsystem_config

        #declare -a DATA_DIRECTORY=(/opt/gpdb/data/gp1 /opt/gpdb/data/gp2 /opt/gpdb/data/gp3 /opt/gpdb/data/gp4)
        #MASTER_HOSTNAME=gpmaster
        #MASTER_DIRECTORY=/opt/gpdb/data/master
        #DATABASE_NAME=gpmaster

 #vim seg_hosts_file
添加当前主机名称,例如SZD-BDL0014729,可以从/etc/hosts查看

        # gpinitsystem -c gpinitsystem_config -h seg_hosts_file

       一路yes

三、启动

四、安装错误

  • 安装错误
代码语言:javascript复制
/tmp/cc4A3KMY.s: Assembler messages:
/tmp/cc4A3KMY.s:25: Error: unknown mnemonic `movq' -- `movq %rbp,x19'
make[6]: *** [CStackDescriptor.o] Error 1
make[6]: Leaving directory `/opt/gpsrc/gpdb_src/src/backend/gporca/libgpos/src/common'
make[5]: *** [common-recursive] Error 2
make[5]: Leaving directory `/opt/gpsrc/gpdb_src/src/backend/gporca/libgpos/src'
make[4]: *** [src-recursive] Error 2
make[4]: Leaving directory `/opt/gpsrc/gpdb_src/src/backend/gporca/libgpos'
make[3]: *** [libgpos-recursive] Error 2
make[3]: Leaving directory `/opt/gpsrc/gpdb_src/src/backend/gporca'
make[2]: *** [gporca-recursive] Error 2
make[2]: Leaving directory `/opt/gpsrc/gpdb_src/src/backend'
make[1]: *** [all-backend-recurse] Error 2
make[1]: Leaving directory `/opt/gpsrc/gpdb_src/src'
make: *** [all-src-recurse] Error 2

解决:
**disable-orca**
  • 初始化错误:
代码语言:javascript复制
# gpinitsystem -c gpinitsystem_config -h seg_hosts_file
20200911:14:08:09:043912 gpinitsystem:SZD-BDL0014729:root-[INFO]:-Checking configuration parameters, please wait...
20200911:14:08:09:043912 gpinitsystem:SZD-BDL0014729:root-[FATAL]:-Unable to run this script as root Script Exiting!
  • 启动错误
代码语言:javascript复制
$ gpstart
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Starting gpstart with args:
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Gathering information and validating the environment...
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.0.0-beta.1 build dev'
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Starting Master instance in admin mode
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[INFO]:-Obtaining Segment details from master...
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[ERROR]:-FATAL - no master dbs defined!
20200911:15:21:33:052842 gpstart:SZD-BDL0014729:gpadmin-[CRITICAL]:-gpstart failed. (Reason='Error: GpArray() - no master dbs defined') exiting...

修改host,重新初始化

0 人点赞