Compile source code and install Greenplum database

Keywords: Database GreenPlum Python pip yum

Article directory

Summary

Greenplum's binary files and RPM package files have limited download channels. Sometimes it may not be easy to download the corresponding version. If necessary, Greenplum can be installed by source code compilation. Yes, but there may be more problems.

Download source packages

The installed version of gp is 5.6. First, download the source code on the official website.
Website:
https://github.com/greenplum-db/gpdb/releases?after=5.8.1

Install some common dependencies

Must install
All machines, with root privileges, execute the following commands in Terminal (you need to perform yum download and install packages online)
Installation of pip also requires several steps:
Install the pip command

yum -y install epel-release
yum -y install python-pip
[root@dw-greenplum-1 ~]# yum -y install rsync coreutils glib2 lrzsz sysstat e4fsprogs xfsprogs ntp readline-devel zlib zlib-devel openssl openssl-devel pam-devel libxml2-devel libxslt-devel python-devel tcl-devel gcc make smartmontools flex bison perl perl-devel perl-ExtUtils* OpenIPMI-tools openldap openldap-devel logrotate gcc-c++ python-py
[root@dw-greenplum-1 ~]# yum -y install bzip2-devel libevent-devel apr-devel curl-devel ed python-paramiko python-devel

[root@dw-greenplum-1 ~]# wget https://bootstrap.pypa.io/get-pip.py
[root@dw-greenplum-1 ~]# python get-pip.py
[root@dw-greenplum-1 ~]# pip install lockfile paramiko setuptools epydoc psutil
[root@dw-greenplum-1 ~]# pip install --upgrade setuptools

Install c++ 11

At present, GCC is the most supportive compiler for C++11, but GCC 4.8 and above is required.
Compile time error:

configure: error: *** A compiler with support for C++11 language features is required.
  1. Get GCC 4.9.4 package: wget http://gcc.skazkaforyou.com/releases/gcc-4.8.2/gcc-4.8.2.tar.gz;

  2. Decompression: tar-xf gcc-4.9.4.tar.gz;

  3. Go to the directory gcc-4.9.4 and run:. / contrib/download_prerequisites. This magic script file will help us download, configure and install dependency libraries, which can save us a lot of time and energy.
    Create the output directory and put it into the directory: mkdir gcc-build-4.9.4; cd gcc-build-4.9.4;
    ... / configure --enable-checking=release --enable-languages=c,c++ --disable-multilib. Enable-languages means that you want your gcc to support those languages, - disable-multilib does not generate cross-compilers compiled into executable code for other platforms. The compiler generated by disable-checking does not do any extra checks during compilation, and can also use enable-checking = XXXX to add some checks.

  4. Compiling: make; pay attention to this step and the previous step, which is time-consuming;

  5. Installation: make install;

  6. Verification: gcc -v; or G + - v, if the GCC version shown is still the previous version, you need to restart the system; or you can view the installation location of gcc: which gcc; and then look at the version / usr/local/bin/gcc -v, where GCC is usually installed, if displayed as;

[root@mdw gpdb-5.6.0]# c++ -v
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.4/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.9.4 (GCC) 

Start compilation

Unzip the downloaded green plus package and enter it.
implement

 ./configure --prefix=/usr/local/greenplum-5.6

Compilation error:

configure: error: GPOS header files are required for Pivotal Query Optimizer (orca)

To solve this problem, add: - dsiable to the compilation command

 ./configure --prefix=/usr/local/greenplum-5.6  --disable  orca

After compiling correctly

make
make install

Install according to the normal steps of green plus

Other common installation steps, and bin file and RPM package installation steps are the same.
After the installation is complete, you can see the status information.

20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-Process results...
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            = 4
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20181015:18:39:51:005936 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /gpdata/gp-5.6/master/gpseg-1 
20181015:18:39:52:005936 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
20181015:18:39:52:005936 gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
20181015:18:39:52:005936 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
[gpadmin@mdw ~]$ 
[gpadmin@mdw ~]$ psql postgres
psql (8.3.23)
Type "help" for help.

postgres=# 
postgres=# 
postgres=# SELECT * from gp_segment_configuration ;
 dbid | content | role | preferred_role | mode | status | port  | hostname |   address    | replication_port 
------+---------+------+----------------+------+--------+-------+----------+--------------+------------------
    1 |      -1 | p    | p              | s    | u      |  5432 | mdw      | mdw          |                 
    2 |       0 | p    | p              | s    | u      | 40000 | sdw1     | 192.168.2.63 |                 
    4 |       2 | p    | p              | s    | u      | 40000 | sdw2     | 192.168.2.64 |                 
    3 |       1 | p    | p              | s    | u      | 40001 | sdw1     | 192.168.2.63 |                 
    5 |       3 | p    | p              | s    | u      | 40001 | sdw2     | 192.168.2.64 |                 
(5 rows)

Some details

The biggest problem with installing the source code in Greenplum is that there will be some errors such as missing Python packages. Moreover, there is little information about this error and few sources to check. There is a good chance of stalemate. So before installing, make sure that all nodes have all kinds of Python dependencies installed.

Posted by nazariah on Sat, 02 Feb 2019 16:21:16 -0800