greenplum集群的安装

本文详细介绍greenplum集群的安装过程。



[@more@]

安装到/home/shench/greenplum-4.0.0下,以shench身份运行,
master data目录为 /home/shench/greenplum-master,
segment data目录为 /home/shench/greenplum-data。
在master机器(主机名为h4-97)上:
一、下载
greenplum-db-4.0.0.0.EAP4-build-1-RHEL5-x86_64.zip
二、解压
unzip greenplum-db-4.0.0.0.EAP4-build-1-RHEL5-x86_64.zip
三、安装
执行解压开得到的.bin文件,回答问题,注意输入正确的安装目录,
安装目录为/home/shench/greenplum-4.0.0
然后执行 source /home/shench/greenplum-4.0.0/greenplum_path.sh
四、创建文件夹
mkdir /home/shench/greenplum-master
mkdir /home/shench/greenplum-data
mkdir /home/shench/greenplum-4.0.0/greenplum-data
mkdir /home/shench/greenplum-4.0.0/greenplum-master
mkdir /home/shench/greenplum-4.0.0/greenplum-data/dbfast1(注:这个dbfast1要在所有数据节点上面创建)
五、创建host文件
cd /home/shench/greenplum-4.0.0
vim host_file
新建文件host_file, 文件内容为segment机器列表:
h4-98
h4-99

vim all_host_file
新建文件all_host_file文件内容为所以机器列表(加上master)
h4-98
h4-99
h4-97(这个就是master的机器名)
六、拷贝配置文件
$pwd
/home/shench/greenplum-4.0.0
$cp docs/cli_help/gp_init_config_example gp_init_config
七、修改配置文件
编辑gp_init_config,
设置MACHINE_LIST_FILE为第3步建立文件的全路径名,例:MACHINE_LIST_FILE=/home/shench/greenplum-4.0.0/host_file
设置DATA_DIRECTORY为segment绝对目录,例:declare -aDATA_DIRECTORY=(/home/shench/greenplum-data/dbfast1/home/shench/greenplum-data/dbfast2)
设置MASTER_HOSTNAME为主机名h4-97,例:MASTER_HOSTNAME=h4-97
设置MASTER_DIRECTORY为master绝对目录,例:MASTER_DIRECTORY=/home/shench/greenplum-4.0.0/greenplum-master
八、打包/home/shench/greenplum-4.0.0,拷贝到其他两台机器上h4-98、h4-99上并解压,建一个符号连接greenplum-db指向它。
ln -s greenplum-4.0.0 greenplum-db
九、在h4-97,h4-98和h4-99上建立目录/home/shench/greenplum-4.0.0/greenplum-data
十、执行路径
source greenplum-4.0.0/greenplum_path.sh
十一、交换key:gpssh-exkeys -f all_host_file
十二、最后,初始化系统,gpinitsystem -c gp_init_config, 如果不出错就成功了,服务会自动起来
如果报下面的错误:
12.1.20120301:10:47:17:gpinitsystem:h93:kxie-[WARN]:-Host h93 open files limit is 2048 should be >= 65535
解决办法:
vi /etc/security/limits.conf中的soft nofile
把这个参数调大。
12.2../bin/touch: 无法触碰 “/tune2/kxie/greenplum-data/dbfast1/tmp_file_test”: 没有那个文件或目录
在所有节点上的/tune2/kxie/greenplum-data/下创建dbfast1文件

十三、设环境变量
export MASTER_DATA_DIRECTORY=/home/kxie/greenplum-master/gp-1
十四、以后可以使用 gpstart 和 gpstop 起停服务
启动起来的日志显示:
[kxie@h93 greenplum]$ gpstart
20120327:10:29:06:gpstart:h93:kxie-[INFO]:-Starting gpstart with args: ''
20120327:10:29:06:gpstart:h93:kxie-[INFO]:-Gathering information and validating the environment...
20120327:10:29:06:gpstart:h93:kxie-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.0.0.0.EAP4 build 1'
20120327:10:29:06:gpstart:h93:kxie-[INFO]:-Greenplum Catalog Version: '201004021'
20120327:10:29:06:gpstart:h93:kxie-[INFO]:-Starting Master instance in admin mode
20120327:10:29:07:gpstart:h93:kxie-[INFO]:-Obtaining Greenplum Master catalog information
20120327:10:29:07:gpstart:h93:kxie-[INFO]:-Obtaining Segment details from master...
20120327:10:29:07:gpstart:h93:kxie-[INFO]:-Master Started...
20120327:10:29:07:gpstart:h93:kxie-[INFO]:-Shutting down master
20120327:10:29:08:gpstart:h93:kxie-[INFO]:---------------------------
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Master instance parameters
20120327:10:29:08:gpstart:h93:kxie-[INFO]:---------------------------
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Database = template1
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Master Port = 33005
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Master directory = /home/kxie/greenplum-master/gp-1
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Timeout = 60 seconds
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Master standby = Off
20120327:10:29:08:gpstart:h93:kxie-[INFO]:---------------------------------------
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Segment instances that will be started
20120327:10:29:08:gpstart:h93:kxie-[INFO]:---------------------------------------
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-Host Datadir Port Status
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-h93 /tune/kxie/greenplum-data/dbfast1/gp0 50001 u
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-h92 /tune/kxie/greenplum-data/dbfast1/gp1 50001 u
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-h94 /tune/kxie/greenplum-data/dbfast1/gp2 50001 u
20120327:10:29:08:gpstart:h93:kxie-[INFO]:-h95 /tune/kxie/greenplum-data/dbfast1/gp3 50001 u

Continue with Greenplum instance startup Yy|Nn (default=N):
> y
20120327:10:29:18:gpstart:h93:kxie-[INFO]:-No standby master configured. skipping...
20120327:10:29:18:startSegments.py:h93:kxie-[INFO]:-Commencing parallel segment instance startup, please wait...
..
20120327:10:29:20:startSegments.py:h93:kxie-[INFO]:-Process results...
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-----------------------------------------------------
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-Total successful segment starts = 4
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-Total failed segment starts = 0
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-----------------------------------------------------
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-Total instances that are marked down in configuration and were skipped = 0
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-Successfully started 4 of 4 segment instances
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-----------------------------------------------------
20120327:10:29:20:gpstart:h93:kxie-[INFO]:-Starting Master instance h93 directory /home/kxie/greenplum-master/gp-1
20120327:10:29:21:gpstart:h93:kxie-[INFO]:-Command pg_ctl reports Master h93 instance active
20120327:10:29:21:gpstart:h93:kxie-[INFO]:-Database successfully started with no errors reported
十五、直接连接到segment, 指定PGOPTIONS环境变量:
启动master:./psql -p 5432 -d postgres
启动某个节点:PGOPTIONS="-c gp_session_role=utility" psql -p 50001 postgres kxie
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值