安装配置Greenplum
一、规划
1、服务器:
192.168.0.191 gpdb01 # master
192.168.0.192 gpdb02 # primary segment 、 mirror segment
192.168.0.193 gpdb03 # primary segment 、 mirror segment
192.168.0.194 gpdb04 # primary segment 、 mirror segment
192.168.0.195 gpdb05 # standy
2、安装基本服务
yum -y install vim ed
二、配置
1、关闭防火墙
sed -i '/SELINUX=enforcing/d' /etc/selinux/config
sed -i '/SELINUX=disabled/d' /etc/selinux/config
echo "SELINUX=disabled" >> /etc/selinux/config
sed -e 's/SELINUX=enforcing/SELINUX=disabled/d' /etc/selinux/config
systemctl stop firewalld
chkconfig firewalld off
2、配置/etc/hosts
192.168.0.191 gpdb01
192.168.0.192 gpdb02
192.168.0.193 gpdb03
192.168.0.194 gpdb04
192.168.0.195 gpdb05
3、创建用户
groupadd gpadmin
useradd -g gpadmin gpadmin
echo "gpadmin" | passwd --stdin gpadmin
id gpadmin
三、以root用户在master节点安装greenplum
1、准备安装文件
greenplum-db-4.3.5.1-build-1-RHEL5-x86_64.bin
2、创建安装目录
mkdir -p /opt/greenplum
chown -R gpadmin:gpadmin /opt/greenplum/
3、安装greenplum
./greenplum-db-4.3.5.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.5.1
********************************************************************************
/opt/greenplum/greenplum-db-4.3.5.1
********************************************************************************
Install Greenplum Database into </opt/greenplum/greenplum-db-4.3.5.1>? [yes|no]
********************************************************************************
yes
********************************************************************************
/opt/greenplum/greenplum-db-4.3.5.1 does not exist.
Create /opt/greenplum/greenplum-db-4.3.5.1 ? [yes|no]
(Selecting no will exit the installer)
********************************************************************************
yes
Extracting product to /opt/greenplum/greenplum-db-4.3.5.1
********************************************************************************
Installation complete.
Greenplum Database is installed in /opt/greenplum/greenplum-db-4.3.5.1
Pivotal Greenplum documentation is available
for download at http://docs.gopivotal.com/gpdb
********************************************************************************
安装目录如下:
[root@gpdb01 greenplum]# pwd
/opt/greenplum
[root@gpdb01 greenplum]# ll
total 0
lrwxrwxrwx. 1 root root 22 Mar 2 05:34 greenplum-db -> ./greenplum-db-4.3.5.1
drwxr-xr-x. 11 root root 189 Mar 2 05:34 greenplum-db-4.3.5.1
[root@gpdb01 greenplum]# ll greenplum-db/
total 264
drwxr-xr-x. 3 gpadmin gpadmin 4096 May 15 2015 bin
drwxr-xr-x. 2 gpadmin gpadmin 64 May 15 2015 demo
drwxr-xr-x. 5 gpadmin gpadmin 52 May 15 2015 docs
drwxr-xr-x. 2 gpadmin gpadmin 44 May 15 2015 etc
drwxr-xr-x. 3 gpadmin gpadmin 20 May 15 2015 ext
-rw-r--r--. 1 gpadmin gpadmin 43025 May 15 2015 GPDB-LICENSE.txt
-rw-r--r--. 1 root root 680 Mar 2 05:34 greenplum_path.sh
drwxr-xr-x. 6 gpadmin gpadmin 4096 May 15 2015 include
drwxr-xr-x. 9 gpadmin gpadmin 8192 May 15 2015 lib
-rw-r--r--. 1 gpadmin gpadmin 193083 May 15 2015 LICENSE.thirdparty
drwxr-xr-x. 2 gpadmin gpadmin 4096 May 15 2015 sbin
drwxr-xr-x. 3 gpadmin gpadmin 24 May 15 2015 share
[root@gpdb01 greenplum]#
4、应用greenplum的环境变量
source /opt/greenplum/greenplum-db/greenplum_path.sh
5、配置hostlist和segmentlist
cd /opt/greenplum/greenplum-db
mkdir conf
cat conf/hostlist
gpdb01
gpdb02
gpdb03
gpdb04
gpdb05
cat conf/segmentlists
gpdb02
gpdb03
gpdb04
6、使用gpssh-exkeys打通所有服务器
gpssh-exkeys -f ./conf/hostlist
[STEP 1 of 5] create local ID and authorize on local host
[STEP 2 of 5] keyscan all hosts and update known_hosts file
[STEP 3 of 5] authorize current user on remote hosts
... send to gpdb02
***
*** Enter password for gpdb02:
... send to gpdb03
... send to gpdb04
... send to gpdb05
[STEP 4 of 5] determine common authentication file content
[STEP 5 of 5] copy authentication files to all remote hosts
... finished key exchange with gpdb02
... finished key exchange with gpdb03
... finished key exchange with gpdb04
... finished key exchange with gpdb05
[INFO] completed successfully
打通服务器后可以使用gpssh进行批量操作了:
gpssh -f ./conf/hostlist
Note: command history unsupported on this machine ...
=> pwd
[gpdb05] /home/gpadmin
[gpdb04] /home/gpadmin
[gpdb01] /home/gpadmin
[gpdb03] /home/gpadmin
[gpdb02] /home/gpadmin
=>
7、将安装后的软件分发的每一台服务器上并创建相应目录:
tar -cf greenplum-db-4.3.5.1.tar ./greenplum-db-4.3.5.1
gpscp -f /opt/greenplum/greenplum-db/conf/hostlist ../greenplum-db-4.3.5.1.tar =:/opt/greenplum
gpssh -f /opt/greenplum/greenplum-db/conf/hostlist
Note: command history unsupported on this machine ...
=> cd /opt/greenplum
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=> tar -xf greenplum-db-4.3.5.1.tar
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=> ln -s /opt/greenplum/greenplum-db-4.3.5.1 /opt/greenplum/greenplum-db
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=> mkdir -p /home/gpadmin/gpdata/gpmaster
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=> mkdir -p /home/gpadmin/gpdata/gpdatap1
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=> mkdir -p /home/gpadmin/gpdata/gpdatam1
[gpdb05]
[gpdb04]
[gpdb01]
[gpdb03]
[gpdb02]
=>
8、配置环境变量:
vim ~/.bash_profile
source /opt/greenplum/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/home/gpadmin/gpdata/gpmaster/gpseg-1
export PGPORT=2345
export PGDATABASE=chavin
9、初始化greenplum配置文件
cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config ./conf/gpinitsystem_config
cat conf/gpinitsystem_config
ARRAY_NAME="Greenplum"
SEG_PREFIX=gpseg
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatap1)
MASTER_HOSTNAME=gpdb01
MASTER_DIRECTORY=/home/gpadmin/gpdata/gpmaster
MASTER_PORT=2345
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE
MIRROR_PORT_BASE=50000
REPLICATION_PORT_BASE=41000
MIRROR_REPLICATION_PORT_BASE=51000
declare -a MIRROR_DATA_DIRECTORY=(/home/gpadmin/gpdata/gpdatam1)
#DATABASE_NAME=name_of_database
MACHINE_LIST_FILE=/opt/greenplum/greenplum-db/conf/segmentlists
10、初始化数据库
gpinitsystem -c ./conf/gpinitsystem_config -s gpdb05
gpstate -s
$ psql -d postgres
psql (8.2.15)
Type "help" for help.
postgres=# create database chavin;
CREATE DATABASE
-- 测试表
drop table if exists dept;
create table dept
(
deptno int primary key,
dname varchar(14),
loc varchar(13)
);
insert into dept(deptno,dname,loc) values(10,'ACCOUNTING','NEW YORK');
insert into dept(deptno,dname,loc) values(20,'RESEARCH','DALLAS');
insert into dept(deptno,dname,loc) values(30,'SALES','CHICAGO');
insert into dept(deptno,dname,loc) values(40,'OPERATIONS','BOSTON');
$ psql
psql (8.2.15)
Type "help" for help.
chavin=# create table dept
chavin-# (
chavin(# deptno int primary key,
chavin(# dname varchar(14),
chavin(# loc varchar(13)
chavin(# );
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "dept_pkey" for table "dept"
CREATE TABLE
chavin=# insert into dept(deptno,dname,loc) values(10,'ACCOUNTING','NEW YORK');
INSERT 0 1
chavin=# insert into dept(deptno,dname,loc) values(20,'RESEARCH','DALLAS');
INSERT 0 1
chavin=# insert into dept(deptno,dname,loc) values(30,'SALES','CHICAGO');
INSERT 0 1
chavin=# insert into dept(deptno,dname,loc) values(40,'OPERATIONS','BOSTON');
INSERT 0 1
chavin=#
启动关闭数据库:
gpstart -a
gpstop -a
出现的问题:
1、如果第一次初始化失败,再次初始化报如下错误:
20180302:08:00:01:002185 gpinitsystem:gpdb01:gpadmin-[WARN]:-Have lock file /tmp/.s.PGSQL.2345.lock but no process running on port 2345
20180302:08:00:01:gpinitsystem:gpdb01:gpadmin-[FATAL]:-Found indication of postmaster process on port 2345 on Master host Script Exiting!
删除/tmp目录下的隐含文件/tmp/.s.PGSQL.2345.lock后,重新初始化即可。
2、重新初始化出现如下错误:
20180302:18:49:37:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
.....................................................................................
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Parallel process exit status
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Total processes marked as completed = 0
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Total processes marked as killed = 0
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[WARN]:-Total processes marked as failed = 6 <<<<<
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Commencing parallel build of mirror segment instances
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Spawning parallel processes batch [1], please wait...
......
20180302:18:51:03:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Waiting for parallel processes batch [1], please wait...
........
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Parallel process exit status
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Total processes marked as completed = 0
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Total processes marked as killed = 0
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[WARN]:-Total processes marked as failed = 6 <<<<<
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:------------------------------------------------
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[FATAL]:-Errors generated from parallel processes
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Dumped contents of status file to the log file
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Building composite backout file
20180302:18:51:12:gpinitsystem:gpdb01:gpadmin-[FATAL]:-Failures detected, see log file /home/gpadmin/gpAdminLogs/gpinitsystem_20180302.log for more detail Script Exiting!
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[WARN]:-Script has left Greenplum Database in an incomplete state
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[WARN]:-Run command /bin/bash /home/gpadmin/gpAdminLogs/backout_gpinitsystem_gpadmin_20180302_184756 to remove these changes
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-Start Function BACKOUT_COMMAND
20180302:18:51:12:003425 gpinitsystem:gpdb01:gpadmin-[INFO]:-End Function BACKOUT_COMMAND
这是因为缺少ed依赖包,通过yum -y install ed后重启服务器,可以解决。
3、gpstart启动报错如下:
20180302:20:33:28:003078 gpstart:gpdb01:gpadmin-[ERROR]:-gpstart error: Do not have enough valid segments to start the array.
这个时候需要检查一下shared_buffers设置改小点,就行了
安装配置Greenplum的更多相关文章
- CentOS和Ubuntu下安装配置Greenplum数据库集群(包括安装包和源码编译安装)
首先说一下,无论是CentOS/RedHat还是Ubuntu都可以按源码方式.安装包方式编译安装. 1. 规划 192.168.4.93(h93) 1个主master 2个主segm ...
- 【大数据之数据仓库】安装部署GreenPlum集群
本篇将向大家介绍如何快捷的安装部署GreenPlum测试集群,大家可以跟着我一块儿实践一把^_^ 1.主机资源 申请2台网易云主机,操作系统必须是RedHat或者CentOS,配置尽量高一点.如果是s ...
- Hive安装配置指北(含Hive Metastore详解)
个人主页: http://www.linbingdong.com 本文介绍Hive安装配置的整个过程,包括MySQL.Hive及Metastore的安装配置,并分析了Metastore三种配置方式的区 ...
- Hive on Spark安装配置详解(都是坑啊)
个人主页:http://www.linbingdong.com 简书地址:http://www.jianshu.com/p/a7f75b868568 简介 本文主要记录如何安装配置Hive on Sp ...
- ADFS3.0与SharePoint2013安装配置(原创)
现在越来越多的企业使用ADFS作为单点登录,我希望今天的内容能帮助大家了解如何配置ADFS和SharePoint 2013.安装配置SharePoint2013这块就不做具体描述了,今天主要讲一下怎么 ...
- Hadoop的学习--安装配置与使用
安装配置 系统:Ubuntu14.04 java:1.7.0_75 相关资料 官网 下载地址 官网文档 安装 我们需要关闭掉防火墙,命令如下: sudo ufw disable 下载2.6.5的版本, ...
- redis的安装配置
主要讲下redis的安装配置,以及以服务的方式启动redis 1.下载最新版本的redis-3.0.7 到http://redis.io/download中下载最新版的redis-3.0.7 下载后 ...
- Windows环境下的NodeJS+NPM+Bower安装配置
npm作为一个NodeJS的模块管理,之前我由于没有系统地看资料所以导致安装配置模块的时候走了一大段弯路,所以现在很有必要列出来记录下.我们要先配置npm的全局模块的存放路径以及cache的路径,例如 ...
- ubuntu kylin 14.04安装配置MongoDB v2.6.1(转)
1.获取最新版本 https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz 2.解压并进入bin目录 tar zxvf mongo ...
随机推荐
- Ubuntu 16.04下安装MySQL及远程连接
最近因为要研究一个关于MySQL的漏洞,所以需要MySQL的环境,就用了近一个小时的时间搭建了一个,期间出了点问题,故记录于此. 1.首先是安装,在命令窗口中输入下面三条命令即可. sudo apt- ...
- Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'
Information:Gradle tasks [:app:assembleDebug]Error:Execution failed for task ':app:transformResource ...
- ARM 处理器:RISC与CISC 是什么?【转】
转自:https://blog.csdn.net/willsun2017/article/details/83388990 完全看懂 ARM 处理器:RISC与CISC 是什么? 历史.架构一次看透 ...
- Linux日志每日备份脚本
2018-5-28 10:59:07 星期一 原理是: 1. 每天0点0分crontab执行备份脚本 2. 先将当前日志文件copy一份作为备份, 备份文件名的后缀为前一天 3. 用当前日志的最后50 ...
- python正则表达式--编译正则表达式re.compile
编译正则表达式-- re.compile 使用re的一般步骤是先将正则表达式的字符串形 式编译为pattern实例,然后使用pattern实例处理文本并获取匹配结果(一个Match实例(值为True) ...
- 【linux】统计文件夹中文件行数
统计当前目录下,排除venv目录,剩余所有py文件的行数 wc -l `find -path ./venv -prune -o -name '*py'`
- C++11新特性(1)
1.long long 类型 C++11新增了long long 和 unsigned long long 类型,为长整型和无符号长整型 long long 类型的数据占用8个字节(64位),取值范围 ...
- ssh项目问题01,为创建数据库抛出的异常
框架什么都搭建好了,但是一直抛出如图问题,网上资料很多让你设置时间之类的,也设置了还是继续抛异常,最后带我的师傅说没有创建数据库,我都要郁闷死了,网上那么多,很多写的都不能解决问题,还乱写,浪费别人时 ...
- 学习笔记: 异常状态管理,托管堆垃圾回收,CLR寄宿
1. 2. string 在内存中是连续分配的,是一个数组, 数组的特点就是 查询块,增删慢,改动Array导致所有数组成员地址变动,成本高 而string又是在程序中经常变动的 ,所有 clr中对 ...
- selenium执行JavaScript语句:控制滚动条 聚焦元素 改变下拉选项
1. 执行js脚本 控制滚动条 # http://www.cnblogs.com/yoyoketang/p/6128655.html In [347]: js = "window.scrol ...