码迷,mamicode.com
首页 > 其他好文 > 详细

greenplum集群安装

时间:2016-07-12 12:04:48      阅读:290      评论:0      收藏:0      [点我收藏+]

标签:

一、环境配置

1、地址分配

192.168.1.201 mdw master
192.168.1.202 sdw1 segment1
192.168.1.203 sdw2 segment2

2、创建用户及用户组

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

3、系统配置

  • 在/etc/sysctl.conf 文件中加入有关共享内存与网络参数配置;执行 sysctl -p;使之生效
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 512000 100 2048
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 1
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.conf.all.arp_filter = 1
net.ipv4.ip_local_port_range = 1025 65535
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.overcommit_memory = 2 
  • 在/etc/security/limits.conf 中加入限制参数
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
  • 编辑设备块大小
[root@localhost block]# blockdev --setra 16384 /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-4.3.8.1-build-1-RHEL5-x86_64.zip
[root@localhost software]# ./greenplum-db-4.3.8.1-build-1-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-db438
export PYTHONHOME="$GPHOME/ext/python"
export PYTHONPATH=$GPHOME/lib/python
export PATH=$GPHOME/bin:$PYTHONHOME/bin:$PATH
export LD_LIBRARY_PATH=$GPHOME/lib:$PYTHONHOME/lib:$LD_LIBRARY_PATH
export 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 1 of 5] create local ID and authorize on local host
  ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped

[STEP 2 of 5] keyscan all hosts and update known_hosts file

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

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] 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
20160708:18:57:52:005422 gpseginstall:localhost:root-[INFO]:-Installation Info:
link_name greenplum-db
binary_path /usr/local/greenplum
binary_dir_location /usr/local
binary_dir_name greenplum
20160708:18:57:52:005422 gpseginstall:localhost:root-[INFO]:-check cluster password access
  *** Enter password for mdw: 
20160708:18:58:11:005422 gpseginstall:localhost:root-[INFO]:-de-duplicate hostnames
20160708:18:58:11:005422 gpseginstall:localhost:root-[INFO]:-master hostname: localhost.localdomain
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-check for user gpadmin on cluster
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-add user gpadmin on master
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-add user gpadmin on cluster
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum-db
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-chown -R gpadmin:gpadmin /usr/local/greenplum
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-rm -f /usr/local/greenplum.tar; rm -f /usr/local/greenplum.tar.gz
20160708:18:58:12:005422 gpseginstall:localhost:root-[INFO]:-cd /usr/local; tar cf greenplum.tar greenplum
20160708:18:59:12:005422 gpseginstall:localhost:root-[INFO]:-gzip /usr/local/greenplum.tar
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: mkdir -p /usr/local
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: rm -rf /usr/local/greenplum
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-scp software to remote location
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: gzip -f -d /usr/local/greenplum.tar.gz
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-md5 check on remote location
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: cd /usr/local; tar xf greenplum.tar
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: rm -f /usr/local/greenplum.tar
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: cd /usr/local; rm -f greenplum-db; ln -fs greenplum greenplum-db
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum-db
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-remote command: chown -R gpadmin:gpadmin /usr/local/greenplum
20160708:19:01:05:005422 gpseginstall:localhost:root-[INFO]:-rm -f /usr/local/greenplum.tar.gz
20160708:19:01:06:005422 gpseginstall:localhost:root-[INFO]:-Changing system passwords ...
20160708:19:01:07:005422 gpseginstall:localhost:root-[INFO]:-exchange ssh keys for user root
20160708:19:01:09:005422 gpseginstall:localhost:root-[INFO]:-exchange ssh keys for user gpadmin
20160708:19:01:17:005422 gpseginstall:localhost:root-[INFO]:-/usr/local/greenplum-db/./sbin/gpfixuserlimts -f /etc/security/limits.conf -u gpadmin
20160708:19:01:18:005422 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
20160708:19:01:18:005422 gpseginstall:localhost:root-[INFO]:-version string on master: gpssh version 4.3.5.2 build 1
20160708:19:01:18:005422 gpseginstall:localhost:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./bin/gpssh --version
20160708:19:01:18:005422 gpseginstall:localhost:root-[INFO]:-remote command: . /usr/local/greenplum/greenplum_path.sh; /usr/local/greenplum/bin/gpssh --version
20160708:19:01:23:005422 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
20160708:22:52:41:007324 gpcheck:localhost:gpadmin-[INFO]:-dedupe hostnames
20160708:22:52:42:007324 gpcheck:localhost:gpadmin-[INFO]:-Detected platform: Generic Linux Cluster
20160708:22:52:42:007324 gpcheck:localhost:gpadmin-[INFO]:-generate data on servers
20160708:22:52:44:007324 gpcheck:localhost:gpadmin-[INFO]:-copy data files from servers
20160708:22:52:44:007324 gpcheck:localhost:gpadmin-[INFO]:-delete remote tmp files
20160708:22:52:45:007324 gpcheck:localhost:gpadmin-[INFO]:-Using gpcheck config file: /usr/local/greenplum/etc/gpcheck.cnf
20160708:22:52:45:007324 gpcheck:localhost:gpadmin-[ERROR]:-GPCHECK_ERROR host(None): utility will not check all settings when run as non-root user
20160708:22:52:45:007324 gpcheck:localhost:gpadmin-[INFO]:-gpcheck completing...

三、初始化Greenplum

1、初始配置

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

但是我这配置文件如下:

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

MACHINE_LIST_FILE=/home/gpadmin/conf/seg_hosts

#Segment的名称前缀
SEG_PREFIX=gpseg

#primary segment起始端口号
PORT_BASE=40000

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

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/home/gpadmin/gpdata/gpmaster

MASTER_PORT=1921

#指定bash的版本
TRUSTED_SHELL=ssh

#指定编码
ENCODING=UTF8

CHECK_POINT_SEGMENTS=8

#mirror segment起始端口号
MIRROR_PORT_BASE=50000

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

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

#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
20160712:18:10:50:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, please wait...
20160712:18:10:51:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Reading Greenplum configuration file gpinitsystem_config
20160712:18:10:51:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Locale has not been set in gpinitsystem_config, will set to default value
20160712:18:10:51:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Locale set to en_US.utf8
20160712:18:10:52:002827 gpinitsystem:mdw:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20160712:18:10:53:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checking configuration parameters, Completed
20160712:18:10:53:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, please wait...
..
20160712:18:10:56:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Configuring build for standard array
20160712:18:10:56:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing multi-home checks, Completed
20160712:18:10:56:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Building primary segment instance array, please wait...
..
20160712:18:11:00:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Building group mirror array type , please wait...
..
20160712:18:11:04:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checking Master host
20160712:18:11:04:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, please wait...
....
20160712:18:11:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checking new segment hosts, Completed
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database Creation Parameters
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master Configuration
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance name       = EMC Greenplum DW
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master hostname            = mdw
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master port                = 1921
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master instance dir        = /home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:11:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master LOCALE              = en_US.utf8
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum segment prefix   = gpseg
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master Database            = 
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master connections         = 100
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master buffers             = 128000kB
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Segment connections        = 300
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Segment buffers            = 128000kB
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Checkpoint segments        = 8
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Encoding                   = UTF8
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Postgres param file        = Off
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Initdb to be used          = /usr/local/greenplum-db438/bin/initdb
20160712:18:11:26:002827 gpinitsystem:mdw:gpadmin-[INFO]:-GP_LIBRARY_PATH is         = /usr/local/greenplum-db438/lib
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Ulimit check               = Passed
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Array host connect type    = Single hostname per node
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [1]      = ::1
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [2]      = 192.168.1.201
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Master IP address [3]      = fe80::20c:29ff:feee:6672
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Standby Master             = Not Configured
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Primary segment #          = 1
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total Database segments    = 2
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Trusted shell              = ssh
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Number segment hosts       = 2
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror port base           = 50000
20160712:18:11:27:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Replicaton port base       = 41000
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror replicaton port base= 51000
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Mirror segment #           = 1
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring config           = ON
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Mirroring type             = Group
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Primary Segment Configuration
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:----------------------------------------
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  /home/gpadmin/gpdata/gpdatap/gpseg0     40000   2       0       41000
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  /home/gpadmin/gpdata/gpdatap/gpseg1     40000   3       1       41000
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:---------------------------------------
20160712:18:11:28:002827 gpinitsystem:mdw:gpadmin-[INFO]:-sdw2  /home/gpadmin/gpdata/gpdatam/gpseg0     50000   4       0       51000
20160712:18:11:29:002827 gpinitsystem:mdw:gpadmin-[INFO]:-sdw1  /home/gpadmin/gpdata/gpdatam/gpseg1     50000   5       1       51000
Continue with Greenplum creation Yy/Nn>
y
20160712:18:11:40:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Building the Master instance database, please wait...
20160712:18:12:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Starting the Master in admin mode
20160712:18:12:41:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of primary segment instances
20160712:18:12:42:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20160712:18:12:42:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.......................................................................................
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 2
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20160712:18:14:12:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:13:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20160712:18:14:13:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20160712:18:14:14:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
............................
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Parallel process exit status
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as completed           = 2
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as killed              = 0
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Total processes marked as failed              = 0
20160712:18:14:43:002827 gpinitsystem:mdw:gpadmin-[INFO]:------------------------------------------------
20160712:18:14:44:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Deleting distributed backout files
20160712:18:14:44:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Removing back out file
20160712:18:14:44:002827 gpinitsystem:mdw:gpadmin-[INFO]:-No errors generated from parallel processes
20160712:18:14:44:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode
20160712:18:14:45:018105 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a -i -m -d /home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:14:45:018105 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20160712:18:14:45:018105 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20160712:18:14:45:018105 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20160712:18:14:46:018105 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: postgres (Greenplum Database) 4.3.8.1 build 1
20160712:18:14:47:018105 gpstop:mdw:gpadmin-[INFO]:-There are 0 connections to the database
20160712:18:14:47:018105 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=immediate
20160712:18:14:47:018105 gpstop:mdw:gpadmin-[INFO]:-Master host=mdw
20160712:18:14:47:018105 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=immediate
20160712:18:14:47:018105 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:14:48:018105 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
20160712:18:14:48:018105 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:14:49:018192 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a -d /home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:14:49:018192 gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
20160712:18:14:49:018192 gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: postgres (Greenplum Database) 4.3.8.1 build 1
20160712:18:14:49:018192 gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: 201310150
20160712:18:14:49:018192 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
20160712:18:14:52:018192 gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20160712:18:14:52:018192 gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20160712:18:14:52:018192 gpstart:mdw:gpadmin-[INFO]:-Setting new master era
20160712:18:14:52:018192 gpstart:mdw:gpadmin-[INFO]:-Master Started...
20160712:18:14:52:018192 gpstart:mdw:gpadmin-[INFO]:-Shutting down master
20160712:18:14:54:018192 gpstart:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
................ 
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-Process results...
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            = 4
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
20160712:18:15:10:018192 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /home/gpadmin/gpdata/pgmaster/gpseg-1 
20160712:18:15:12:018192 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
20160712:18:15:13:018192 gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
20160712:18:15:13:018192 gpstart:mdw:gpadmin-[INFO]:-Database successfully started
20160712:18:15:14:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode
20160712:18:15:14:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Loading gp_toolkit...
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Scanning utility log file for any warning messages
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Log file scan check passed
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Greenplum Database instance successfully created
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-To complete the environment configuration, please 
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-update gpadmin .bashrc file with the following
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/home/gpadmin/gpdata/pgmaster/gpseg-1"
20160712:18:15:23:002827 gpinitsystem:mdw:gpadmin-[INFO]:-   to access the Greenplum scripts for this instance:
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-   or, use -d /home/gpadmin/gpdata/pgmaster/gpseg-1 option for the Greenplum scripts
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-   Example gpstate -d /home/gpadmin/gpdata/pgmaster/gpseg-1
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20160712.log
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-To initialize a Standby Master Segment for this Greenplum instance
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Review options for gpinitstandby
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-The Master /home/gpadmin/gpdata/pgmaster/gpseg-1/pg_hba.conf post gpinitsystem
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-has been configured to allow all hosts within this new
20160712:18:15:24:002827 gpinitsystem:mdw:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this
20160712:18:15:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-new array must be explicitly added to this file
20160712:18:15:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is
20160712:18:15:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-located in the /usr/local/greenplum-db438/docs directory
20160712:18:15:25:002827 gpinitsystem:mdw:gpadmin-[INFO]:-------------------------------------------------------

启动数据库

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

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

查看数据启动状态

[gpadmin@mdw ~]$ gpstate -m
20160712:18:25:15:020013 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -m
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: postgres (Greenplum Database) 4.3.8.1 build 1
20160712:18:25:16:020013 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
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:--------------------------------------------------------------
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:--Current GPDB mirror list and status
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:--Type = Spread
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:--------------------------------------------------------------
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:-   Mirror   Datadir                               Port    Status    Data Status    
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:-   sdw2     /home/gpadmin/gpdata/gpdatam/gpseg0   50000   Passive   Synchronized
20160712:18:25:16:020013 gpstate:mdw:gpadmin-[INFO]:-   sdw1     /home/gpadmin/gpdata/gpdatam/gpseg1   50000   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再进行安装

greenplum集群安装

标签:

原文地址:http://www.cnblogs.com/lottu/p/5662870.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!