注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

PostgreSQL 中文网

 
 
 

日志

 
 

GreenPlumn 数据库安装  

2011-04-16 14:40:48|  分类: GreenPlumn |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |


          关于 GreenPlum  的介绍可以参考前一篇文章,这篇文章主要介绍 GreenPlum 3.6.1 详细安装步骤。

1 实验环境
--1.1 硬件环境
      一台 2G内存的联想 SL410K 双核笔记本, 并安装三台Linux虚拟机。
   
--1.2虚拟机配置   

 节点  IP  内存  硬盘
 gpmaster  192.168.1.50  400M  15G
 gpnode1  192.168.1.51  400M 15G
 gpnode2  192.168.1.52   400M  15G

 

--1.2 本文中用到的术语
master host :   主节点主机
segment host :  子节点主机


2修改master, segments主机参数 (所有主机上执行)
--2.1 修改 /etc/sysctl.conf 添加以下
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=4096
net.core.netdev_max_backlog=10000
vm.overcommit_memory=2

--2.2 修改 /etc/security/limits.conf ,添加以下
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

--2.3 修改 /etc/hosts ,添加以下
192.168.1.50 gpmaster
192.168.1.51 gpnode1
192.168.1.52 gpnode2


3 增加操作系统greenplum用户并创建数据目录(所有节点上执行)
--3.1增加 greenplum 组和用户
[root@gpmaster greenplum-db]# groupadd greenplum
[root@gpmaster greenplum-db]# useradd -g greenplum greenplum
[root@gpmaster greenplum-db]# passwd greenplum

--3.2配置环境变量
将文件 /opt/greenplum-db/greenplum_path.sh 写入 /home/greenplum/.bash_profile
source .bash_profile

--3.3创建 segment 数据目录
mkdir -p /opt/gp_data/data
chown -R greenplum:greenplum /opt/gp_data/data

--3.5创建 sgement 镜像目录
mkdir -p /opt/gp_data/mdata
chown -R greenplum:greenplum /opt/gp_data/mdata
   说明:上面两个步骤也可以等配置好主机之前等效性用 gpssh 执行。
            gpssh可以同时连接所有子节点主机并进行操作。


4 在Master节点上安装 GreenPlumn 软件
--4.1 下载介质
     在官网 http://gpn.greenplum.com/download.php 下载

--4.2 解压
unzip greenplum-db-3[1].3.6.1-build-1-RHEL5-i386.zip

--4.3 安装 GreenPlumn软件
# /bin/bash greenplum-db-3.3.6.1-build-1-RHEL5-i386.bin

        提示“yes” 接受协议 和安装路径, 默认的是“(/usr/local/greenplum-db-3.3.6.0)”
我这里选择的是 "/opt/greenplum-db-3.3.6.1" ,安装结束后会自动创建一个软链接,如
 
[root@gpmaster opt]# ll /opt
lrwxrwxrwx  1 root root   22 04-06 21:30 greenplum-db -> ./greenplum-db-3.3.6.1
drwxr-xr-x 11 root root 4096 04-06 21:30 greenplum-db-3.3.6.1
  
5 在所有子节点主机上安装  greenplumn 软件
--5.1创建节点配置文件
vi /home/greenplum/all_host_file 添加以下内容
gpmaster
gpnode1
gpnode2

--5.2 执行文件greenplum_path.sh,设定环境变量
[root@gpmaster greenplum]#source  /opt/greenplum-db/greenplum_path.sh

--5.3以 root 用户交换密钥
[root@gpmaster greenplum]# gpssh-exkeys -f /home/greenplum/all_host_file
[STEP 1 of 5] create local ID and authorize on local host
  ... /root/.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 gpnode1
  ***
  *** Enter password for gpnode1:
  ... send to gpnode2

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with gpnode1
  ... finished key exchange with gpnode2

[INFO] completed successfully

--5.4以 greenplum 用户交换密钥
[root@gpmaster greenplum]# su - greenplum
[greenplum@gpmaster ~]$ gpssh-exkeys -f /home/greenplum/all_host_file

--5.5将主节点上 greenplum 软件复制到 所有segments 主机 ( 主节点上操作 )
1 cd /opt
tar cvf gp.tar greenplum-db-3.3.6.1

2 source /opt/greenplum-db/greenplum_path.sh

3 生成 all_host_file文件,添加以下
gpmaster
gpnode1
gpnode2

4 gpscp -f greenplum-db/all_host_file gp.tar =:/opt

5  gpssh -f greenplum-db/all_host_file
=> cd /opt
=> tar xvf  /opt/gp.tar
=> chown -R greenplum:greenplum greenplum-db;
=> chown -R greenplum:greenplum greenplum-db-3.3.6.1;
=> ln -s /opt/greenplum-db-3.3.6.1 /opt/greenplum-db

--5.6同步系统时钟(如果配置了 ntpd服务)
 gpssh -f /opt/greenplum-db/all_hosts_file ntpd


6 初始化 GreenPlumn (on Master )
--6.1 copy 配置文件模板
cp $GPHOME/docs/cli_help/gp_init_config_example /home/greenplum/gp_init_config

--6.2修改配置文件 gp_init_config ,修改以下参数。
ARRAY_NAME="Greenplum"
MACHINE_LIST_FILE=/home/greenplum/multi_seg_host_file
SEG_PREFIX=gp
PORT_BASE=50000
declare -a DATA_DIRECTORY=(/opt/gp_data/data)
MASTER_HOSTNAME=gpmaster
MASTER_DIRECTORY=/opt/gp_data
MASTER_PORT=5432
MIRROR_PORT_BASE=60000
declare -a MIRROR_DATA_DIRECTORY=(/opt/gp_data/mdata)

         上面是偶配置的参数,比较重要的两个参数是 "DATA_DIRECTORY" 和 "MIRROR_DATA_DIRECTORY"
DATA_DIRECTORY 是指 segment主机 primary 实例的数据目录,MIRROR_DATA_DIRECTORY是指 segment
主机 mirror 实例的数据目录,这样一份配置,当后面执行 gpinitsystem 时,会在每一台 segment
主机上创建一个 primary 实例和 一个 mirror 实例。  

--6.3先检查下OS配置是否满足需求
[greenplum@gpmaster ~]$ gpcheckos -f all_host_file
checking: postgres.md5 = 62406a6f410a5b324fcced3236150ee6
checking: postgres.version = postgres (Greenplum Database) 8.2.13
checking: sync.time between (2011-04-13 19:38:31.696946, 2011-04-13 19:38:51.696946)
checking: platform.hostname
checking: platform.memory
checking: platform.memory = 352321536
checking: platform.system = linux or sunos
checking: platform.system = linux
checking: platform.release = 2.6.18-194.el5xen
checking: sysctl.kernel.shmall = 4000000000
checking: sysctl.net.ipv4.tcp_max_syn_backlog = 4096
checking: sysctl.vm.overcommit_memory = 2
checking: sysctl.net.core.netdev_max_backlog = 10000
checking: ulimit.nofile >= 65536
checking: sysctl.kernel.sem = 250 64000 100 512
checking: sysctl.kernel.shmmax >= 500000000
checking: ulimit.nproc >= 131072
checking: sysctl.kernel.shmmni >= 4096
checking: sysctl.net.ipv4.ip_local_port_range = 1025 65535
checking: sysctl.net.ipv4.tcp_tw_recycle = 1

--6.4初始化 greenplumn ( Master 节点上执行 )
[greenplum@gpmaster ~]$ gpinitsystem -c gp_init_config
20110413:20:29:07:gpinitsystem:gpmaster:greenplum-[INFO]:-Checking configuration parameters, please wait...
20110413:20:29:09:gpinitsystem:gpmaster:greenplum-[INFO]:-Reading Greenplum configuration file gp_init_config
20110413:20:29:09:gpinitsystem:gpmaster:greenplum-[INFO]:-Locale has not been set in gp_init_config, will set to default value
20110413:20:29:11:gpinitsystem:gpmaster:greenplum-[INFO]:-Locale set to en_US.utf8
20110413:20:29:15:gpinitsystem:gpmaster:greenplum-[INFO]:-No DATABASE_NAME set, will exit following template1 updates
20110413:20:29:16:gpinitsystem:gpmaster:greenplum-[INFO]:-MASTER_MAX_CONNECT not set, will set to default value 25
20110413:20:29:18:gpinitsystem:gpmaster:greenplum-[INFO]:-Master IP address array = 192.168.122.1
20110413:20:29:18:gpinitsystem:gpmaster:greenplum-[INFO]:-Checking configuration parameters, Completed
20110413:20:29:19:gpinitsystem:gpmaster:greenplum-[INFO]:-Commencing multi-home checks, please wait...
..
20110413:20:29:24:gpinitsystem:gpmaster:greenplum-[INFO]:-Configuring build for standard array
20110413:20:29:24:gpinitsystem:gpmaster:greenplum-[INFO]:-Commencing multi-home checks, Completed
20110413:20:29:25:gpinitsystem:gpmaster:greenplum-[INFO]:-Building primary segment instance array, please wait...
..
20110413:20:29:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Building group mirror array type , please wait...
..
20110413:20:29:45:gpinitsystem:gpmaster:greenplum-[INFO]:-Checking Master host
20110413:20:29:48:gpinitsystem:gpmaster:greenplum-[INFO]:-Checking new segment hosts, please wait...
....
20110413:20:30:24:gpinitsystem:gpmaster:greenplum-[INFO]:-Checking new segment hosts, Completed
20110413:20:30:26:gpinitsystem:gpmaster:greenplum-[INFO]:-Greenplum Database Creation Parameters
20110413:20:30:26:gpinitsystem:gpmaster:greenplum-[INFO]:---------------------------------------
20110413:20:30:26:gpinitsystem:gpmaster:greenplum-[INFO]:-Master Configuration
20110413:20:30:27:gpinitsystem:gpmaster:greenplum-[INFO]:---------------------------------------
20110413:20:30:27:gpinitsystem:gpmaster:greenplum-[INFO]:-Master instance name       = Greenplum Database
20110413:20:30:27:gpinitsystem:gpmaster:greenplum-[INFO]:-Master hostname            = gpmaster
20110413:20:30:28:gpinitsystem:gpmaster:greenplum-[INFO]:-Master port                = 5432
20110413:20:30:28:gpinitsystem:gpmaster:greenplum-[INFO]:-Master instance dir        = /opt/gp_data/gp-1
20110413:20:30:28:gpinitsystem:gpmaster:greenplum-[INFO]:-Master LOCALE              = en_US.utf8
20110413:20:30:29:gpinitsystem:gpmaster:greenplum-[INFO]:-Greenplum segment prefix   = gp
20110413:20:30:29:gpinitsystem:gpmaster:greenplum-[INFO]:-Master Database            =
20110413:20:30:30:gpinitsystem:gpmaster:greenplum-[INFO]:-Master connections         = 25
20110413:20:30:30:gpinitsystem:gpmaster:greenplum-[INFO]:-Master buffers             = 128000kB
20110413:20:30:30:gpinitsystem:gpmaster:greenplum-[INFO]:-Segment connections        = 125
20110413:20:30:31:gpinitsystem:gpmaster:greenplum-[INFO]:-Segment buffers            = 128000kB
20110413:20:30:31:gpinitsystem:gpmaster:greenplum-[INFO]:-Checkpoint segments        = 8
20110413:20:30:31:gpinitsystem:gpmaster:greenplum-[INFO]:-Encoding                   = UNICODE
20110413:20:30:32:gpinitsystem:gpmaster:greenplum-[INFO]:-Postgres param file        = Off
20110413:20:30:32:gpinitsystem:gpmaster:greenplum-[INFO]:-Initdb to be used          = /opt/greenplum-db/./bin/initdb
20110413:20:30:33:gpinitsystem:gpmaster:greenplum-[INFO]:-GP_LIBRARY_PATH is         = /opt/greenplum-db/./lib
20110413:20:30:33:gpinitsystem:gpmaster:greenplum-[INFO]:-Ulimit check               = Passed
20110413:20:30:33:gpinitsystem:gpmaster:greenplum-[INFO]:-Segment build type         = Parallel
20110413:20:30:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Array host connect type    = Single hostname per node
20110413:20:30:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Master IP address [1]      = 192.168.122.1
20110413:20:30:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Master IP address [2]      = 192.168.1.50
20110413:20:30:35:gpinitsystem:gpmaster:greenplum-[INFO]:-Master only build          = Off
20110413:20:30:35:gpinitsystem:gpmaster:greenplum-[INFO]:-Standby Master             = Not Configured
20110413:20:30:35:gpinitsystem:gpmaster:greenplum-[INFO]:-Primary segment #          = 1
20110413:20:30:36:gpinitsystem:gpmaster:greenplum-[INFO]:-Total Database segments    = 2
20110413:20:30:36:gpinitsystem:gpmaster:greenplum-[INFO]:-Trusted shell              = ssh
20110413:20:30:37:gpinitsystem:gpmaster:greenplum-[INFO]:-Number segment hosts       = 2
20110413:20:30:37:gpinitsystem:gpmaster:greenplum-[INFO]:-Mirror port base           = 60000
20110413:20:30:37:gpinitsystem:gpmaster:greenplum-[INFO]:-Mirror segment #           = 1
20110413:20:30:38:gpinitsystem:gpmaster:greenplum-[INFO]:-Mirroring config           = ON
20110413:20:30:38:gpinitsystem:gpmaster:greenplum-[INFO]:-Mirroring type             = Group
20110413:20:30:38:gpinitsystem:gpmaster:greenplum-[INFO]:----------------------------------------
20110413:20:30:39:gpinitsystem:gpmaster:greenplum-[INFO]:-Greenplum Primary Segment Configuration
20110413:20:30:39:gpinitsystem:gpmaster:greenplum-[INFO]:----------------------------------------
20110413:20:30:40:gpinitsystem:gpmaster:greenplum-[INFO]:-gpnode1       /opt/gp_data/data/gp0   50001   2       0
20110413:20:30:40:gpinitsystem:gpmaster:greenplum-[INFO]:-gpnode2       /opt/gp_data/data/gp1   50001   3       1
20110413:20:30:40:gpinitsystem:gpmaster:greenplum-[INFO]:---------------------------------------
20110413:20:30:41:gpinitsystem:gpmaster:greenplum-[INFO]:-Greenplum Mirror Segment Configuration
20110413:20:30:41:gpinitsystem:gpmaster:greenplum-[INFO]:---------------------------------------
20110413:20:30:41:gpinitsystem:gpmaster:greenplum-[INFO]:-gpnode2       /opt/gp_data/mdata/gp0  60001   4       0
20110413:20:30:42:gpinitsystem:gpmaster:greenplum-[INFO]:-gpnode1       /opt/gp_data/mdata/gp1  60001   5       1
Continue with Greenplum creation Yy/Nn>


20110413:20:31:04:gpinitsystem:gpmaster:greenplum-[INFO]:-Building the Master instance database, please wait...
20110413:20:31:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Starting the Master in admin mode
20110413:20:32:08:gpinitsystem:gpmaster:greenplum-[INFO]:-Commencing parallel build of primary segment instances
20110413:20:32:08:gpinitsystem:gpmaster:greenplum-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20110413:20:32:13:gpinitsystem:gpmaster:greenplum-[INFO]:-Waiting for parallel processes batch [1], please wait...
.......................................................
20110413:20:33:20:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:33:21:gpinitsystem:gpmaster:greenplum-[INFO]:-Parallel process exit status
20110413:20:33:21:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:33:21:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as completed           = 2
20110413:20:33:22:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as killed              = 0
20110413:20:33:22:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as failed              = 0
20110413:20:33:22:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:33:24:gpinitsystem:gpmaster:greenplum-[INFO]:-Commencing parallel build of mirror segment instances
20110413:20:33:25:gpinitsystem:gpmaster:greenplum-[INFO]:-Spawning parallel processes    batch [1], please wait...
..
20110413:20:33:30:gpinitsystem:gpmaster:greenplum-[INFO]:-Waiting for parallel processes batch [1], please wait...
....................................................
20110413:20:34:35:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:34:35:gpinitsystem:gpmaster:greenplum-[INFO]:-Parallel process exit status
20110413:20:34:35:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:34:36:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as completed           = 2
20110413:20:34:36:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as killed              = 0
20110413:20:34:36:gpinitsystem:gpmaster:greenplum-[INFO]:-Total processes marked as failed              = 0
20110413:20:34:37:gpinitsystem:gpmaster:greenplum-[INFO]:------------------------------------------------
20110413:20:34:38:gpinitsystem:gpmaster:greenplum-[INFO]:-Deleting distributed backout files
20110413:20:34:38:gpinitsystem:gpmaster:greenplum-[INFO]:-Removing back out file
20110413:20:34:39:gpinitsystem:gpmaster:greenplum-[INFO]:-No errors generated from parallel processes
20110413:20:34:39:gpinitsystem:gpmaster:greenplum-[INFO]:-Restarting the Greenplum instance in production mode
20110413:20:34:40:gpstop:gpmaster:greenplum-[INFO]:-Starting gpstop with args: '-a -i -d /opt/gp_data/gp-1'
20110413:20:34:40:gpstop:gpmaster:greenplum-[INFO]:-Gathering information and validating the environment...
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Obtaining Greenplum Master catalog information
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Obtaining Segment details from master...
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 3.3.6.1 build 1'
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-There are 0 connections to the database
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Commencing Master instance shutdown with mode='immediate'
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Master host=gpmaster
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Commencing Master instance shutdown with mode=immediate
20110413:20:34:41:gpstop:gpmaster:greenplum-[INFO]:-Master segment instance directory=/opt/gp_data/gp-1
20110413:20:34:43:gpstop:gpmaster:greenplum-[INFO]:-No standby master host configured
20110413:20:34:47:gpstop:gpmaster:greenplum-[INFO]:-Commencing parallel segment instance shutdown, please wait...
..........
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-------------------------------------------------
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Parallel process exit status
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-------------------------------------------------
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Total processes marked as completed         = 4
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Total processes marked as failed            = 0
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-------------------------------------------------
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Total instances marked invalid and bypassed = 0
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Successfully shutdown 4 of 4 segment instances
20110413:20:34:57:gpstop:gpmaster:greenplum-[INFO]:-Database successfully shutdown with no errors reported
20110413:20:34:59:gpstart:gpmaster:greenplum-[INFO]:-Starting gpstart with args: '-a -d /opt/gp_data/gp-1'
20110413:20:34:59:gpstart:gpmaster:greenplum-[INFO]:-Gathering information and validating the environment...
20110413:20:35:00:gpstart:gpmaster:greenplum-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 3.3.6.1 build 1'
20110413:20:35:00:gpstart:gpmaster:greenplum-[INFO]:-Starting Master instance in admin mode
20110413:20:35:01:gpstart:gpmaster:greenplum-[INFO]:-Obtaining Greenplum Master catalog information
20110413:20:35:01:gpstart:gpmaster:greenplum-[INFO]:-Obtaining Segment details from master...
20110413:20:35:01:gpstart:gpmaster:greenplum-[INFO]:-Master Started...
20110413:20:35:01:gpstart:gpmaster:greenplum-[INFO]:-Shutting down master
20110413:20:35:10:gpstart:gpmaster:greenplum-[INFO]:-No standby master configured.  skipping...
20110413:20:35:13:gpstart:gpmaster:greenplum-[INFO]:-Commencing parallel segment instance startup, please wait...
...........
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Process results...
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-----------------------------------------------------
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Total processes marked as completed             = 4
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Total processes marked as failed                = 0
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-----------------------------------------------------
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Total instances marked invalid and bypassed     = 0
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Successfully started 4 of 4 segment instances
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-----------------------------------------------------
20110413:20:35:24:gpstart:gpmaster:greenplum-[INFO]:-Starting Master instance gpmaster directory /opt/gp_data/gp-1
20110413:20:35:28:gpstart:gpmaster:greenplum-[INFO]:-Command pg_ctl reports Master gpmaster instance active
20110413:20:35:28:gpstart:gpmaster:greenplum-[INFO]:-Database successfully started with no errors reported
20110413:20:35:30:gpinitsystem:gpmaster:greenplum-[INFO]:-Completed restart of Greenplum instance in production mode
psql: FATAL:  building Gang: Primary and mirror both unavailable for segment 0 (i 1 j 2) (cdbgang.c:1332)
20110413:20:35:31:gpinitsystem:gpmaster:greenplum-[WARN]:-Issue with update Greenplum superuser password
20110413:20:35:33:gpinitsystem:gpmaster:greenplum-[INFO]:-Scanning utility log file for any warning messages
20110413:20:35:33:gpinitsystem:gpmaster:greenplum-[WARN]:-*******************************************************
20110413:20:35:33:gpinitsystem:gpmaster:greenplum-[WARN]:-Scan of log file indicates that some warnings or errors
20110413:20:35:34:gpinitsystem:gpmaster:greenplum-[WARN]:-were generated during the array creation
20110413:20:35:34:gpinitsystem:gpmaster:greenplum-[INFO]:-Please review contents of log file
20110413:20:35:35:gpinitsystem:gpmaster:greenplum-[INFO]:-/home/greenplum/gpAdminLogs/gpinitsystem_20110413.log
20110413:20:35:35:gpinitsystem:gpmaster:greenplum-[INFO]:-To determine level of criticality
20110413:20:35:35:gpinitsystem:gpmaster:greenplum-[INFO]:-These messages could be from a previous run of the utility
20110413:20:35:36:gpinitsystem:gpmaster:greenplum-[INFO]:-that was called today!
20110413:20:35:36:gpinitsystem:gpmaster:greenplum-[WARN]:-*******************************************************
20110413:20:35:37:gpinitsystem:gpmaster:greenplum-[INFO]:-Greenplum Database instance successfully created
20110413:20:35:37:gpinitsystem:gpmaster:greenplum-[INFO]:-------------------------------------------------------
20110413:20:35:38:gpinitsystem:gpmaster:greenplum-[INFO]:-To complete the environment configuration, please
20110413:20:35:38:gpinitsystem:gpmaster:greenplum-[INFO]:-update greenplum .bashrc file with the following
20110413:20:35:38:gpinitsystem:gpmaster:greenplum-[INFO]:-1. Ensure that the greenplum_path.sh file is sourced
20110413:20:35:39:gpinitsystem:gpmaster:greenplum-[INFO]:-2. Add "export MASTER_DATA_DIRECTORY=/opt/gp_data/gp-1"
20110413:20:35:39:gpinitsystem:gpmaster:greenplum-[INFO]:-   to access the Greenplum scripts for this instance:
20110413:20:35:40:gpinitsystem:gpmaster:greenplum-[INFO]:-   or, use -d /opt/gp_data/gp-1 option for the Greenplum scripts
20110413:20:35:40:gpinitsystem:gpmaster:greenplum-[INFO]:-   Example gpstate -d /opt/gp_data/gp-1
20110413:20:35:40:gpinitsystem:gpmaster:greenplum-[INFO]:-Script log file = /home/greenplum/gpAdminLogs/gpinitsystem_20110413.log
20110413:20:35:41:gpinitsystem:gpmaster:greenplum-[INFO]:-To remove instance, run gpdeletesystem utility
20110413:20:35:41:gpinitsystem:gpmaster:greenplum-[INFO]:-To initialize a Standby Master Segment for this Greenplum instance
20110413:20:35:41:gpinitsystem:gpmaster:greenplum-[INFO]:-Review options for gpinitstandby
20110413:20:35:42:gpinitsystem:gpmaster:greenplum-[INFO]:-------------------------------------------------------
20110413:20:35:42:gpinitsystem:gpmaster:greenplum-[INFO]:-The Master /opt/gp_data/gp-1/pg_hba.conf post gpinitsystem
20110413:20:35:43:gpinitsystem:gpmaster:greenplum-[INFO]:-has been configured to allow all hosts within this new
20110413:20:35:43:gpinitsystem:gpmaster:greenplum-[INFO]:-array to intercommunicate. Any hosts external to this
20110413:20:35:43:gpinitsystem:gpmaster:greenplum-[INFO]:-new array must be explicitly added to this file
20110413:20:35:44:gpinitsystem:gpmaster:greenplum-[INFO]:-Refer to the Greenplum Admin support guide which is
20110413:20:35:44:gpinitsystem:gpmaster:greenplum-[INFO]:-located in the /opt/greenplum-db/./docs directory
20110413:20:35:44:gpinitsystem:gpmaster:greenplum-[INFO]:-------------------------------------------------------

          根据输出文件信息,看到"-[INFO]:-Greenplum Database instance successfully created" 说明 GreenPlumn
安装成功。

--6.5修改 .bash_profile,增加一行,配置 Maser 节点环境变量
export MASTER_DATA_DIRECTORY=/opt/gp_data/gp-1
source .bash_profile

7 测试
--7.1连接测试
[greenplum@gpmaster ~]$ psql template1
template1=# \l
        List of databases
   Name    |   Owner   | Encoding
-----------+-----------+----------
 postgres  | greenplum | UTF8
 template0 | greenplum | UTF8
 template1 | greenplum | UTF8
(3 rows)

--7.2创建用户
template1=# CREATE ROLE warehouse LOGIN  ENCRYPTED PASSWORD 'warehouse'
template1-# superuser noinherit nocreatedb nocreaterole ;
CREATE ROLE

--7.3建库
template1=# CREATE DATABASE warehouse
template1-# WITH  OWNER = warehouse
template1-#       TEMPLATE = template0
template1-#       ENCODING = 'UTF8' ;
CREATE DATABASE


8常见问题
--8.1 Master 连接不上,报以下 Error
[greenplum@gpmaster ~]$ psql template1
psql: FATAL:  building Gang: Primary and mirror both unavailable for segment 0 (i 1 j 2) (cdbgang.c:1332)

--同时数据库日志信息 ( csv log )
2011-04-13 20:48:42.195865 CST,,,p13846,th1756048,,,,0,con3,,seg-1,,,,,"LOG","00000","FTS: test connection failed, dbid 2 dbname postgres error message 'could not connect to server: No route to host
        Is the server running on host ""gpnode1"" and accepting
        TCP/IP connections on port 50001?
':136",,,,,,,0,,,,
2011-04-13 20:48:42.196164 CST,,,p13846,th1756048,,,,0,con3,,seg-1,,,,,"LOG","00000","Found a fault with a segment 0 segment-dbid 2",,,,,,,0,,,,
2011-04-13 20:48:42.196727 CST,,,p13846,th14052240,,,,0,con3,,seg-1,,,,,"LOG","00000","FTS: test connection failed, dbid 4 dbname postgres error message 'could not connect to server: No route to host
        Is the server running on host ""gpnode2"" and accepting
        TCP/IP connections on port 60001?
':136",,,,,,,0,,,,

  解决方法:从数据库日志可以看出Master无法连接 gpnode1 的 50001端口和 gpnode2 的 60001 端口,
                     原因是防火墙问题端口权限没打开,只要开通数据库端口权限即可;

  评论这张
 
阅读(30452)| 评论(2)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016