greenplum集群安装

一、环境配置

1、地址分配

192.168.1.201 mdw master
192.168.1.202 sdw1 segment1
192.168.1.203 sdw2 segment2

2、创建用户及用户组

$ groupadd -g  gpadmin
$ useradd gpadmin -u  -g gpadmin
$ passwd gpadmin

3、系统配置

  • 在/etc/sysctl.conf 文件中加入有关共享内存与网络参数配置;执行 sysctl -p;使之生效
kernel.shmmax =
kernel.shmmni =
kernel.shmall =
kernel.sem =
kernel.sysrq =
kernel.core_uses_pid =
kernel.msgmnb =
kernel.msgmax =
kernel.msgmni =
net.ipv4.tcp_syncookies =
net.ipv4.ip_forward =
net.ipv4.conf.
net.ipv4.tcp_tw_recycle =
net.ipv4.tcp_max_syn_backlog =
net.ipv4.conf.all.arp_filter =
net.ipv4.ip_local_port_range =
net.core.netdev_max_backlog =
net.core.rmem_max =
net.core.wmem_max =
vm.overcommit_memory =  
  • 在/etc/security/limits.conf 中加入限制参数
* soft nofile
* hard nofile
* soft nproc
* hard nproc 
  • 编辑设备块大小
[root@localhost block]# blockdev --setra  /dev/sda
[root@localhost block]# blockdev --getra /dev/sda
[root@localhost block]#  more  /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
[root@localhost block]# echo deadline > /sys/block/sda/queue/scheduler
[root@localhost block]#  more  /sys/block/sda/queue/scheduler
noop anticipatory [deadline] cfq 

二、安装

1、安装数据库软件

软件下载地址:https://network.pivotal.io/products/pivotal-gpdb

[root@mdw software]# unzip greenplum-db--RHEL5-x86_64.zip
[root@localhost software]# ./greenplum-db--RHEL5-x86_64.bin
********************************************************************************
Do you accept the Pivotal Database license agreement? [yes|no]
********************************************************************************

yes

********************************************************************************
Provide the installation path for Greenplum Database or press ENTER to
accept the default installation path: /usr/local/greenplum-db-4.3.8.1
********************************************************************************

/usr/local/greenplum-db438

********************************************************************************
Install Greenplum Database into </usr/local/greenplum-db438>? [yes|no]
********************************************************************************

yes

********************************************************************************
/usr/local/greenplum-db438 does not exist.
Create /usr/local/greenplum-db438 ? [yes|no]
(Selecting no will exit the installer)
********************************************************************************

yes

Extracting product to /usr/local/greenplum-db438

********************************************************************************
Installation complete.
Greenplum Database is installed in /usr/local/greenplum-db438

Pivotal Greenplum documentation is available
for download at http://docs.gopivotal.com/gpdb
********************************************************************************

进入安装目录下cd /usr/local/greenplum;配置环境变量vi .bashrc

export GPHOME=/usr/local/greenplum-db438export PYTHONHOME="$GPHOME/ext/python"export PYTHONPATH=$GPHOME/lib/pythonexport PATH=$GPHOME/bin:$PYTHONHOME/bin:$PATHexport LD_LIBRARY_PATH=$GPHOME/lib:$PYTHONHOME/lib:$LD_LIBRARY_PATHexport OPENSSL_CONF=$GPHOME/etc/openssl.cnf

2、配置hostlist文件

[gpadmin@mdw config]$ cat hostlist
mdw
sdw1
sdw2
[gpadmin@mdw config]$ cat seg_hosts
sdw1
sdw2

3、使用gpssh-exkeys打通所有服务器;

[gpadmin@localhost conf]$ gpssh-exkeys -f hostlist
[STEP  of ] create local ID and authorize on local host
  ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped

[STEP  of ] keyscan all hosts and update known_hosts file

[STEP  of ] authorize current user on remote hosts
  ... send to mdw
  ... send to sdw1
  ***
  *** Enter password for sdw1:
  ... send to sdw2

[STEP  of ] determine common authentication file content

[STEP  of ] copy authentication files to all remote hosts
  ... finished key exchange with mdw
  ... finished key exchange with sdw1
  ... finished key exchange with sdw2

[INFO] completed successfully

4、安装到各个机器上

【注意;2-4步骤可以直接在root用户下操作;可以避免一些问题;见FAQ】;当然这步可以手动操作;
[root@localhost greenplum]# gpseginstall -f /home/gpadmin/conf/hostlist  -u gpadmin -p li0924
:::: gpseginstall:localhost:root-[INFO]:-Installation Info:
link_name greenplum-db
binary_path /usr/local/greenplum
binary_dir_location /usr/local
binary_dir_name greenplum
:::: gpseginstall:localhost:root-[INFO]:-check cluster password access
  *** Enter password for mdw:
:::: gpseginstall:localhost:root-[INFO]:-de-duplicate hostnames
:::: gpseginstall:localhost:root-[INFO]:-master hostname: localhost.localdomain
:::: gpseginstall:localhost:root-[INFO]:-check for user gpadmin on cluster
:::: gpseginstall:localhost:root-[INFO]:-add user gpadmin on master
:::: gpseginstall:localhost:root-[INFO]:-add user gpadmin on cluster
:::: gpseginstall:localhost:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum-db
:::: gpseginstall:localhost:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum
:::: gpseginstall:localhost:root-[INFO]:-rm -f /usr/local/greenplum.tar; rm -f /usr/local/greenplum.tar.gz
:::: gpseginstall:localhost:root-[INFO]:-cd /usr/local; tar cf greenplum.tar greenplum
:::: gpseginstall:localhost:root-[INFO]:-gzip /usr/local/greenplum.tar
:::: gpseginstall:localhost:root-[INFO]:-remote command: mkdir -p /usr/local
:::: gpseginstall:localhost:root-[INFO]:-remote command: rm -rf /usr/local/greenplum
:::: gpseginstall:localhost:root-[INFO]:-scp software to remote location
:::: gpseginstall:localhost:root-[INFO]:-remote command: gzip -f -d /usr/local/greenplum.tar.gz
:::: gpseginstall:localhost:root-[INFO]:-md5 check on remote location
:::: gpseginstall:localhost:root-[INFO]:-remote command: cd /usr/local; tar xf greenplum.tar
:::: gpseginstall:localhost:root-[INFO]:-remote command: rm -f /usr/local/greenplum.tar
:::: gpseginstall:localhost:root-[INFO]:-remote command: cd /usr/local; rm -f greenplum-db; ln -fs greenplum greenplum-db
:::: gpseginstall:localhost:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum-db
:::: gpseginstall:localhost:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum
:::: gpseginstall:localhost:root-[INFO]:-rm -f /usr/local/greenplum.tar.gz
:::: gpseginstall:localhost:root-[INFO]:-Changing system passwords ...
:::: gpseginstall:localhost:root-[INFO]:-exchange ssh keys for user root
:::: gpseginstall:localhost:root-[INFO]:-exchange ssh keys for user gpadmin
:::: gpseginstall:localhost:root-[INFO]:-/usr/local/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin
:::: gpseginstall:localhost:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin
:::: gpseginstall:localhost:root-[INFO]:-version
:::: gpseginstall:localhost:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./bin/gpssh --version
:::: gpseginstall:localhost:root-[INFO]:-remote command: . /usr/local/greenplum/greenplum_path.sh; /usr/local/greenplum/bin/gpssh --version
:::: gpseginstall:localhost:root-[INFO]:-SUCCESS -- Requested commands completed

5、创建目录;在每个节点;

#mdw
[gpadmin@localhost ~]$ mkdir -p /home/gpadmin/gpdata/pgmaster

#sdw1 sdw2
[gpadmin@localhost ~]$ mkdir -p /home/gpadmin/gpdata/gpdatap
[gpadmin@localhost ~]$ mkdir -p /home/gpadmin/gpdata/gpdatam

6. 参数监测;还有网络/io监测;

gpadmin@localhost ~]$ gpcheck -f /home/gpadmin/conf/hostlist -m mdw -s sdw1
:::: gpcheck:localhost:gpadmin-[INFO]:-dedupe hostnames
:::: gpcheck:localhost:gpadmin-[INFO]:-Detected platform: Generic Linux Cluster
:::: gpcheck:localhost:gpadmin-[INFO]:-generate data on servers
:::: gpcheck:localhost:gpadmin-[INFO]:-copy data files from servers
:::: gpcheck:localhost:gpadmin-[INFO]:-delete remote tmp files
:::: gpcheck:localhost:gpadmin-[INFO]:-Using gpcheck config file: /usr/local/greenplum/etc/gpcheck.cnf
:::: gpcheck:localhost:gpadmin-[ERROR]:-GPCHECK_ERROR host(None): utility will not check all settings when run as non-root user
:::: gpcheck:localhost:gpadmin-[INFO]:-gpcheck completing...

三、初始化Greenplum

1、初始配置

[gpadmin@localhost ~]$ cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config config/gpinitsystem_config
[gpadmin@localhost ~]$ chmod  gpinitsystem_config

但是我这配置文件如下:

#数据库代号
ARRAY_NAME="EMC Greenplum DW"

MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts

#Segment的名称前缀
SEG_PREFIX=gpseg

#primary segment起始端口号
PORT_BASE=

#指定primary segment的数据目录
declare -a DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatap)

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/home/gpadmin/gpdata/gpmaster

MASTER_PORT=

#指定bash的版本
TRUSTED_SHELL=ssh

#指定编码
ENCODING=UTF8

CHECK_POINT_SEGMENTS=

#mirror segment起始端口号
MIRROR_PORT_BASE=

#primary segment主备同步的起始端口号
REPLICATION_PORT_BASE=

#mirror segment主备同步的起始端口号
MIRROR_REPLICATION_PORT_BASE=

#mirror segment的数据目录
declare -a MIRROR_DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatam)

执行初始化命令  

# -s sdw2 表示standby master指定的主机位置是sdw2
[gpadmin@mdw config]$ gpinitsystem -c gpinitsystem_config -h seg_hosts
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file gpinitsystem_config
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in gpinitsystem_config, will set to default value
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
:::: gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for standard array
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
..
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
..
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
....
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database Creation Parameters
:::: gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master Configuration
:::: gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master instance name       = EMC Greenplum DW
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master hostname            = mdw
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master port                =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master instance dir        = /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master Database            =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master connections         =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master buffers             = 128000kB
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Segment connections        =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Segment buffers            = 128000kB
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Checkpoint segments        =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Encoding                   = UTF8
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Postgres param file        = Off
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Initdb to be used          = /usr/local/greenplum-db438/bin/initdb
:::: gpinitsystem:mdw:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /usr/local/greenplum-db438/lib
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Ulimit check               = Passed
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address []      = ::
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address []      = 192.168.1.201
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address []      = fe80::20c:29ff:feee:
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master             = Not Configured
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Primary segment #          =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total Database segments    =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Trusted shell              = ssh
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Number segment hosts       =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Mirror port
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Replicaton port
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Mirror replicaton port
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Mirror segment #           =
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring config           = ON
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring type             = Group
:::: gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
:::: gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  /home/gpadmin/gpdata/gpdatap/gpseg0
:::: gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  /home/gpadmin/gpdata/gpdatap/gpseg1
:::: gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
:::: gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  /home/gpadmin/gpdata/gpdatam/gpseg0
:::: gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  /home/gpadmin/gpdata/gpdatam/gpseg1
Continue with Greenplum creation Yy/Nn>
y
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Building the Master instance database, please wait...
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Starting the Master in admin mode
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [], please wait...
..
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Waiting ], please wait...
.......................................................................................
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [], please wait...
..
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Waiting ], please wait...
............................
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked
:::: gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Deleting distributed backout files
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Removing back out file
:::: gpinitsystem:mdw:gpadmin-[INFO]:-No errors generated from parallel processes
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode
:::: gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a -i -m -d /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
:::: gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
:::: gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
:::: gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.8.1 build 1'
:::: gpstop:mdw:gpadmin-[INFO]:-There are  connections to the database
:::: gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='immediate'
:::: gpstop:mdw:gpadmin-[INFO]:-Master host=mdw
:::: gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=immediate
:::: gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
:::: gpstop:mdw:gpadmin-[INFO]:-Terminating processes
:::: gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a -d /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
:::: gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.8.1 build 1'
:::: gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '
:::: gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
:::: gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
:::: gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
:::: gpstart:mdw:gpadmin-[INFO]:-Setting new master era
:::: gpstart:mdw:gpadmin-[INFO]:-Master Started...
:::: gpstart:mdw:gpadmin-[INFO]:-Shutting down master
:::: gpstart:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
................
:::: gpstart:mdw:gpadmin-[INFO]:-Process results...
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            =
:::: gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                =
:::: gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-
:::: gpstart:mdw:gpadmin-[INFO]:-Successfully started  of  segment instances
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
:::: gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
:::: gpstart:mdw:gpadmin-[INFO]:-Database successfully started
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Loading gp_toolkit...
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Scanning utility log file for any warning messages
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Log file scan check passed
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database instance successfully created
:::: gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-To complete the environment configuration, please
:::: gpinitsystem:mdw:gpadmin-[INFO]:-update gpadmin .bashrc file with the following
:::: gpinitsystem:mdw:gpadmin-[INFO]:-. Ensure that the greenplum_path.sh file is sourced
:::: gpinitsystem:mdw:gpadmin-[INFO]:-. Add "export MASTER_DATA_DIRECTORY=/home/gpadmin/gpdata/pgmaster/gpseg-1"
:::: gpinitsystem:mdw:gpadmin-[INFO]:-   to access the Greenplum scripts for this instance:
:::: gpinitsystem:mdw:gpadmin-[INFO]:-   or, use -d /home/gpadmin/gpdata/pgmaster/gpseg- option for the Greenplum scripts
:::: gpinitsystem:mdw:gpadmin-[INFO]:-   Example gpstate -d /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20160712.log
:::: gpinitsystem:mdw:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility
:::: gpinitsystem:mdw:gpadmin-[INFO]:-To initialize a Standby Master Segment for this Greenplum instance
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Review options for gpinitstandby
:::: gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
:::: gpinitsystem:mdw:gpadmin-[INFO]:-The Master /home/gpadmin/gpdata/pgmaster/gpseg-/pg_hba.conf post gpinitsystem
:::: gpinitsystem:mdw:gpadmin-[INFO]:-has been configured to allow all hosts within this new
:::: gpinitsystem:mdw:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this
:::: gpinitsystem:mdw:gpadmin-[INFO]:-new array must be explicitly added to this file
:::: gpinitsystem:mdw:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is
:::: gpinitsystem:mdw:gpadmin-[INFO]:-located in the /usr/local/greenplum-db438/docs directory
:::: gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------

启动数据库

[gpadmin@mdw ~]$ gpstart
:::: gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args:
:::: gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
:::: gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.8.1 build 1'
:::: gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '
:::: gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
:::: gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
:::: gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
:::: gpstart:mdw:gpadmin-[INFO]:-Setting new master era
:::: gpstart:mdw:gpadmin-[INFO]:-Master Started...
:::: gpstart:mdw:gpadmin-[INFO]:-Shutting down master
:::: gpstart:mdw:gpadmin-[INFO]:---------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-Master instance parameters
:::: gpstart:mdw:gpadmin-[INFO]:---------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-Database                 = template1
:::: gpstart:mdw:gpadmin-[INFO]:-Master Port              =
:::: gpstart:mdw:gpadmin-[INFO]:-Master directory         = /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstart:mdw:gpadmin-[INFO]:-Timeout                  =  seconds
:::: gpstart:mdw:gpadmin-[INFO]:-Master standby           = Off
:::: gpstart:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-Segment instances that will be started
:::: gpstart:mdw:gpadmin-[INFO]:---------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-   Host   Datadir                               Port    Role
:::: gpstart:mdw:gpadmin-[INFO]:-   sdw1   /home/gpadmin/gpdata/gpdatap/gpseg0      Primary
:::: gpstart:mdw:gpadmin-[INFO]:-   sdw2   /home/gpadmin/gpdata/gpdatam/gpseg0      Mirror
:::: gpstart:mdw:gpadmin-[INFO]:-   sdw2   /home/gpadmin/gpdata/gpdatap/gpseg1      Primary
:::: gpstart:mdw:gpadmin-[INFO]:-   sdw1   /home/gpadmin/gpdata/gpdatam/gpseg1      Mirror

Continue with Greenplum instance startup Yy|Nn (default=N):
> y
:::: gpstart:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
............
:::: gpstart:mdw:gpadmin-[INFO]:-Process results...
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            =
:::: gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                =
:::: gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-
:::: gpstart:mdw:gpadmin-[INFO]:-Successfully started  of  segment instances
:::: gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
:::: gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /home/gpadmin/gpdata/pgmaster/gpseg-
:::: gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
:::: gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
:::: gpstart:mdw:gpadmin-[INFO]:-Database successfully started

查看数据启动状态

[gpadmin@mdw ~]$ gpstate -m
:::: gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -m
:::: gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.3.8.1 build 1'
:::: gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.3.8.1 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Apr 20 2016 08:08:56'
:::: gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
:::: gpstate:mdw:gpadmin-[INFO]:--------------------------------------------------------------
:::: gpstate:mdw:gpadmin-[INFO]:--Current GPDB mirror list and status
:::: gpstate:mdw:gpadmin-[INFO]:--Type = Spread
:::: gpstate:mdw:gpadmin-[INFO]:--------------------------------------------------------------
:::: gpstate:mdw:gpadmin-[INFO]:-   Mirror   Datadir                               Port    Status    Data Status
:::: gpstate:mdw:gpadmin-[INFO]:-   sdw2     /home/gpadmin/gpdata/gpdatam/gpseg0      Passive   Synchronized
:::: gpstate:mdw:gpadmin-[INFO]:-   sdw1     /home/gpadmin/gpdata/gpdatam/gpseg1      Passive   Synchronized
 
【FAQ】
1. 在执行“gpssh-exkeys -f hostlist”配置免密码登录时出现“[ERROR] ssl-keygen failed:”
 解决方案: 执行   unset OPENSSL_CONF ;在执行命令可以避免
 
2. 执行“ gpseginstall -f /home/gpadmin/config/hostlist  -u gpadmin -p li0924”结果失败;
分析:查看日志信息是“tar cf greenplum-db438.tar greenplum-db438”这步出错;很明显是没权限执行;前面有提示
解决方案:用root用户执行;或者直接手动去操作;这步骤就是把该目录复制到各个segment节点;避免在segement再进行安装
上一篇:day01-02--数据库概念介绍


下一篇:PHP如何关闭notice级别的错误提示