이번 포스팅에서는 기본 Greenplum Database (이하 GPDB) 도커 이미지를 내려받아서, 그 위에 대용량 데이터 통계분석, 기계학습에 활용하는 MADlib, PL/R, PL/Python을 설치한 Docker Image 만든 후, Docker Hub에 올리는 일련의 절차에 대해서 소개하겠습니다. 


이번 포스팅은 도커로 GPDB 기반 분석 환경을 구성하는 절차로서, 데이터 엔지니어링에 관심있으신 분에게 도움이 될 것 같습니다. 혹시 데이터 분석으로 바로 넘어가고 싶은 분은 다음번 포스팅(http://rfriend.tistory.com/379)을 참고하시면 되며, 이번 포스팅을 skip 하여도 아무런 문제 없이 도커를 사용하여 GPDB 기반 분석 환경을 바로 바로 이용하실 수 있습니다. 



[ GPDB 기본 도커 이미지에 MADlib, PL/R, PL/Python 설치 후 gpdb-analytics 도커 이미지 새로 만들어서 Docker Hub에 올리기 절차 ]






0. Dokcer Hub 회원 가입 및 Docker Desktop 다운로드/설치




Windows OS 사용자의 경우 자신의 Windows 버전에 맞게 'Docker CE for Windows' 혹은 'Docker Toolbox'를 다운로드 받아 설치하면 됩니다. 





1. Docker Hub에서 기본 GPDB 이미지를 pull 해서 사용하기

 

<터미널 사용>

1-1.docker image download



docker pull hdlee2u/gpdb-base

docker images

REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE

centos                  7                   d123f4e55e12        9 months ago        197MB

hdlee2u/gpdb-base      latest              bfe4e63b8e81        2 years ago         1.17GB

 




1-2.docker image
실행/ 5432를 기본 포트로, ,ssh2022포트를 사용하여 접근 가능하도록 docker 이미지 실행 



docker run -i -d -p 5432:5432 -p 2022:22 --name gpdb  hdlee2u/gpdb-base

docker ps -a

 




1-3.docker image
중단, 시작 후 동작 상태 확인 



docker stop gpdb

docker start gpdb

docker ps

CONTAINER ID    IMAGE                   COMMAND                   CREATED             STATUS              PORTS                   NAMES

4e6b947be0d6    hdlee2u/gpdb-base   "/bin/sh -c 'echo \"1…"   29 hours ago        Up 3 hours        0.0.0.0:5432->5432/tcp, 0.0.0.0:2022->22/tcp   gpdb

ihongdon-ui-MacBook-Pro:~ ihongdon$

 




2. Docker GPDBMADlib 설치하기

 

2-1. GPDB version 확인 (PGAdmin III 에서)



# select version()

 

PostgreSQL 8.2.15 (Greenplum Database 4.3.7.1 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Jan 21 2016 15:51:02

 




2-2.Pivotal Network(https://network.pivotal.io)
에서 MADlib 다운로드 (회원가입 필요) 


Pivotal Greenplum Releases: 4.3.18.0 버전 카테고리에서

>> Greenplum Advanced Analytics 선택

>> MADlib 1.12 다운로드

(https://network.pivotal.io/products/pivotal-gpdb/#/releases/8538/file_groups/764)

 






2-3. MADlib downloads 한 파일을 docker로 복사



cd Downloads/

ls

madlib-1.12-gp4.3-rhel5-x86_64.tar.gz

 



docker exec -i -t gpdb /bin/bash

[root@4e6b947be0d6 ~]# mkdir /setup

 

[참고파일 옮길 때

[root@4e6b947be0d6 ~]# mv mad* /setup/

 




2-4. docker container 내부의 /bin/bash 프로세스 실행 후, MADlib 파일을 Docker GPDB에 복사하기

 

다른 터미널의 Downloads 경로에서


docker cp madlib-1.12-gp4.3-rhel5-x86_64.tar.gz gpdb:/setup/



[root@4e6b947be0d6 ~]# chown -R gpadmin:gpadmin /setup

[root@4e6b947be0d6 ~]# cd /setup

[root@4e6b947be0d6 setup]# ls -la

total 7492

drwxr-xr-x 2 gpadmin gpadmin    4096 Aug  8 07:44 .

drwxr-xr-x 1 root    root       4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin 3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

-rw-r--r-- 1 gpadmin gpadmin 3728292 Aug 29  2017 madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

 




2-5. 권한 부여

 


[root@4e6b947be0d6 ~]# chown -R gpadmin:gpadmin /setup

[root@4e6b947be0d6 ~]# cd /setup

[root@4e6b947be0d6 setup]# ls -la

total 7492

drwxr-xr-x 2 gpadmin gpadmin    4096 Aug  8 07:44 .

drwxr-xr-x 1 root    root       4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin 3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

-rw-r--r-- 1 gpadmin gpadmin 3728292 Aug 29  2017 madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

 




2-6. MADlib 압축 풀고 설치하기



[root@4e6b947be0d6 setup]# su - gpadmin

-bash-4.1$ cd /setup

-bash-4.1$ ls -la

total 7492

drwxr-xr-x 2 gpadmin gpadmin    4096 Aug  8 07:44 .

drwxr-xr-x 1 root    root       4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin 3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

 

-bash-4.1$ tar xf madlib-1.12-gp4.3-rhel5-x86_64.tar

-bash-4.1$ ls -la

total 7692

drwxr-xr-x 2 gpadmin gpadmin    4096 Aug  8 07:45 .

drwxr-xr-x 1 root    root       4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin 3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

-rw-r--r-- 1 gpadmin gpadmin 3728292 Aug 29  2017 madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin  135530 Aug 29  2017 open_source_license_MADlib_1.12_GA.txt

-rw-r--r-- 1 gpadmin gpadmin   51900 Aug 29  2017 ReleaseNotes.txt

 

-bash-4.1$ gppkg -i madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Starting gppkg with args: -i madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing package madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/madlib-1.12-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg locally

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/madlib-1.12-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:07:47:11:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing rpms cmdStr='rpm -i /usr/local/greenplum-db-4.3.7.1/.tmp/madlib-1.12-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix=/usr/local/greenplum-db-4.3.7.1'

20180808:07:47:12:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Completed local installation of madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg.

20180808:07:47:12:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Please run the following command to deploy MADlib

usage:  madpack install [-s schema_name] -p greenplum -c user@host:port/database

Example:

       $ $GPHOME/madlib/bin/madpack install -s madlib -p greenplum -c gpadmin@mdw:5432/testdb

       This will install MADlib objects into a Greenplum database named "testdb"

       running on server "mdw" on port 5432. Installer will try to login as "gpadmin"

       and will prompt for password. The target schema will be "madlib".

       To upgrade to a new version of MADlib from version v1.0 or later, use option "upgrade",

       instead of "install"

For additional options run:

$ madpack --help

Release notes and additional documentation can be found at http://madlib.apache.org

20180808:07:47:12:000512 gppkg:4e6b947be0d6:gpadmin-[INFO]:-madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg successfully installed.

-bash-4.1$  madpack install ^C

-bash-4.1$ hostname

4e6b947be0d6

-bash-4.1$ cat /etc/hosts

127.0.0.1       localhost

::1      localhost ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

172.17.0.2     4e6b947be0d6

127.0.0.1 72ba20be3774

 




Database list 확인


 

-bash-4.1$ psql

psql (8.2.15)

Type "help" for help.

 

gpadmin=# \l

                  List of databases

   Name    |  Owner  | Encoding |  Access privileges 

-----------+---------+----------+---------------------

 gpadmin   | gpadmin | UTF8     |

 postgres  | gpadmin | UTF8     |

 template0 | gpadmin | UTF8     | =c/gpadmin         

                                : gpadmin=CTc/gpadmin

 template1 | gpadmin | UTF8     | =c/gpadmin         

                                : gpadmin=CTc/gpadmin

(4 rows)

 

gpadmin=# \q




-bash-4.1$ $GPHOME/madlib/bin/madpack install -s madlib -p greenplum -c gpadmin@127.0.0.1:5432/gpadmin

madpack.py : INFO : Detected Greenplum DB version 4.3.7.

madpack.py : INFO : *** Installing MADlib ***

madpack.py : INFO : MADlib tools version    = 1.12 (/usr/local/greenplum-db-4.3.7.1/madlib/Versions/1.12/bin/../madpack/madpack.py)

madpack.py : INFO : MADlib database version = None (host=127.0.0.1:5432, db=gpadmin, schema=madlib)

madpack.py : INFO : Testing PL/Python environment...

madpack.py : INFO : > Creating language PL/Python...

madpack.py : INFO : > PL/Python environment OK (version: 2.6.2)

madpack.py : INFO : Installing MADlib into MADLIB schema...

madpack.py : INFO : > Creating MADLIB schema

madpack.py : INFO : > Creating MADLIB.MigrationHistory table

madpack.py : INFO : > Writing version info in MigrationHistory table

madpack.py : INFO : > Creating objects for modules:

madpack.py : INFO : > - array_ops

madpack.py : INFO : > - bayes

madpack.py : INFO : > - crf

madpack.py : INFO : > - elastic_net

madpack.py : INFO : > - linalg

madpack.py : INFO : > - pmml

madpack.py : INFO : > - prob

madpack.py : INFO : > - sketch

madpack.py : INFO : > - svec

madpack.py : INFO : > - svm

madpack.py : INFO : > - tsa

madpack.py : INFO : > - stemmer

madpack.py : INFO : > - conjugate_gradient

madpack.py : INFO : > - knn

madpack.py : INFO : > - lda

madpack.py : INFO : > - stats

madpack.py : INFO : > - svec_util

madpack.py : INFO : > - utilities

madpack.py : INFO : > - assoc_rules

madpack.py : INFO : > - convex

madpack.py : INFO : > - glm

madpack.py : INFO : > - graph

madpack.py : INFO : > - linear_systems

madpack.py : INFO : > - recursive_partitioning

madpack.py : INFO : > - regress

madpack.py : INFO : > - sample

madpack.py : INFO : > - summary

madpack.py : INFO : > - kmeans

madpack.py : INFO : > - pca

madpack.py : INFO : > - validation

madpack.py : INFO : MADlib 1.12 installed successfully in MADLIB schema.

 



 

스키마 리스트 & MADlib 버전 확인



-bash-4.1$ psql

psql (8.2.15)

Type "help" for help.

 

gpadmin=# \dn

       List of schemas

        Name        |  Owner 

--------------------+---------

 gp_toolkit         | gpadmin

 information_schema | gpadmin

 madlib             | gpadmin

 pg_aoseg           | gpadmin

 pg_bitmapindex     | gpadmin

 pg_catalog         | gpadmin

 pg_toast           | gpadmin

 public             | gpadmin

(8 rows)

 

gpadmin=# select madlib.version();

MADlib version: 1.12, git revision: rc/1.12-rc1, cmake configuration time: Wed Aug 23 22:33:09 UTC 2017, build type: Release, build system: Linux-2.6.18-238.27.1.el5.hot

fix.bz516490, C compiler: gcc 4.4.0, C++ compiler: g++ 4.4.0

(1 row)

 

---- MADlib 설치 성공 완료! ----

 

gpadmin=# \q

 




3. Docker GPDB
PL/R 설치하기 

 

Cent OS 버전 확인하기



-bash-4.1$ cat /etc/redhat-release

CentOS release 6.7 (Final)

 




3-1. Pivotal Network에서 PL/R 다운로드 하기

Pivotal Greenplum Releases: 4.3.18.0 카테고리에서

>> Greenplum Procedural Languages

>> PL/R for RHEL 6 다운로드

(https://network.pivotal.io/products/pivotal-gpdb/#/releases/8538/file_groups/768)

 




3-2. (다른 터미널에서) Docker GPDB/setup 폴더로 PL/R 복사하기



ihongdon-ui-MacBook-Pro:~ ihongdon$ cd Downloads/

ihongdon-ui-MacBook-Pro:Downloads ihongdon$ ls -la

total 90512

-rw-r--r--@  1 ihongdon  staff   3788987  8  8 14:10 madlib-1.12-gp4.3-rhel5-x86_64.tar.gz

-rw-r--r--@  1 ihongdon  staff  39640735  8  8 16:51 plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

 

ihongdon-ui-MacBook-Pro:Downloads ihongdon$ docker cp plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg gpdb:/setup

 




3-3. (Docker
터미널에서) 권한 부여하기 및 gpadmin 들어가기 



[root@4e6b947be0d6 setup]# su - gpadmin

-bash-4.1$ ls

madlib-1.12-gp4.3-rhel5-x86_64.tar                     

open_source_license_MADlib_1.12_GA.txt  ReleaseNotes.txt

madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg 

plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

-bash-4.1$ exit

logout

 

[root@4e6b947be0d6 setup]# chown gpadmin:gpadmin plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

 

 [root@4e6b947be0d6 setup]# su - gpadmin

-bash-4.1$ cd /setup

-bash-4.1$ ls

madlib-1.12-gp4.3-rhel5-x86_64.tar                     

open_source_license_MADlib_1.12_GA.txt  ReleaseNotes.txt

madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg 

plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

 

-bash-4.1$ ls -la

total 46404

drwxr-xr-x 2 gpadmin gpadmin     4096 Aug  8 07:52 .

drwxr-xr-x 1 root    root        4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin  3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

-rw-r--r-- 1 gpadmin gpadmin      566 Aug 29  2017 ._madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin  3728292 Aug 29  2017 madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin     1362 Aug 29  2017 ._open_source_license_MADlib_1.12_GA.txt

-rw-r--r-- 1 gpadmin gpadmin   135530 Aug 29  2017 open_source_license_MADlib_1.12_GA.txt

-rw-r--r-- 1 gpadmin gpadmin 39640735 Aug  8 07:51 plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin      594 Aug 29  2017 ._ReleaseNotes.txt

-rw-r--r-- 1 gpadmin gpadmin    51900 Aug 29  2017 ReleaseNotes.txt

 



 

3-4. PL/R 설치



-bash-4.1$ gppkg -i plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

20180808:07:53:41:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Starting gppkg with args: -i plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

20180808:07:53:42:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing package plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

20180808:07:53:42:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/R-3.3.3-1.x86_64.rpm /usr/local/greenplum-db-4.3.7.1/.tmp/plr-2.3-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:07:53:42:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg locally

20180808:07:53:42:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/R-3.3.3-1.x86_64.rpm /usr/local/greenplum-db-4.3.7.1/.tmp/plr-2.3-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:07:53:42:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing rpms cmdStr='rpm -i /usr/local/greenplum-db-4.3.7.1/.tmp/R-3.3.3-1.x86_64.rpm /usr/local/greenplum-db-4.3.7.1/.tmp/plr-2.3-1.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix=/usr/local/greenplum-db-4.3.7.1'

20180808:07:53:45:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Completed local installation of plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg.

20180808:07:53:45:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:--

==========================================================================

PL/R installation is complete! To proceed, follow these steps:

1. Source your new $GPHOME/greenplum_path.sh file and restart the database.

2. Create PL/R language in the target database with "createlang plr -d mydatabase"

3. Optionally you can enable PL/R helper functions in this database by running

    "psql -f $GPHOME/share/postgresql/contrib/plr.sql -d mydatabase"

==========================================================================

20180808:07:53:45:006779 gppkg:4e6b947be0d6:gpadmin-[INFO]:-plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg successfully installed.

 




3-5. GPDB stop
 



-bash-4.1$ gpstop -af

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Starting gpstop with args: -af

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Gathering information and validating the environment...

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Segment details from master...

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.7.1 build 1'

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-There are 2 connections to the database

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast'

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Master host=72ba20be3774

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Detected 2 connections to database

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Switching to WAIT mode

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Will wait for shutdown to complete, this may take some time if

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-there are a large number of active complex transactions, please wait...

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=fast

20180808:07:54:30:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Master segment instance directory=/gpdata/master/gpseg-1

20180808:07:54:31:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process

20180808:07:54:31:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Terminating processes for segment /gpdata/master/gpseg-1

20180808:07:54:31:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No standby master host configured

20180808:07:54:31:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...

20180808:07:54:31:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-0.00% of jobs completed

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-100.00% of jobs completed

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-   Segments stopped successfully      = 2

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-   Segments with errors during stop   = 0

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Successfully shutdown 2 of 2 segment instances

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Database successfully shutdown with no errors reported

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover gpmmon process

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No leftover gpmmon process found

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts

20180808:07:54:41:006833 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover shared memory

 




3-6.
Source your new $GPHOME/greenplum_path.sh file 



-bash-4.1$ vi ~/.bash_profile

-bash-4.1$ source ~/.bash_profile

-bash-4.1$ env | grep R

MASTER_DATA_DIRECTORY=/gpdata/master/gpseg-1

TERM=xterm

USER=gpadmin

LD_LIBRARY_PATH=/usr/local/greenplum-db/./ext/R-3.3.3/lib:/usr/local/greenplum-db/./ext/R-3.3.3/extlib:

/usr/local/greenplum-db/./lib:

/usr/local/greenplum-db/./ext/python/lib:/usr/local/greenplum-db/./lib:/usr/local/greenplum-db/./ext/python/lib:

LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:

su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:

*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:

*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:

*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:

*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:

*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:

*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:

*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:

*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:

*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:

*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:

PATH=/usr/local/greenplum-db/./ext/R-3.3.3/bin:/usr/local/greenplum-db/./bin:/usr/local/greenplum-db/./ext/python/bin:/usr/local/greenplum-db/./bin:/usr/local/greenplum-db/./ext/python/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

HISTCONTROL=ignoredups

R_HOME=/usr/local/greenplum-db/./ext/R-3.3.3

G_BROKEN_FILENAMES=1

 




3-7.
Create PL/R language in the target database with "createlang plr -d mydatabase" and restart the database. 



-bash-4.1$ createlang plr -d gpadmin

createlang: could not connect to database gpadmin: could not connect to server: No such file or directory

         Is the server running locally and accepting

         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

 

-bash-4.1$ gpstart -a

20180808:07:56:17:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting gpstart with args: -a

20180808:07:56:17:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Gathering information and validating the environment...

20180808:07:56:17:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.7.1 build 1'

20180808:07:56:17:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150'

20180808:07:56:17:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting Master instance in admin mode

20180808:07:56:18:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information

20180808:07:56:18:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Segment details from master...

20180808:07:56:18:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Setting new master era

20180808:07:56:18:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Master Started...

20180808:07:56:18:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Shutting down master

20180808:07:56:19:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...

..

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Process results...

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Successful segment starts                                            = 2

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Failed segment starts                                                = 0

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Successfully started 2 of 2 segment instances

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:07:56:21:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting Master instance 72ba20be3774 directory /gpdata/master/gpseg-1

20180808:07:56:22:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Command pg_ctl reports Master 72ba20be3774 instance active

20180808:07:56:23:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-No standby master configured.  skipping...

20180808:07:56:23:006995 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Database successfully started

 

-bash-4.1$ psql -f $GPHOME/share/postgresql/contrib/plr.sql -d gpadmin

SET

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

REVOKE

CREATE FUNCTION

 

-bash-4.1$ exit

logout

 



 

4. DataSciencePython(PL/Python), DataScienceR 설치하기

 

4-1. Pivotal Network에서 PL/Python 다운로드 하기

Pivotal Greenplum Releases: 4.3.18.0 카테고리에서

>> Greenplum Procedural Languages

>> Python Data Science Package for RHEL 6다운로드

>> R Data Science Package for RHEL 6 다운로드

(https://network.pivotal.io/products/pivotal-gpdb/#/releases/8538/file_groups/768)

 


4-2. (다른 터미널에서) Docker GPDB로 파일 복사하기



ihongdon-ui-MacBook-Pro:Downloads ihongdon$ ls -la

total 549520

-rw-r--r--@  1 ihongdon  staff  103557483  8  8 16:58 DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg

-rw-r--r--@  1 ihongdon  staff  114736878  8  8 16:58 DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg

-rw-r--r--@  1 ihongdon  staff    3788987  8  8 14:10 madlib-1.12-gp4.3-rhel5-x86_64.tar.gz

-rw-r--r--@  1 ihongdon  staff   39640735  8  8 16:51 plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

 

ihongdon-ui-MacBook-Pro:Downloads ihongdon$ docker cp DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg gpdb:/setup

ihongdon-ui-MacBook-Pro:Downloads ihongdon$ docker cp DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg gpdb:/setup

 




4-3. (Docker
터미널에서) 권한 부여 및 gpadmin 들어가기 



[root@4e6b947be0d6 setup]# chown gpadmin:gpadmin *.gppkg

[root@4e6b947be0d6 setup]# su - gpadmin

-bash-4.1$ ls

gpAdminLogs

-bash-4.1$ cd  /setup

-bash-4.1$ ls

DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg 

madlib-1.12-gp4.3-rhel5-x86_64.tar                     

open_source_license_MADlib_1.12_GA.txt 

ReleaseNotes.txt

DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg      

madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg 

plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

 

-bash-4.1$ ls -la

total 259584

drwxr-xr-x 2 gpadmin gpadmin      4096 Aug  8 07:59 .

drwxr-xr-x 1 root    root         4096 Aug  8 07:44 ..

-rw-r--r-- 1 gpadmin gpadmin 103557483 Aug  8 07:58 DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin 114736878 Aug  8 07:58 DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin   3932160 Aug  8 05:10 madlib-1.12-gp4.3-rhel5-x86_64.tar

-rw-r--r-- 1 gpadmin gpadmin       566 Aug 29  2017 ._madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin   3728292 Aug 29  2017 madlib-ossv1.12_pv1.9.9_gpdb4.3orca-rhel5-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin      1362 Aug 29  2017 ._open_source_license_MADlib_1.12_GA.txt

-rw-r--r-- 1 gpadmin gpadmin    135530 Aug 29  2017 open_source_license_MADlib_1.12_GA.txt

-rw-r--r-- 1 gpadmin gpadmin  39640735 Aug  8 07:51 plr-2.3.1-GPDB4.3-rhel6-x86_64.gppkg

-rw-r--r-- 1 gpadmin gpadmin       594 Aug 29  2017 ._ReleaseNotes.txt

-rw-r--r-- 1 gpadmin gpadmin     51900 Aug 29  2017 ReleaseNotes.txt

 




4-4. DataSciencePython
설치하기 



-bash-4.1$ gppkg -i DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:00:58:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Starting gppkg with args: -i DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:00:59:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing package DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:00:59:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataSciencePython-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:08:00:59:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-SQLITE3 Installed

20180808:08:01:00:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-TK Not installed

20180808:08:01:00:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-TCL Not installed

20180808:08:01:00:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg locally

20180808:08:01:00:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataSciencePython-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:08:01:01:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing rpms cmdStr='rpm -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataSciencePython-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix=/usr/local/greenplum-db-4.3.7.1'

20180808:08:01:14:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Completed local installation of DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg.

20180808:08:01:14:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Please source your $GPHOME/greenplum_path.sh file and restart the database.

20180808:08:01:14:007333 gppkg:4e6b947be0d6:gpadmin-[INFO]:-DataSciencePython-1.0.0-gp4-rhel6-x86_64.gppkg successfully installed.

 




4-5. DataScienceR
설치하기 



-bash-4.1$ gppkg -i DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:01:48:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Starting gppkg with args: -i DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:01:48:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing package DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg

20180808:08:01:49:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataScienceR-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:08:01:49:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg locally

20180808:08:01:50:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Validating rpm installation cmdStr='rpm --test -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataScienceR-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix /usr/local/greenplum-db-4.3.7.1'

20180808:08:01:50:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Installing rpms cmdStr='rpm -i /usr/local/greenplum-db-4.3.7.1/.tmp/DataScienceR-1.0-0.x86_64.rpm --dbpath /usr/local/greenplum-db-4.3.7.1/share/packages/database --prefix=/usr/local/greenplum-db-4.3.7.1'

20180808:08:02:05:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Completed local installation of DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg.

20180808:08:02:05:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-Please source your $GPHOME/greenplum_path.sh file and restart the database.

20180808:08:02:05:007393 gppkg:4e6b947be0d6:gpadmin-[INFO]:-DataScienceR-1.0.0-gp4-rhel6-x86_64.gppkg successfully installed.

 




4-6. source path
설정 


-bash-4.1$ source $GPHOME/greenplum_path.sh




4-7. GPDB stop
 



-bash-4.1$ gpstop -af

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Starting gpstop with args: -af

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Gathering information and validating the environment...

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Segment details from master...

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.7.1 build 1'

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-There are 0 connections to the database

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast'

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Master host=72ba20be3774

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Detected 0 connections to database

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Using standard WAIT mode of 120 seconds

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=fast

20180808:08:02:18:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Master segment instance directory=/gpdata/master/gpseg-1

20180808:08:02:19:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process

20180808:08:02:20:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Terminating processes for segment /gpdata/master/gpseg-1

20180808:08:02:20:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No standby master host configured

20180808:08:02:20:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...

20180808:08:02:20:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-0.00% of jobs completed

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-100.00% of jobs completed

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-   Segments stopped successfully      = 2

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-   Segments with errors during stop   = 0

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Successfully shutdown 2 of 2 segment instances

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Database successfully shutdown with no errors reported

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover gpmmon process

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No leftover gpmmon process found

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts

20180808:08:02:30:007430 gpstop:4e6b947be0d6:gpadmin-[INFO]:-Cleaning up leftover shared memory

 




4-8. GPDB restart
 



-bash-4.1$ gpstart -a

20180808:08:02:39:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting gpstart with args: -a

20180808:08:02:39:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Gathering information and validating the environment...

20180808:08:02:39:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.7.1 build 1'

20180808:08:02:39:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150'

20180808:08:02:39:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting Master instance in admin mode

20180808:08:02:40:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information

20180808:08:02:40:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Obtaining Segment details from master...

20180808:08:02:40:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Setting new master era

20180808:08:02:40:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Master Started...

20180808:08:02:40:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Shutting down master

20180808:08:02:42:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...

..

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Process results...

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Successful segment starts                                            = 2

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Failed segment starts                                                = 0

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Successfully started 2 of 2 segment instances

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-----------------------------------------------------

20180808:08:02:44:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Starting Master instance 72ba20be3774 directory /gpdata/master/gpseg-1

20180808:08:02:45:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Command pg_ctl reports Master 72ba20be3774 instance active

20180808:08:02:45:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-No standby master configured.  skipping...

20180808:08:02:45:007584 gpstart:4e6b947be0d6:gpadmin-[INFO]:-Database successfully started

-bash-4.1$

-bash-4.1$

 



 

5. Docker 이미지 만들고, Docker Hub에 올리기

 

5-1. Docker 이미지 만들고, 생성 여부 확인하기



 # Docker 이미지 만들기 : $ docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]]


ihongdon-ui-MacBook-Pro:~ ihongdon$ docker commit \

-a "pivotal-data-science-holee" \

-m "GPDB 4.37 with MADlib, PL/R, PL/Python" \

gpdb \

gpdb-analytics:first

sha256:c1450e5e5a58f0518ce747a408846968b3a8d2746e6a147c1a3d8ce2910dfff1

ihongdon-ui-MacBook-Pro:~ ihongdon$

ihongdon-ui-MacBook-Pro:~ ihongdon$ docker images

REPOSITORY                         TAG                 IMAGE ID            CREATED             SIZE

gpdb-analytics                     first               c1450e5e5a58        3 minutes ago       2.83GB

centos                             7                   d123f4e55e12        9 months ago        197MB

pivotaldata/gpdb-base              latest              bfe4e63b8e81        2 years ago         1.17GB

ihongdon-ui-MacBook-Pro:~ ihongdon$

 


 

 

5-2. Docker ImageTag 추가 후 Docker Hub에 올리기(push)



 # Tag 추가 : $ docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]


ihongdon-ui-MacBook-Pro:~ ihongdon$ docker tag gpdb-analytics:first hdlee2u/gpdb-analytics:latest

ihongdon-ui-MacBook-Pro:~ ihongdon$

ihongdon-ui-MacBook-Pro:~ ihongdon$ docker images

REPOSITORY                         TAG                 IMAGE ID            CREATED             SIZE

hdlee2u/gpdb-analytics             latest               c1450e5e5a58        About an hour ago   2.83GB

gpdb-analytics                     first               c1450e5e5a58        About an hour ago   2.83GB

centos                             7                   d123f4e55e12        9 months ago        197MB

pivotaldata/gpdb-base              latest              bfe4e63b8e81        2 years ago         1.17GB

 

# Docker Hub 로그인

ihongdon-ui-MacBook-Pro:~ ihongdon$ docker login

Authenticating with existing credentials...

Login Succeeded

 



 # Docker Hub에 도커 이미지 올리기 : $ docker push [OPTIONS] NAME[:TAG]


ihongdon-ui-MacBook-Pro:~ ihongdon$ docker push hdlee2u/gpdb-analytics:latest

The push refers to repository [docker.io/hdlee2u/gpdb-analytics]

e603ef714b8e: Pushing [========>                                          ]  275.1MB/1.663GB

8c65eead2327: Mounted from hdlee2u/gpdb-base

516e5ab465c7: Mounted from hdlee2u/gpdb-base

5f70bf18a086: Mounted from hdlee2u/gpdb-base

69bd93b9db4e: Mounted from hdlee2u/gpdb-base





[ https://hub.docker.com/r/hdlee2u/gpdb-analytics/ 에 gpdb-analytics 도커 이미지 올라간 모습 ]




다음번 포스팅에서는 Docker Hub에서 gpdb-ds 도커 이미지를 내려 받아서 사용할 수 있는 방법에 대해서 소개하겠습니다. 


많은 도움이 되었기를 바랍니다. 



728x90
반응형
Posted by Rfriend
,