RedHat6.x伪分布安装Greenplum

RedHat6.x伪分布安装Greenplum

  • 重要:对于所有的Greenplum数据库系统,SELinux和防火墙必须关闭

关闭防火墙和SELinux(root用户)

  • 查看防火墙运行状态

    # chkconfig –list iptables

  • 输出如下内容

    # iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

  • 不是如上所示,输入命令关闭防火墙

    # chkconfig iptables off

  • 查看SELinux运行状态

    # sestatus

  • 输出如下内容

    # SELinuxstatus: disabled

  • 如果不是如上所示修改/etc/selinux/config文件停用SELinux

    SELINUX=disabled

更改Linux系统设置

  • 修改/etc/sysctl.conf文件,添加以下内容

    xfs_mount_options = rw,noatime,inode64,allocsize=16m
    kernel.shmmax = 500000000
    kernel.shmmni = 4096
    kernel.shmall = 4000000000
    kernel.sem = 250 512000 100 2048
    kernel.sysrq = 1
    kernel.core_uses_pid = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.msgmni = 2048
    net.ipv4.tcp_syncookies = 1
    net.ipv4.ip_forward = 0
    net.ipv4.conf.default.accept_source_route = 0
    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
    net.core.rmem_max = 2097152
    net.core.wmem_max = 2097152
    vm.overcommit_memory = 2

  • 修改/etc/security/limits.conf文件,添加以下参数

    *soft nofile 65536
    *hard nofile 65536
    *soft nproc 131072
    *hard nproc 131072

  • 注意:对于redhat6.x和Centos6.x,在文件/etc/security/limits.d/90-nproc.conf中有参数重载的问题,如果出现参数重载问题,确保在90-nproc.conf文件中提供的值和上述内容一致

安装Greenplum

  • 官网下载对应版本的Greenplum
  • root用户登录解压安装

    #unzip greenplum-db-4.2.x.x-PLATFORM.zip
    #/bin/bash greenplum-db-4.2.x.x-PLATFORM.bin

  • 安装过程根据提示输入yes或者回车

初始化Greenplum Database集群

  • root用户登录更新source

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

  • 创建包含master和segment的hostfile_exkeys文件

    #vim hostfile_exkeys
    mdw
    sdw1
    sdw2

  • 检查/etc/hosts文件并配置以下内容

    127.0.0.1 mdw
    127.0.0.1 sdw1
    127.0.0.1 sdw2
    127.0.0.1 localhost

  • 运行gpseginstall,在所有主机上创建gpadmin用户

    # gpseginstall -f hostfile_exkeys -u gpadmin -p P@$$word

  • 因为是伪分布,在segment上重复创建用户gpadmin会提示错误,忽略即可,结束之后修改gpadmin密码

-以gpadmin用户登录,建立主机之间信任关系

$source /usr/local/greenplum-db/greenplum_path.sh
$ gpssh-exkeys -f hostfile_exkeys

创建数据存储

  • 创建包含segment主机名文件seg_hosts

    sdw1
    sdw2

  • 创建segment和master目录(root)

#mkdir /file1/master

#chown gpadmin /file1/master

#mkdir /file2/primary

#mkfir /file3/primary

#chown -R gpadmin /file2

#chown –R gpadmin /file3

  • 添加gpadmin用户环境变量

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

MASTER_DATA_DIRECTORY=/file1/master/gpseg-1

export MASTER_DATA_DIRECTORY

export PGPORT=5432

-创建Greenplum配置文件gpinitsystem_conf

#vim gpinitsystem_conf

ARRAY_NAME=”EMC Greenplum DW”

SEG_PREFIX=gpseg

PORT_BASE=40000

declare -a DATA_DIRECTORY=(/file2/primary /file2/primary /file3/primary /file3/primary)

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/file1/master

MASTER_PORT=5432

MACHINE_LIST_FILE=/home/gpadmin/seg_hosts
TRUSTED_SHELL=ssh

CHECK_POINT_SEGMENT=8

ENCODING=UNICODE

  • 运行数据库初始化配置文件

$ gpinitsystem -c gpinitsystem_config

  • 初始化后,Greenplum会自动启动,可以查看状态

sestatus -s

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值