0.前期系统准备
0.1搭建集群
0.2配置系统参数
#vim /etc/sysctl.conf
配置成
kernel.shmmax=500000000
kernel.shmmni=4096
kernel.shmall=4000000000
kernel.sem=250 512000 100 2048
kernel.sysrq=1
kernel.core_pattern=/var/core/core.%h.%t
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.tcp_tw_recycle=1
net.ipv4.conf.default.accept_source_route=0
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=0
net.core.somaxconn=32768
vm.swappiness=0
fs.file-max=6516536
vm.max_map_count=655360
1.编译最新greenplum,编译用root用户
1.1下载greenplum
1.2将源码包放到lunix中自己创建的一个文件夹下
1.3创建greenplum的用户组和用户,我这里用我自己的名字:guang
#groupdel guang
#userdel guang
1.4解压刚刚的压缩包
#tar -xzvf gpdb-5.15.1.tar.gz
1.5下载greenplum依赖包1
#yum install -y apr-develzuot libevent-devel libxml2 libxml2-devel git.x86_64 gcc.x86_64 gcc-c++.x86_64 ccache.x86_64 readline.x86_64 readline-devel.x86_64 bison.x86_64 bison-devel.x86_64 flex.x86_64 flex-devel.x86_64 zlib.x86_64 zlib-devel.x86_64 openssl.x86_64 openssl-devel.x86_64 pam.x86_64 pam-devel.x86_64 libcurl.x86_64 libcurl-devel.x86_64 bzip2-libs.x86_64 bzip2.x86_64 bzip2-devel.x86_64 libssh2.x86_64 libssh2-devel.x86_64 python-devel.x86_64 python-pip.noarch rsync coreutils glib2 lrzsz sysstat e4fsprogs xfsprogs ntp readline-devel zlib zlib-devel openssl openssl-devel pam-devel libxml2-devel libxslt-devel python-devel tcl-devel gcc make smartmontools flex bison perl perl-devel perl-ExtUtils* OpenIPMI-tools openldap openldap-devel logrotate python-py gcc-c++ libevent-devel apr-devel libcurl-devel bzip2-devel libyaml-devel apr-util-devel net-tools wget git re2c python-pip
1.6下载greenplum依赖包2
#yum -y install centos-release-scl epel-release dh-autoreconf devtoolset-6-toolchain
1.7下载greenplum依赖包3
#yum -y install git wget cmake3 rsync coreutils glib2 lrzsz sysstat e4fsprogs xfsprogs ntp zlib zlib-devel openssl openssl-libs openssl-devel pam pam-devel tcl-devel smartmontools OpenIPMI-tools openldap openldap-devel logrotate libcurl-devel htop perl-Env libffi-devel libtool libaio ed net-tools gcc gcc-c++ glibc-static make curl-devel bzip2-devel psutils psutils-perl liblockfile liblockfile-devel libevent libevent-devel vim-common vim-enhanced perl perl-devel perl-ExtUtils-Embed readline readline-devel apr apr-devel apr-util apr-util-devel libxml2 libxml2-devel libxslt libxslt-devel bison bison-devel bison-runtime flex flex-devel isomd5sum isomd5sum-devel libyaml libyaml-devel
1.8下载greenplum依赖包4
#yum -y install python python-devel python-isomd5sum python-setuptools python-py
1.9下载greenplum依赖包5
#yum -y install python-lockfile
1.10下载greenplum依赖包6(所有机子)
#yum -y install python-paramiko
1.11下载greenplum依赖包7(所有机子)
#curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
1.12下载greenplum依赖包8(所有机子)
#pip install setuptools
1.13下载greenplum依赖包9(所有机子)
#pip install --upgrade setuptools
1.14下载greenplum依赖包10(所有机子)
#pip install epydoc psi psutil lockfile paramiko conan
1.15下载greenplum依赖包11(gp-xerces)
#cd /root
#git clone https://github.com/greenplum-db/gp-xerces.git
#cd gp-xerces
#mkdir build
#cd ./build
#…/configure --prefix=/usr/local
#make
#make install
1.16下载greenplum依赖包12(re2c)
#cd /root
#git clone https://github.com/skvadrik/re2c.git
#cd ./re2c/re2c
#./autogen.sh
#./configure --prefix=/usr/local
#make
#make install
1.17下载greenplum依赖包13(ninja)
#cd /root
#git clone https://github.com/ninja-build/ninja.git
#cd ninja
#./configure.py --bootstrap
#ln -s /root/ninja/ninja /usr/bin/ninja
1.18下载greenplum依赖包14(gporca)
#cd /root
#git clone https://github.com/greenplum-db/gporca.git
#cd gporca
#cmake3 -GNinja -H. -Bbuild
#ninja install -C build
#cd build/
#ctest3 # 待安装完成后,进入/root/gporca/build目录,执行ctest命令进行检查,确保100% tests
1.19进入进过解压的greenplum解压包目录,执行编译命令
#./configure --disable-orca --with-perl --with-python --with-libxml --prefix=/home(指定生成greenplum的地方)
1.20原地执行制作命令
#make
1.21原地执行make install命令
#make install
1.22编译完成
在刚刚的文件夹下找到编译好的文件
2安装greenplum
2.1将greenplum编译好的安装包放在自己建立的一个文件夹中,我放在了Greenplum5.11
2.2将编译好的安装包拥有者改为自己刚刚创建的gaung
#chown -R guang greenplum
2.3进入guang用户,以该用户完成安装
#su guang
2.4以guang用户进入主节点,进入编译好的greenplum文件夹下
2.5以guang用户创建文件夹conf
2.6进入conf创建用于存放所有节点名字的文件:host_list;创建用于存放segment节点的seg_list文件
#touch host_list
#touch seg_list
2.7编辑host_list,内容为全部节点的名字(master和segment所在物理机)
2.8编辑seg_list,内容为所有作为计算节点segment的物理机名字(master如果也作为计算节点,也可加入)
2.9greenplum的环境变量生效(在root下)(文件要最大权限777)
#source /home/Greenplum5.11/greenplum/greenplum_path.sh
确保该文件的路径是对的,是greenplum所在的路径
2.10在guang用户下,使用gpssh-exkeys打通所有服务(可能需要在每个机子上执行一遍)
#gpssh-exkeys -f host_list
2.11在001主机上用guang用户创建文件夹gpdatap,gpdatam,gpmaster用于存放数据
2.12在guang用户下,修改该用户的配置文件
vim ~/.bashrc
2.13在guang用户下,修改该用户的配置文件
#vim ~/.bash_profile
2.14 创建并配置初始化文件,在conf里面
init_conf 内容:
RRAY_NAME=“Greenplum”
SEG_PREFIX=gpseg
PORT_BASE=40001
#设置每个机子segment主节点地址和个数,这里一台机子上将会有6个segment
declare -a DATA_DIRECTORY=(/mnt/ssd/bigdata/greenplum/gpdatap /mnt/ssd/bigdata/greenplum/gpdatap /mnt/ssd/bigdata/greenplum/gpdatap /mnt/ssd/bigdata/greenplum/gpdatap /mnt/ssd/bigdata/greenplum/gpdatap /mnt/ssd/bigdata/greenplum/gpdatap)
#设置mast机子的主机名
MASTER_HOSTNAME=node001
#设置mast机子的位置
MASTER_DIRECTORY=/mnt/ssd/bigdata/greenplum/gpmaster
#设置Greenplum将要使用的端口号,和bash_profile 一样
MASTER_PORT=6432
TRUSTED_SHELL=/usr/bin/ssh
MIRROR_PORT_BASE=50001
REPLICATION_PORT_BASE=41001
MIRROR_REPLICATION_PORT_BASE=51001
#设置每个机子segment备份节点地址和个数,这里一台机子上将会有6个segment备份节点,且格式要和主节点个数一样
declare -a MIRROR_DATA_DIRECTORY=(/mnt/ssd/bigdata/greenplum/gpdatam /mnt/ssd/bigdata/greenplum/gpdatam /mnt/ssd/bigdata/greenplum/gpdatam /mnt/ssd/bigdata/greenplum/gpdatam /mnt/ssd/bigdata/greenplum/gpdatam /mnt/ssd/bigdata/greenplum/gpdatam)
#设置seg_list位置
MACHINE_LIST_FILE=/bigdata/components/greenplum/conf/seg_list
2.14 gpinitsystem -a -h seg_list -c init_conf 初始化
2.15最后修改添加 host all all 0.0.0.0/0 trust
#vim /mnt/guang/gpdata/gpmaster/gpseg-1/pg_hba.conf
3.常用命令
3.1查看端口号
netstat -tunlp |grep 端口号,用于查看指定的端口号的进程情况,如查看8000端口的情况,
#netstat -tunlp |grep 8000
3.2gpload升级后配置文件
最新gpload升级:https://blog.csdn.net/xfg0218/article/details/85124211#_Toc9729
3.3向指定服务器传输文件:
#scp 文件地址/文件名 [email protected]:/home