Greenplum 在Linux下的安装
1.实验环境
1.1.硬件环境
Oracle VM VirtualBox虚拟机软件;
三台Linux虚拟机:Centos 6.5;
数据库:greenplum-db-4.3.9.1-build-1-rhel5-x86_64.zip。
1.2网卡设置
1.3.虚拟机配置
1.3.1.基本信息配置
节点 |
IP |
内存 |
硬盘 |
master |
192.168.30.180 |
2048M |
50G |
slave1 |
192.168.30.181 |
1024M |
50G |
slave2 |
192.168.30.182 |
1024M |
50G |
1.3.2.系统相关配置(所有节点)
1.3.2.1.设置IP地址的命令行方式
master示例:填写ip地址、子网掩码、网关、DNS等;
slave1、slave2参照master修改ip地址即可。
[root@localhost~]#vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet UUID=f16c7950-fcae-486c-8230-7b181e08bf6d ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none HWADDR=08:00:27:21:47:1D IPADDR=192.168.30.180 PREFIX=24 GATEWAY=192.168.30.1 DNS1=192.168.30.180 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME="System eth0" |
1.3.2.2.关闭防火墙
修改/etc/selinux/config文件:
[root@localhost ~]#/sbin/chkconfig iptables off [root@localhost ~]#vim /etc/selinux/config ..... SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted |
检测防火墙状态:
[root@localhost ~]#/sbin/chkconfig --list iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off |
1.3.2.3.修改主机名和IP映射
master示例:修改HOSTNAME为master;
slave1、slave2参照master,修改为slave1及slave2。
[root@localhost ~]#vim /etc/sysconfig/network NETWORKING=yes HOSTNAME=master |
所有节点hosts增加以下信息
[root@localhost ~]#vim /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.30.180 master 192.168.30.181 slave1 192.168.30.182 slave2 |
所有节点重启服务器:reboot
1.3.2.4.系统参数配置
包括共享内存、网络、用户限制等,修改或添加/etc/sysctl.conf。
[root@master ~]#vim /etc/sysctl.conf ....
#for greenplum begin xfs_mount_options = rw,noatime,inode64,allocsize=16m kernel.shmmax = 500000000 kernel.shmall = 4000000000 kernel.shmmni = 4096 kernel.sem = 250 512000 100 2048 kernel.sysrq = 1 kernel.core_uses_pid = 1 kernel.msgmni = 2048 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 vm.overcommit_memory = 2 #for greenplum end |
配置/etc/security/limits.conf文件
[root@master~]#vim /etc/security/limits.conf ....
# for greenplum begin * soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072 # for greenplum end |
设置磁盘访问I/O调度策略,deadline的调度策略可以平衡IO调度和进程调度,不会造成等待进程频繁的等待。
[root@master ~]#cat /sys/block/sda/queue/scheduler noop anticipatory deadline [cfq] [root@master ~]#cat /sys/block/sr0/queue/scheduler noop anticipatory deadline [cfq] [root@master ~]# echo deadline > /sys/block/sda/queue/scheduler [root@master ~]# echo deadline > /sys/block/sr0/queue/scheduler [root@master ~]#cat /sys/block/sda/queue/scheduler noop anticipatory [deadline] cfq [root@master ~]#cat /sys/block/sr0/queue/scheduler noop anticipatory [deadline] cfq |
设置预读块的值为16384; 16384:数据仓库的最大特点是用于保存历史数据,存在大量的数据操作,包括增删改查,当设置的块越大时读取性能越高;16384是greenplum数据库要求的最低要求。
[root@master ~]# /sbin/blockdev --setra 16384 /dev/sda [root@master ~]# /sbin/blockdev --setra 16384 /dev/sda1 [root@master ~]# /sbin/blockdev --setra 16384 /dev/sda2 [root@master ~]# fdisk -l Disk /dev/sda: 53.7 GB, 53687091200 bytes 255 heads, 63 sectors/track, 6527 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0008b205
Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 6528 51915776 8e Linux LVM
Disk /dev/mapper/VolGroup-lv_root: 48.9 GB, 48930750464 bytes 255 heads, 63 sectors/track, 5948 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 4227 MB, 4227858432 bytes 255 heads, 63 sectors/track, 514 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 |
1.3.3.在Master节点上安装Greenplum软件
1.3.3.1.准备安装文件
下载地址:https://network.pivotal.io/products/pivotal-gpdb
1.3.3.2.拷贝至服务器解压
把下载的zip文件拷贝到服务器(我这里放置在tmp文件夹下),解压文件:
[root@master tmp]# unzip greenplum-db-4.3.9.1-build-1-rhel5-x86_64.zip Archive: greenplum-db-4.3.9.1-build-1-rhel5-x86_64.zip inflating: greenplum-db-4.3.9.1-build-1-rhel5-x86_64.bin |
1.3.3.3.安装软件
[root@master tmp]# bin/bash greenplum-db-4.3.9.1-build-1-rhel5-x86_64.bin ************************************************************************** You must read and accept the Pivotal Database license agreement before installing **************************************************************************
*** IMPORTANT INFORMATION - PLEASE READ CAREFULLY ***
PIVOTAL GREENPLUM DATABASE END USER LICENSE AGREEMENT
省略 。。一直点空格至more取消
I HAVE READ AND AGREE TO THE TERMS OF THE ABOVE PIVOTAL SOFTWARE LICENSE AGREEMENT.
************************************************************************* 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.9.1 ************************************************************************* 点击回车(安装到默认路径)
************************************************************************* Install Greenplum Database into /usr/local/greenplum-db-4.3.9.1? [yes|no] ************************************************************************* yes
************************************************************************* /usr/local/greenplum-db-4.3.9.1 does not exist. Create /usr/local/greenplum-db-4.3.9.1 ? [yes|no] (Selecting no will exit the installer) ************************************************************************* yes
Extracting product to /usr/local/greenplum-db-4.3.9.1
************************************************************************* Installation complete. Greenplum Database is installed in /usr/local/greenplum-db-4.3.9.1
Pivotal Greenplum documentation is available for download at http://gpdb.docs.pivotal.io *************************************************************************
|
1.3.3.4.安装位置
[root@master greenplum-db-4.3.9.1]# pwd /usr/local/greenplum-db-4.3.9.1 |
1.3.3.5.文件说明
greenplum_path.sh:Greenplum数据库环境变量文件
GPDB-LICENSE.txt:Greenplum许可协议
bin:管理工具、客户端程序及服务程序
demo:示例程序
docs:帮助文档
etc:OpenSSL的配置示例
ext:一些GP工具使用的捆绑程序
inlcude:C头文件
lib:库文件
sbin:支持的或者内部的脚本和程序
share:共享文件
1.3.3.6.使用ssh连接所有节点
创建主机文件:
[root@master greenplum-db-4.3.9.1]# vim all_hosts master slave1 slave2 |
查看salve节点是否能连通,测试完slave1后测试slave2:
[root@master greenplum-db-4.3.9.1]# ssh slave1 The authenticity of host 'slave1 (192.168.30.181)' can't be established. RSA key fingerprint is 14:1a:6c:83:1c:3c:09:37:1d:67:28:8e:5e:39:cd:79. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'slave1,192.168.30.181' (RSA) to the list of known hosts. root@slave1's password: 此处输入slave1的root密码 Last login: Tue Sep 27 12:27:14 2016 from 192.168.30.155
|
1.3.3.7.运行gpseginstall工具
gpseginstall工具可实现在其他节点上完成用户、目录的创建;
切换到 /usr/local/greenplum-db目录下:
[root@master greenplum-db]# source greenplum_path.sh [root@master greenplum-db]#gpseginstall -f all_hosts -u gpadmin -p gpadmin 20160927:13:32:32:002046 gpseginstall:master:root-[INFO]:-Installation Info: link_name greenplum-db binary_path /usr/local/greenplum-db-4.3.9.1 binary_dir_location /usr/local binary_dir_name greenplum-db-4.3.9.1 20160927:13:32:32:002046 gpseginstall:master:root-[INFO]:-check cluster password access *** Enter password for slave1: 此处输入slave1的root密码 20160927:13:33:16:002046 gpseginstall:master:root-[INFO]:-de-duplicate hostnames 20160927:13:33:16:002046 gpseginstall:master:root-[INFO]:-master hostname: master 20160927:13:33:17:002046 gpseginstall:master:root-[INFO]:-check for user gpadmin on clus
...........
20160927:13:46:46:002236 gpseginstall:master:root-[INFO]:-remote command: . /usr/local/greenplum-db/./greenplum_path.sh; /usr/local/greenplum-db/./bin/gpssh --version 20160927:13:46:47:002236 gpseginstall:master:root-[INFO]:-remote command: . /usr/local/greenplum-db-4.3.9.1/greenplum_path.sh; /usr/local/greenplum-db-4.3.9.1/bin/gpssh --version 20160927:13:46:52:002236 gpseginstall:master:root-[INFO]:-SUCCESS -- Requested commands completed
|
1.3.3.8.在所有主机上初始化配置Greenplum
切换到gpadmin用户并获取环境变量:
[root@master greenplum-db]#su - gpadmin [gpadmin@master ~]#cd /usr/local/greenplum-db [gpadmin@master greenplum-db]#source greenplum_path.sh [gpadmin@master greenplum-db]#gpssh -f all_hosts -e ls -l $GPHOME [master] ls -l /usr/local/greenplum-db/. [master] total 288 [master] -rw-r--r-- 1 gpadmin gpadmin 21 Sep 27 13:26 all_hosts [master] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 16:48 bin [master] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:33 demo [master] drwxr-xr-x 5 gpadmin gpadmin 4096 Aug 24 14:39 docs [master] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:39 etc [master] drwxr-xr-x 3 gpadmin gpadmin 4096 Aug 24 14:39 ext [master] -rwxr-xr-x 1 gpadmin gpadmin 43025 Aug 24 14:45 GPDB-LICENSE.txt [master] -rw-r--r-- 1 gpadmin gpadmin 735 Sep 27 13:13 greenplum_path.sh [master] drwxr-xr-x 6 gpadmin gpadmin 4096 Aug 24 14:39 include [master] drwxr-xr-x 9 gpadmin gpadmin 12288 Aug 24 14:45 lib [master] -rwxr-xr-x 1 gpadmin gpadmin 192912 Aug 24 14:45 LICENSE.thirdparty [master] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 16:48 sbin [master] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 14:34 share [slave2] ls -l /usr/local/greenplum-db/. [slave2] total 288 [slave2] -rw-r--r-- 1 gpadmin gpadmin 21 Sep 27 13:26 all_hosts [slave2] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 16:48 bin [slave2] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:33 demo [slave2] drwxr-xr-x 5 gpadmin gpadmin 4096 Aug 24 14:39 docs [slave2] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:39 etc [slave2] drwxr-xr-x 3 gpadmin gpadmin 4096 Aug 24 14:39 ext [slave2] -rwxr-xr-x 1 gpadmin gpadmin 43025 Aug 24 14:45 GPDB-LICENSE.txt [slave2] -rw-r--r-- 1 gpadmin gpadmin 735 Sep 27 13:13 greenplum_path.sh [slave2] drwxr-xr-x 6 gpadmin gpadmin 4096 Aug 24 14:39 include [slave2] drwxr-xr-x 9 gpadmin gpadmin 12288 Aug 24 14:45 lib [slave2] -rwxr-xr-x 1 gpadmin gpadmin 192912 Aug 24 14:45 LICENSE.thirdparty [slave2] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 16:48 sbin [slave2] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 14:34 share [slave1] ls -l /usr/local/greenplum-db/. [slave1] total 288 [slave1] -rw-r--r-- 1 gpadmin gpadmin 21 Sep 27 13:26 all_hosts [slave1] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 16:48 bin [slave1] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:33 demo [slave1] drwxr-xr-x 5 gpadmin gpadmin 4096 Aug 24 14:39 docs [slave1] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 14:39 etc [slave1] drwxr-xr-x 3 gpadmin gpadmin 4096 Aug 24 14:39 ext [slave1] -rwxr-xr-x 1 gpadmin gpadmin 43025 Aug 24 14:45 GPDB-LICENSE.txt [slave1] -rw-r--r-- 1 gpadmin gpadmin 735 Sep 27 13:13 greenplum_path.sh [slave1] drwxr-xr-x 6 gpadmin gpadmin 4096 Aug 24 14:39 include [slave1] drwxr-xr-x 9 gpadmin gpadmin 12288 Aug 24 14:45 lib [slave1] -rwxr-xr-x 1 gpadmin gpadmin 192912 Aug 24 14:45 LICENSE.thirdparty [slave1] drwxr-xr-x 2 gpadmin gpadmin 4096 Aug 24 16:48 sbin [slave1] drwxr-xr-x 4 gpadmin gpadmin 4096 Aug 24 14:34 share
|
将环境变量添加到 .bashrc 中:
[gpadmin@master greenplum-db]#cd [gpadmin@master ~]#vim .bashrc # .bashrc
# Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
source /usr/local/greenplum-db/greenplum_path.sh # User specific aliases and functions
|
将master中的 .bashrc 分别复制到slave1与slave2节点中:
[gpadmin@master ~]#scp .bashrc slave1:`pwd` .bashrc 100% 168 0.2KB/s 00:00 [gpadmin@master ~]#scp .bashrc slave2:`pwd` .bashrc 100% 168 0.2KB/s 00:00 |
1.3.4.验证操作系统设置
1.3.4.1.创建存储区域
切换到root用户,创建数据存储文件夹及赋予权限:
[gpadmin@master ~]#exit [root@master greenplum-db ]#mkdir -p /data/master [root@master greenplum-db ]#chown gpadmin /data/master |
创建一个包含所有slave主机的文件seg_hosts:
[root@master greenplum-db ]#vim seg_hosts slave1 slave2 |
使用gpssh工具在所有slave主机上创建主数据和镜像数据目录:
[root@master greenplum-db ]#source greenplum_path.sh [root@master greenplum-db ]#gpssh -f seg_hosts -e 'mkdir -p /data/primary' [slave2] mkdir -p /data/primary [slave1] mkdir -p /data/primary [root@master greenplum-db ]#gpssh -f seg_hosts -e 'mkdir -p /data/mirror' [slave1] mkdir -p /data/mirror [slave2] mkdir -p /data/mirror [root@master greenplum-db ]#gpssh -f seg_hosts -e 'chown gpadmin /data/primary' [slave1] chown gpadmin /data/primary [slave2] chown gpadmin /data/primary [root@master greenplum-db ]#gpssh -f seg_hosts -e 'chown gpadmin /data/mirror' [slave2] chown gpadmin /data/mirror [slave1] chown gpadmin /data/mirror
|
1.3.4.2.同步系统时间
在Master主机上编辑/etc/ntp.conf来设置如下内容:
[root@master greenplum-db ]#vim /etc/ntp.conf # For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system.
......
# Enable public key cryptography. #crypto server 127.127.1.0 includefile /etc/ntp/crypto/pw
......
# Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats
|
在slave主机上编辑/etc/ntp.conf来设置如下内容:
[root@slave1 ~ ]#vim /etc/ntp.conf # For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not # permit the source to query or modify the service on this system.
......
# Enable public key cryptography. #crypto server master includefile /etc/ntp/crypto/pw
......
# Enable writing of statistics records. #statistics clockstats cryptostats loopstats peerstats
|
在Master主机上,通过NTP守护进程同步系统时钟
[root@master greenplum-db ]#gpssh -f all_hosts -v -e 'ntpd' [Reset ...] [INFO] login master [INFO] login slave2 [INFO] login slave1 [master] ntpd [slave2] ntpd [slave1] ntpd [INFO] completed successfully
[Cleanup...] |
1.3.4.2.验证操作系统设置
[root@master greenplum-db ]#gpcheck -f all_hosts -m master 20160927:15:07:52:003003 gpcheck:master:root-[INFO]:-dedupe hostnames 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-Detected platform: Generic Linux Cluster 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-generate data on servers 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-copy data files from servers 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-delete remote tmp files 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-Using gpcheck config file: /usr/local/greenplum-db/./etc/gpcheck.cnf 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-GPCHECK_NORMAL 20160927:15:07:53:003003 gpcheck:master:root-[INFO]:-gpcheck completing... |
1.3.5.初始化Greenplum
1.3.5.1.创建Greenplum数据库配置文件
切换到gpadmin用户,从模板中拷贝一份gpinitsystem_config文件,设置所有必须的参数以及可选参数。
[root@master greenplum-db ]#su - gpadmin [gpadmin@master ~]#cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/ [gpadmin@master ~]#chmod 775 /home/gpadmin/gpinitsystem_config [gpadmin@master ~]#vim gpinitsystem_config # FILE NAME: gpinitsystem_config
# Configuration file needed by the gpinitsystem
################################################ #### REQUIRED PARAMETERS ################################################
#### Name of this Greenplum system enclosed in quotes. ARRAY_NAME="EMC Greenplum DW"
#### Naming convention for utility-generated data directories. SEG_PREFIX=gpseg
#### Base number by which primary segment port numbers #### are calculated. PORT_BASE=40000
#### File system location(s) where primary segment data directories #### will be created. The number of locations in the list dictate #### the number of primary segments that will get created per #### physical host (if multiple addresses for a host are listed in #### the hostfile, the number of segments will be spread evenly across #### the specified interface addresses). declare -a DATA_DIRECTORY=(/data/primary)
#### OS-configured hostname or IP address of the master host. MASTER_HOSTNAME=master
#### File system location where the master data directory #### will be created. MASTER_DIRECTORY=/data/master
#### Port number for the master instance. MASTER_PORT=5432
#### Shell utility used to connect to remote hosts. TRUSTED_SHELL=ssh
#### Maximum log file segments between automatic WAL checkpoints. CHECK_POINT_SEGMENTS=8
#### Default server-side character set encoding. ENCODING=UNICODE
################################################ #### OPTIONAL MIRROR PARAMETERS ################################################
#### Base number by which mirror segment port numbers #### are calculated. MIRROR_PORT_BASE=50000
#### Base number by which primary file replication port #### numbers are calculated. REPLICATION_PORT_BASE=41000
#### Base number by which mirror file replication port #### numbers are calculated. MIRROR_REPLICATION_PORT_BASE=51000
#### File system location(s) where mirror segment data directories #### will be created. The number of mirror locations must equal the #### number of primary locations as specified in the #### DATA_DIRECTORY parameter. declare -a MIRROR_DATA_DIRECTORY=(/data/mirror)
################################################ #### OTHER OPTIONAL PARAMETERS ################################################
#### Create a database of this name after initialization. #DATABASE_NAME=name_of_database
#### Specify the location of the host address file here instead of #### with the the -h option of gpinitsystem. #MACHINE_LIST_FILE=/home/gpadmin/gpconfigs/hostfile_gpinitsystem |
1.3.5.2.初始化数据库
[gpadmin@master ~]#cp /usr/local/greenplum-db/seg_hosts . [gpadmin@master ~]#ls gpinitsystem_config seg_hosts [gpadmin@master ~]#gpinitsystem -c gpinitsystem_config -h seg_hosts gpinitsystem_config seg_hosts 20160927:15:28:43:003166 gpinitsystem:master:gpadmin-[INFO]:-Checking configuration parameters, please wait... 20160927:15:28:43:003166 gpinitsystem:master:gpadmin-[INFO]:-Reading Greenplum configuration file gpinitsystem_config 20160927:15:28:43:003166 gpinitsystem:master:gpadmin-[INFO]:-Locale has not been set in gpinitsystem_config, will set to default value 20160927:15:28:43:003166 gpinitsystem:master:gpadmin-[INFO]:-Locale set to en_US.utf8 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-No DATABASE_NAME set, will exit following template1 updates 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 250 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Checking configuration parameters, Completed 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Commencing multi-home checks, please wait... .. 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Configuring build for standard array 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Commencing multi-home checks, Completed 20160927:15:28:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Building primary segment instance array, please wait... .. 20160927:15:28:45:003166 gpinitsystem:master:gpadmin-[INFO]:-Building group mirror array type , please wait... .. 20160927:15:28:46:003166 gpinitsystem:master:gpadmin-[INFO]:-Checking Master host 20160927:15:28:46:003166 gpinitsystem:master:gpadmin-[INFO]:-Checking new segment hosts, please wait... .... 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Checking new segment hosts, Completed 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Greenplum Database Creation Parameters 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:--------------------------------------- 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master Configuration 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:--------------------------------------- 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master instance name = EMC Greenplum DW 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master hostname = master 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master port = 5432 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master instance dir = /data/master/gpseg-1 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master LOCALE = en_US.utf8 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Greenplum segment prefix = gpseg 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master Database = 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master connections = 250 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master buffers = 128000kB 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Segment connections = 750 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Segment buffers = 128000kB 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Checkpoint segments = 8 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Encoding = UNICODE 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Postgres param file = Off 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Initdb to be used = /usr/local/greenplum-db/./bin/initdb 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-GP_LIBRARY_PATH is = /usr/local/greenplum-db/./lib 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Ulimit check = Passed 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Array host connect type = Single hostname per node 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master IP address [1] = ::1 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master IP address [2] = 192.168.30.180 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Master IP address [3] = fe80::a00:27ff:fe21:471d 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Standby Master = Not Configured 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Primary segment # = 1 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Total Database segments = 2 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Trusted shell = ssh 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Number segment hosts = 2 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Mirror port base = 50000 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Replicaton port base = 41000 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Mirror replicaton port base= 51000 20160927:15:28:51:003166 gpinitsystem:master:gpadmin-[INFO]:-Mirror segment # = 1 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-Mirroring config = ON 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-Mirroring type = Group 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:---------------------------------------- 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-Greenplum Primary Segment Configuration 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:---------------------------------------- 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-slave1 /data/primary/gpseg0 40000 2 0 41000 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-slave2 /data/primary/gpseg1 40000 3 1 41000 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:--------------------------------------- 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-Greenplum Mirror Segment Configuration 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:--------------------------------------- 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-slave2 /data/mirror/gpseg0 50000 4 0 51000 20160927:15:28:52:003166 gpinitsystem:master:gpadmin-[INFO]:-slave1 /data/mirror/gpseg1 50000 5 1 51000 Continue with Greenplum creation Yy/Nn> y 20160927:15:28:59:003166 gpinitsystem:master:gpadmin-[INFO]:-Building the Master instance database, please wait... 20160927:15:29:07:003166 gpinitsystem:master:gpadmin-[INFO]:-Starting the Master in admin mode 20160927:15:29:13:003166 gpinitsystem:master:gpadmin-[INFO]:-Commencing parallel build of primary segment instances 20160927:15:29:13:003166 gpinitsystem:master:gpadmin-[INFO]:-Spawning parallel processes batch [1], please wait... .. 20160927:15:29:13:003166 gpinitsystem:master:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait... .............................. 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Parallel process exit status 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as completed = 2 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as killed = 0 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as failed = 0 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Spawning parallel processes batch [1], please wait... .. 20160927:15:29:44:003166 gpinitsystem:master:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait... ...................... 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Parallel process exit status 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as completed = 2 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as killed = 0 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Total processes marked as failed = 0 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------ 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Deleting distributed backout files 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-Removing back out file 20160927:15:30:06:003166 gpinitsystem:master:gpadmin-[INFO]:-No errors generated from parallel processes 20160927:15:30:07:003166 gpinitsystem:master:gpadmin-[INFO]:-Restarting the Greenplum instance in production mode 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Starting gpstop with args: -a -i -m -d /data/master/gpseg-1 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Gathering information and validating the environment... 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Obtaining Segment details from master... 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.9.1 build commit:095e92e4ecbbbb6764897ca98b1cb7705ad0c805' 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-There are 0 connections to the database 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='immediate' 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Master host=master 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=immediate 20160927:15:30:07:018169 gpstop:master:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1 20160927:15:30:08:018169 gpstop:master:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process 20160927:15:30:08:018169 gpstop:master:gpadmin-[INFO]:-Terminating processes for segment /data/master/gpseg-1 20160927:15:30:08:018257 gpstart:master:gpadmin-[INFO]:-Starting gpstart with args: -a -d /data/master/gpseg-1 20160927:15:30:08:018257 gpstart:master:gpadmin-[INFO]:-Gathering information and validating the environment... 20160927:15:30:08:018257 gpstart:master:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.9.1 build commit:095e92e4ecbbbb6764897ca98b1cb7705ad0c805' 20160927:15:30:08:018257 gpstart:master:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150' 20160927:15:30:08:018257 gpstart:master:gpadmin-[INFO]:-Starting Master instance in admin mode 20160927:15:30:09:018257 gpstart:master:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20160927:15:30:09:018257 gpstart:master:gpadmin-[INFO]:-Obtaining Segment details from master... 20160927:15:30:09:018257 gpstart:master:gpadmin-[INFO]:-Setting new master era 20160927:15:30:09:018257 gpstart:master:gpadmin-[INFO]:-Master Started... 20160927:15:30:09:018257 gpstart:master:gpadmin-[INFO]:-Shutting down master 20160927:15:30:11:018257 gpstart:master:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait... .... 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:-Process results... 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:----------------------------------------------------- 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:- Successful segment starts = 4 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:- Failed segment starts = 0 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:----------------------------------------------------- 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:- 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:----------------------------------------------------- 20160927:15:30:15:018257 gpstart:master:gpadmin-[INFO]:-Starting Master instance master directory /data/master/gpseg-1 20160927:15:30:16:018257 gpstart:master:gpadmin-[INFO]:-Command pg_ctl reports Master master instance active 20160927:15:30:16:018257 gpstart:master:gpadmin-[INFO]:-No standby master configured. skipping... 20160927:15:30:16:018257 gpstart:master:gpadmin-[INFO]:-Database successfully started 20160927:15:30:16:003166 gpinitsystem:master:gpadmin-[INFO]:-Completed restart of Greenplum instance in production mode 20160927:15:30:16:003166 gpinitsystem:master:gpadmin-[INFO]:-Loading gp_toolkit... 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-Scanning utility log file for any warning messages 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-Log file scan check passed 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-Greenplum Database instance successfully created 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------------- 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-To complete the environment configuration, please 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-update gpadmin .bashrc file with the following 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/data/master/gpseg-1" 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:- to access the Greenplum scripts for this instance: 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:- or, use -d /data/master/gpseg-1 option for the Greenplum scripts 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:- Example gpstate -d /data/master/gpseg-1 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-Script log file = /home/gpadmin/gpAdminLogs/gpinitsystem_20160927.log 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-To remove instance, run gpdeletesystem utility 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-To initialize a Standby Master Segment for this Greenplum instance 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-Review options for gpinitstandby 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------------- 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-The Master /data/master/gpseg-1/pg_hba.conf post gpinitsystem 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-has been configured to allow all hosts within this new 20160927:15:30:19:003166 gpinitsystem:master:gpadmin-[INFO]:-array to intercommunicate. Any hosts external to this 20160927:15:30:20:003166 gpinitsystem:master:gpadmin-[INFO]:-new array must be explicitly added to this file 20160927:15:30:20:003166 gpinitsystem:master:gpadmin-[INFO]:-Refer to the Greenplum Admin support guide which is 20160927:15:30:20:003166 gpinitsystem:master:gpadmin-[INFO]:-located in the /usr/local/greenplum-db/./docs directory 20160927:15:30:20:003166 gpinitsystem:master:gpadmin-[INFO]:------------------------------------------------------
|
当出现以下信息时初始化成功:
[gpadmin@master ~]#ps -ef|grep post root 1581 1 0 12:26 ? 00:00:00 /usr/libexec/postfix/master postfix 1588 1581 0 12:26 ? 00:00:00 qmgr -l -t fifo -u postfix 2488 1581 0 14:06 ? 00:00:00 pickup -l -t fifo -u gpadmin 18317 1 0 15:30 ? 00:00:00 /usr/local/greenplum-db-4.3.9.1/bin/postgres -D /data/master/gpseg-1 -p 5432 -b 1 -z 2 --silent-mode=true -i -M master -C -1 -x 0 -E gpadmin 18318 18317 0 15:30 ? 00:00:00 postgres: port 5432, master logger process gpadmin 18321 18317 0 15:30 ? 00:00:00 postgres: port 5432, stats collector process gpadmin 18322 18317 0 15:30 ? 00:00:00 postgres: port 5432, writer process gpadmin 18323 18317 0 15:30 ? 00:00:00 postgres: port 5432, checkpoint process gpadmin 18324 18317 0 15:30 ? 00:00:00 postgres: port 5432, seqserver process gpadmin 18325 18317 0 15:30 ? 00:00:00 postgres: port 5432, ftsprobe process gpadmin 18326 18317 0 15:30 ? 00:00:00 postgres: port 5432, sweeper process gpadmin 19820 3104 0 15:44 pts/0 00:00:00 grep post |
1.3.6.启动和关闭Greenplum
启动:gpstart
关闭:gpstop
如果启动和关闭提示-gpstart failed或-gpstop failed.:
20130318:16:42:46:031279 gpstate:local_master:gpadmin-[INFO]:-Starting gpstate with args: -s
20130318:16:42:46:031279 gpstate:local_master:gpadmin-[CRITICAL]:-gpstate failed. (Reason='Environment Variable MASTER_DATA_DIRECTORY not set!') exiting...
增加master的环境变量
vi .bash_profile
source /usr/local/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1
export PGPORT=5432
export PGUSER=gpadmin
export PGDATABASE=EMC Greenplum DW
拷贝
$ scp .bashrc standby_hostname:`pwd`