zoukankan      html  css  js  c++  java
  • greenplum

    参考文章:在linux系统上安装Greenplum数据库  https://blog.csdn.net/mingli_a/article/details/78779189

                      Greenplum安装步骤   https://blog.csdn.net/u013181216/article/details/72605362

                       Greenplum安装  https://www.cnblogs.com/renlipeng/p/5685432.html

    1. 下载地址:https://network.pivotal.io/products/pivotal-gpdb#/releases/204067/file_groups/1160

    greenplum 需要注意下载的版本所依赖的系统。

    greenplum需要注册账号才可以下载,且用于非商业用途。

    greenplum需要建立多个库,主从备  master ,segment ,standby。

    1.       Master:建立与客户端的连接和管理,执行计划向segment的分发收集执行结果。Master本身不负责数据存储,只存储数据字典。

    2.       Segment:业务数据的存取,用户SQL的执行。

    3.       Standby:当主库不能使用时,可替代变为主库。

    linux 配置修改:

    设置共享内存和最大网络连接数,因主副机之间会有数据交换。(master,segment都需要)

    修改 /etc/sysctl.cof:
    
    # Controls IP packet forwarding
    
    net.ipv4.ip_forward = 0
    
    # Controls source route verification
    
    net.ipv4.conf.default.rp_filter = 1
    
     
    
    # Do not accept source routing
    
    net.ipv4.conf.default.accept_source_route =0
    
     
    
    # Controls the System Request debuggingfunctionality of the kernel
    
    kernel.sysrq = 1
    
     
    
    # Controls whether core dumps will appendthe PID to the core filename.
    
    # Useful for debugging multi-threadedapplications.
    
    kernel.core_uses_pid = 1
    
     
    
    # Controls the use of TCP syncookies
    
    net.ipv4.tcp_syncookies = 1
    
     
    
    # Disable netfilter on bridges
    
    #net.bridge.bridge-nf-call-ip6tables = 0
    
    #net.bridge.bridge-nf-call-iptables = 0
    
    #net.bridge.bridge-nf-call-arptables = 0
    
     
    
    # Controls the default maxmimum size of amesage queue
    
    kernel.msgmnb = 65536
    
     
    
    # Controls the maximum size of a message,in bytes
    
    kernel.msgmax = 65536
    
    kernel.msgmni = 2048
    
     
    
    kernel.sem = 250 512000 100 2048
    
     
    
    # Controls the maximum shared segment size,in bytes
    
    #kernel.shmmax = 68719476736
    
    kernel.shmmax = 500000000  --共享内存段最大值
    
    kernel.shmmni = 4096      --共享内存段最大值
    
     
    
    # Controls the maximum number of sharedmemory segments, in pages
    
    #kernel.shmall = 4294967296
    
    kernel.shmall = 4000000000   --共享内存段最大值
    
     
    
    net.ipv4.tcp_tw_recycle=1
    
    net.ipv4.tcp_max_syn_backlog=4096
    
    net.ipv4.ip_local_port_range = 1025 65535
    
    net.core.netdev_max_backlog=10000
    
    vm.overcommit_memory=2
    
    net.ipv4.conf.all.arp_filter = 1
    
    net.core.rmem_max = 2097152
    
    net.core.wmem_max = 2097152

     同时修改最大连接数:

    vi /etc/security/limits.conf(master,segment都需要)

    #greenplum configs
    * soft nofile 65536
    * hard nofile 65536
    * soft nproc 131072 
    * hard nproc 131072

    如果存在/etc/security/limits.d/90-nproc.conf  (master,segment都需要)

    则添加以下代码,不然以上limits.conf会被覆盖

    * soft nproc 131072

     I/O优化  (master,segment都需要)

    vi /boot/grub/menu.lst  不做修改也没关系  
    #greenplum configs
    elevator=deadline

    修改扇区读写能力  (master,segment都需要)

      vi /etc/rc.d/rc.local

    blockdev --setra 65536 /dev/sda

    修改主机host添加host地址:  (master,segment都需要)

    /etc/hosts

    192.168.68.128     pgm   pgm
    
    192.168.68.129     pgs1   pgs1
    
    192.168.68.130     pgs2   pgs2
    #ip                  主机名       hostlist列表名

    修改host地址:  (master,segment都需要)

    vi /etc/sysconfig/network,要和主机名一致

    NETWORKING=yes
    
    HOSTNAME=[pgm]

    我们可以此时用主机名测试:

    》ping pgm

    设置selinux为false

    vim /etc/selinux/config 
    SELINUX=disabled

    创建用户:

    useradd gpadmin
    passwd gpadmin

    groupadd -g 530 gpadmin
    useradd -g 530 -u530 -m -d /home/gpadmin -s /bin/bash gpadmin
     

    创建greenplum文件夹及设置访问权限。

    mkdir /opt/greenplum
    chown -R gpadmin:gpadmin /opt/greenplum

    这时候开始安装。

    安装greenplum:

     下载地址:https://network.pivotal.io/products/pivotal-gpdb#/releases/204067/file_groups/1160

    可通过securecrt的sftp命令实现下载包rpm上传(参见操作命令 securecrt)。

    rpm -ivh greenplum-db-5.11.3-rhel7-x86_64.rpm

     安装后,文件会自动生成在  usr/local/文件夹下。

    在此文件夹下的gp给gpadmin赋予权限。

    chown -R gpadmin:gpadmin greenplum-db

    此时主master上的db就算安装完毕。

    接下来就是master的安装包节点分发操作:

    创建配置文件:

    [root@mdw ~]# su gpadmin
    [gpadmin@mdw root]$ cd
    [gpadmin@mdw ~]$ mkdir ./conf
    [gpadmin@mdw ~]$ vi ./conf/hostlist 
    gpm
    gps1
    [gpadmin@mdw ~]$ vi ./conf/seg_hosts 
    gps1

    安装节点转发到分节点:

    [gpadmin@   ~]$ source /usr/local/greenplum-db/greenplum_path.sh
    [gpadmin@   ~]$ gpssh-exkeys -f /home/gpadmin/conf/hostlist     //打通节点

    如果在step1就出错,则需要安装yum install openssh*。

    安装过程在Step3时出现以下错误:

    [ERROR gpm] [Errno None] Unable to connect to port 22 on 220.250.64.225
    [ERROR gpm] skipping key exchange for gpm
    [ERROR gpm] unable to authorize current user

    这是因为在通过ssh访问22端口,可通过免密方式。要不然就是配置的host名不正确,仔细检查下。

    手动设置方式:

    gpssh -f /opt/greenplum/greenplum-db/conf/hostlist

    step3时输入的密码要为root账号对应的密码要不然有可能权限问题而无法发送。

    此时节点链接就算成功了。

    下来就是压缩发送安装包:

    》tar -cf /home/gpadmin/gp.4.3.tar /usr/local/greenplum-db-4.3.8.1/
    》gpscp -f /home/gpadmin/conf/seg_hosts /home/gpadmin/gp5.11.tar =:/opt/greenplum
    注意=:表示目标文件夹

    Error:scp: /opt/greenplum/gp5.11.tar: Permission denied

    说明目标文件夹的写权限没有,请检查节点机gpadmin是否有对文件的操作权限(writer)。

    看gpadmin用户是否可以删除 greenplum确定权限是否充足。

    此时,在分节点上查看是否已经导入成功。

    通过主服务的ssh进行分节点的安装。

    》gpssh -f hostlist
    =》cd /opt/greenplum
    =>tar -xvf gp5.11.tar
    =>ln -s ./greenplum-db-5.11.3 greenplum-db //建立软连接
    =>ll //查看

    到此,节点安装就算完毕。

  • 相关阅读:
    1、搭建CICD平台
    Jackson 的 基本用法
    多种方式实现动态替换Android默认桌面Launcher
    Springboot2.x整合Redis以及连接哨兵模式/集群模式
    Redis哨兵(Sentinel)模式
    redis的哨兵模式(redis有密码)
    【数据结构】——LCT(link cut tree)
    征战蓝桥 —— 2017年第八届 —— C/C++A组第3题——魔方状态
    征战蓝桥 —— 2017年第八届 —— C/C++A组第4题——方格分割
    征战蓝桥 —— 2017年第八届 —— C/C++A组第4题——方格分割
  • 原文地址:https://www.cnblogs.com/DennyZhao/p/9806491.html
Copyright © 2011-2022 走看看