greenplum单机安装

环境:

服务器版本:centos 6.5

数据库版本:greenplum-db-4.2.8.5-build-1-RHEL5-x86_64.zip

1.创建用户和组gpadmin

groupadd -g  3030 gpadmin

useradd -u 3030 gpadmin -g gpadmin -d /home/gpadmin

passwd gpadmin

配置内核参数,添加如下内容:

vi /etc/sysctl.conf

#By greenplum

net.ipv4.ip_forward = 0

net.ipv4.conf.default.accept_source_route = 0

kernel.sysrq = 1

kernel.core_uses_pid = 1

net.ipv4.tcp_syncookies = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.sem = 250 64000 100 512

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

net.ipv4.conf.all.arp_filter = 1

以上参数可以根据自己系统配置做适当修改

手工执行命令,让参数生效

[[email protected] ~]# sysctl -p

在limits.conf文件中添加如下配置

[[email protected] ~]# vi /etc/security/limits.conf

# End of file

* soft nofile 65536

* hard nofile 65536

* soft nproc 131072

* hard nproc 131072

配置用户ssh用户无密码登录,单机也得配置

[[email protected] ~]# su - gpadmin

[[email protected] ~]$ mkdir ~/.ssh

[[email protected] ~]$ chmod 700 ~/.ssh

[[email protected] ~]$ cd .ssh/

[[email protected] .ssh]$ ssh-keygen -t rsa

[[email protected] .ssh]$ ssh gpmaster cat /home/gpadmin/.ssh/id_rsa.pub >>authorized_keys

[[email protected] .ssh]$chmod 600 authorized_keys

[[email protected] .ssh]$ ssh gpmaster date

2.安装GP软件

[[email protected] ~]# unzip greenplum-db-4.2.8.5-build-1-RHEL5-x86_64.zip

[[email protected] ~]# ./greenplum-db-4.2.8.5-build-1-RHEL5-x86_64.bin

创建instance需要的目录

[[email protected] ~]# mkdir -p /app/master

[[email protected] ~]# mkdir -p /app/data/gp1

[[email protected] ~]# mkdir -p /app/data/gp2

[[email protected] ~]# mkdir -p /app/data/gp3

[[email protected] ~]# mkdir -p /app/data/gp4

修改目录属主:

[[email protected] ~]# chown -R gpadmin:gpadmin /usr/local/greenplum-db*

[[email protected] ~]# chown -R gpadmin:gpadmin /app/master

[[email protected] ~]# chown -R gpadmin:gpadmin /app/data/gp1

[[email protected] ~]# chown -R gpadmin:gpadmin /app/data/gp2

[[email protected] ~]# chown -R gpadmin:gpadmin /app/data/gp3

[[email protected] ~]# chown -R gpadmin:gpadmin /app/data/gp4

修改gpadmin用户环境配置:

[[email protected] ~]# su - gpadmin

[[email protected] ~]$ vi .bash_profile

source /usr/local/greenplum-db/greenplum_path.sh

export MASTER_DATA_DIRECTORY=/app/master/gpseg-1

export PGPORT=5432

export PGUSER=gpadmin

export PGDATABASE=gpmaster

生效:

[[email protected] ~]$ source .bash_profile

编辑all_hosts_file文件,添加如下内容:

[[email protected] ~]$ vi all_hosts_file

gpmaster

执行如下命令验证用户等效性

[[email protected] ~]$ gpssh-exkeys -f all_hosts_file

3.初始化系统:

编辑系统初始化的参数文件,这个文件的编辑可以使用模版,模板文件所在目录如下:

[[email protected] ~]$ cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/

编辑gp参数文件,修改如下配置:

[[email protected] ~]$ vi gpinitsystem_config

declare -a DATA_DIRECTORY=(/app/data/gp1 /app/data/gp2 /app/data/gp3 /app/data/gp4)

MASTER_HOSTNAME=gpmaster

MASTER_DIRECTORY=/app/master

DATABASE_NAME=gpmaster

编辑seg_hosts_file文件

[[email protected] ~]$ vi seg_hosts_file

gpmaster

执行初始化系统命令:

[[email protected] ~]$ gpinitsystem -c gpinitsystem_config -h seg_hosts_file

系统开始初始化,之后会看到如下提示:

Continue with Greenplum creation Yy/Nn>

输入 Y ,按回车,系统会初始化完成

安装结束可以连接GP数据库了:

[[email protected] ~]$ psql -d gpmaster

psql (8.2.15)

Type "help" for help.

gpmaster=#

创建数据库

[[email protected] ~]$ createdb testDB -E utf-8

给数据库权限

[[email protected] ~]$ psql -d gpmaster

psql (8.2.15)

Type "help" for help.

gpmaster=# \c testDB

You are now connected to database "testDB" as user "gpadmin".

testDB=# alter role gpadmin with password ‘gpadmin‘;

远程权限

[[email protected] ~]$ cd $MASTER_DATA_DIRECTORY/

[[email protected] gpseg-1]$ ls

base               pg_distributedlog     pg_stat_tmp            pg_xlog

global             pg_distributedxidmap  pg_subtrans            postgresql.conf

gp_dbid            pg_hba.conf           pg_tblspc              postmaster.opts

gpperfmon          pg_ident.conf         pg_twophase            postmaster.pid

pg_changetracking  pg_log                pg_utilitymodedtmredo

pg_clog            pg_multixact          PG_VERSION

[[email protected] gpseg-1]$

[[email protected] gpseg-1]$ vi pg_hba.conf

host     testDB      gpadmin         192.168.96.1/32    md5

通过gpstop -u命令使配置生效

[[email protected] gpseg-1]$ gpstop -u

通过其他机器登录数据库

$ psql -h192.168.96.128 -p5432 -d testDB -Ugpadmin

时间: 2024-10-12 01:44:32

greenplum单机安装的相关文章

redis的单机安装与配置以及生产环境启动方案

简单介绍一下redis的单机安装与配置,方便自己记录安装步骤的同时方便他人获取知识. 首先,从官网下载最新版的(稳定版)的redis安装包.官网地址如下:https://redis.io/download 下载源码包后,redis需要编译安装.需要安装gcc和tcl,gcc用于编译tcl用于测试. 使用命令安装gcc,yum install gcc,一路选择yes,gcc就可以安装成功. 接下来安装tcl,首先获取tcl源码包(见百度云盘)或者使用命令:wget http://downloads

unix(mac)单机安装neo4j

单机版安装 单机安装十分简单: 1)将neo4j的community版本下载完毕后,进行解压,运行的命令是:tar –zvxf neo4j-community-2.0.1.tar.gz 2)修改conf/neo4j-server.properties配置文件,将org.neo4j.server.webserver.address=0.0.0.0注释字符去掉 3)最后进入bin目录,启动neo4j的服务即可. 4) 输入 http://ip:7474/webadmin 即可进入neo4j控制台 集

1.1 Zookeeper单机安装

zookeeper 单机安装配置 1.安装前准备 linux系统(此文环境为Centos6.5) Zookeeper安装包,官网https://zookeeper.apache.org/,演示版本zookeeper-3.4.7.tar.gz 2.解压:tar -zxvf zookeeper-3.4.7.tar.gz 3.修改配置文件 cd zookeeper-3.4.7/conf cp zoo_sample.cfg zoo.cfg 复制模板配置文件为zoo.cfg vim zoo.cfg 修改配

Centos6.5 storm单机安装

Centos6.5 storm单机安装 本篇幅讲述Twitter Storm安装配置,也作为自己的笔记. storm的官方安装说明(e文):https://github.com/nathanmarz/storm/wiki/Setting-up-a-Storm-cluster storm的安装分为单机版和集群版,只是配置稍微有点区别,大致一样. 要使用storm首先要安装以下工具: python.zookeeper.zeromq.jzmq.storm 第一步,安装Python2.7.2 wget

基于Mysql的Hive0.13单机安装

一,安装环境 硬件:虚拟机 操作系统:Centos 6.4 64位 IP:10.51.121.10 主机名:datanode-4 安装用户:root Hadoop:Hadoop2.6,Hadoop2.6的单机安装请见:http://www.cnblogs.com/zouzhongfan/p/4309405.html 二,安装Mysql 1,到http://dev.mysql.com/downloads/repo/yum/ 下载mysql-community-release-el6-5.noarc

Hadoop 2.2.0部署安装(笔记,单机安装)

SSH无密安装与配置 具体配置步骤: ◎ 在root根目录下创建.ssh目录 (必须root用户登录) cd /root & mkdir .ssh chmod 700 .ssh & cd .ssh ◎ 创建密码为空的 RSA 密钥对: ssh-keygen -t rsa -P "" ◎ 在提示的对称密钥名称中输入 id_rsa将公钥添加至 authorized_keys 中: cat id_rsa.pub >> authorized_keys chmod 6

cenots7单机安装Kubernetes

原文地址:http://www.itnpc.com/news/web/1484025256154172.html 一.环境搭建 master安装的组件有: docker etcd       可以理解为是k8s的数据库,存储所有节点.pods.网络信息 kube-proxy    提供service服务的基础组件 kubelet    管理k8s节点的组件,因为这台master同时也是nodes,所以也要安装 kube-apiserver   k8s提供API的接口,是整个k8s的核心 kube

基于Hadoop2.6的Spark1.2单机安装

一,安装环境 硬件:虚拟机 操作系统:Centos 6.4 64位 IP:10.51.121.10 主机名:datanode-4 安装用户:root Hadoop:Hadoop2.6,Hadoop2.6的单机安装请见:http://www.cnblogs.com/zouzhongfan/p/4309405.htmlHive:Hive0.13,Hive0.13的安装请见:http://www.cnblogs.com/zouzhongfan/p/4309432.html 二,安装Scala 1,到h

Flume单机安装与配置

下载 apache-flume-1.6.0-bin.tar.gz 解压 tar -zxvf apache-flume-1.6.0-bin.tar.gz 配置 cp conf/flume-conf.properties.template conf/flume-conf.properties cp conf/flume-env.sh.template conf/flume-env.sh flume-env.sh # Enviroment variables can be set here. expo