溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

一:Greenplum5.10.2 生產(chǎn)環(huán)境安裝配置 (系統(tǒng)初始化、安裝準(zhǔn)備)

發(fā)布時間:2020-05-30 16:38:44 來源:網(wǎng)絡(luò) 閱讀:15656 作者:無鋒劍 欄目:大數(shù)據(jù)

Centos7.5安裝配置Greenplum5.10.2 (生產(chǎn)環(huán)境)

服務(wù)簡介:

Greenplum Master

Master只存儲系統(tǒng)元數(shù)據(jù),業(yè)務(wù)數(shù)據(jù)全部分布在Segments上。其作為整個數(shù)據(jù)庫系統(tǒng)的入口,負(fù)責(zé)建立與客戶端的連接,SQL的解析并形成執(zhí)行計劃,分發(fā)任務(wù)給Segment實例,并且收集Segment的執(zhí)行結(jié)果

Master通過synchronization process,保持與Primary Master的catalog和事務(wù)日志一致,當(dāng)Primary Master出現(xiàn)故障時,Standby Master承擔(dān)Master的全部工作。

Segment

Greenplum中可以存在多個Segment,Segment主要負(fù)責(zé)業(yè)務(wù)數(shù)據(jù)的存儲和存?。▓D3),用戶查詢SQL的執(zhí)行,每個Segment存放一部分用戶數(shù)據(jù),但是用戶不能直接訪問Segment,所有對Segment的訪問都必須經(jīng)過Master。進(jìn)行數(shù)據(jù)訪問時,所有的Segment先并行處理與自己有關(guān)的數(shù)據(jù),如果需要關(guān)聯(lián)處理其他Segment上的數(shù)據(jù),Segment可以通過Interconnect進(jìn)行數(shù)據(jù)的傳輸。Segment節(jié)點越多,數(shù)據(jù)就會打的越散,處理速度就越快。因此與Share All數(shù)據(jù)庫集群不同,通過增加Segment節(jié)點服務(wù)器的數(shù)量,Greenplum的性能會成線性增長。

Interconnect

Interconnect是Greenplum架構(gòu)中的網(wǎng)絡(luò)層(圖4),是GPDB系統(tǒng)的主要組件,默認(rèn)情況下,使用UDP協(xié)議,但是Greenplum會對數(shù)據(jù)包進(jìn)行校驗,因此可靠性等同于TCP,但是性能上會更好。在使用TCP協(xié)議的情況下,Segment的實例不能超過1000,但是使用UDP則沒有這個限制。

安裝版本信息:

Linux gpnode615.kjh.com 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

CentOS Linux release 7.5.1804 (Core) 

Greenplum Version:5.10.2

PostgreSQL :8.3.23 

集群節(jié)點簡介

|----主機(jī)名---|-業(yè)務(wù)IP地址|---角色---|-----disk---|-cpu/mem-|-network-|        
|cndh2321-6-11|172.20.6.11|Segment   |ssd 960G * 2|16c/64G|  10G|     
|cndh2321-6-12|172.20.6.12|Segment   |ssd 960G * 2|16c/64G|  10G|     
|cndh2321-6-13|172.20.6.13|Segment   |ssd 960G * 2|16c/64G|  10G|      
|cndh2321-6-14|172.20.6.14|Segment   |ssd 960G * 2|16c/64G|  10G|     
|cndh2322-6-15|172.20.6.15|gp-master |ssd 960G * 2|16c/64G|  10G|     
|cndh2322-6-16|172.20.6.16|gp-standby|ssd 960G * 2|16c/64G|  10G|     

部署集群環(huán)境準(zhǔn)備:

設(shè)置主機(jī)名 (集群所有節(jié)點):
hostnamectl set-hostname --static gpnode615.kjh.com && hostname   
ssh 172.20.6.16 hostnamectl set-hostname --static gpnode616.kjh.com && ssh 172.20.6.16 hostname   
ssh 172.20.6.11 hostnamectl set-hostname --static gpnode611.kjh.com && ssh 172.20.6.11 hostname    
ssh 172.20.6.12 hostnamectl set-hostname --static gpnode612.kjh.com && ssh 172.20.6.12 hostname    
ssh 172.20.6.13 hostnamectl set-hostname --static gpnode613.kjh.com && ssh 172.20.6.13 hostname    
ssh 172.20.6.14 hostnamectl set-hostname --static gpnode614.kjh.com && ssh 172.20.6.14 hostname 
創(chuàng)建安裝目錄:

mkdir -p /workspace/gpdb

下載軟件包 greenplum,greenplum-cc-web:

注意:登陸Pivotal Network賬號以后,才能下載:
地址:https://network.pivotal.io/products/pivotal-gpdb/#/releases/158026/file_groups/1083
內(nèi)部下載地址:
wget dl.#kjh#.com/greenplum-db-5.10.2-rhel7-x86_64.rpm

創(chuàng)建主機(jī)列表 (master節(jié)點):
cat >/workspace/gpdb/gp-all.txt <<-EOF
gpnode611.kjh.com   
gpnode612.kjh.com 
gpnode613.kjh.com   
gpnode614.kjh.com
gpnode615.kjh.com
gpnode616.kjh.com   
EOF
segment 節(jié)點
cat >/workspace/gpdb/gp-sg.txt<<-EOF
gpnode611.kjh.com   
gpnode612.kjh.com 
gpnode613.kjh.com   
gpnode614.kjh.com
EOF
添加host文件解析 (集群所有節(jié)點)
cat >/etc/hosts<<-EOF
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

172.20.6.15  gpnode615.kjh.com gp-master
172.20.6.16  gpnode616.kjh.com gp-standby
172.20.6.11  gpnode611.kjh.com sg11
172.20.6.12  gpnode612.kjh.com sg12
172.20.6.13  gpnode613.kjh.com sg13
172.20.6.14  gpnode614.kjh.com sg14
EOF

初始化安裝部署節(jié)點系統(tǒng)環(huán)境(集群所有節(jié)點):

關(guān)閉防火墻,確保各個主機(jī)可以訪問端口號(所有主機(jī))
iptables -F
setenforce 0
sed -ri "/^SELINUX/cSELINUX=disabled" /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
修改文件打開限制(所有主機(jī))
# vi /etc/security/limits.conf #追加
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
修改系統(tǒng)內(nèi)核(所有主機(jī))
# vi /etc/sysctl.conf #追加
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

使之生效

# sysctl -p
禁用內(nèi)存大頁(所有主機(jī))
方法1:修改 /etc/rc.local
# vi /etc/rc.local #追加,禁用大頁
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
  echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
  echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
方法2:grubby 命令添加 (重啟系統(tǒng)后生效):

RHEL 7.x or CentOS 7.x, use the system utility grubby

#修改 :
grubby --update-kernel=ALL --args="transparent_hugepage=never"

驗證:
grubby --info=ALL

重啟后驗證辦法:
 cat /sys/kernel/mm/*transparent_hugepage/enabled
always [never]
修改讀塊大?。ㄋ兄鳈C(jī))
# /usr/sbin/blockdev --setra 16384 /dev/sda #此處sda磁盤要改成本機(jī)磁盤路徑

方法1: 修改 /etc/rc.local

# echo deadline > /sys/block/sda/queue/scheduler #此處sda磁盤要改成本機(jī)磁盤路徑
# chmod u+x /etc/rc.d/rc.local

方法2:使用grubby命令添加(RHEL 7.x or CentOS 7.x ):

grubby --update-kernel=ALL --args="elevator=deadline"

# 驗證
grubby --info=ALL

RHEL 6.x or CentOS 6.x 系統(tǒng)添加:

/boot/grub/grub.conf
kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=LABEL=/
    elevator=deadline crashkernel=128M@16M  quiet console=tty1
    console=ttyS1,115200 panic=30 transparent_hugepage=never 
    initrd /initrd-2.6.18-274.3.1.el5.img
文件系統(tǒng)掛載項修改
ext4 文件系統(tǒng):
mount -o noatime,nodiratime,nobarrier,discard,nodelalloc,data=writeback  /dev/sdb1 /data
xfs 文件系統(tǒng):

XFS是Greenplum數(shù)據(jù)庫數(shù)據(jù)目錄的最佳實踐文件系統(tǒng),XFS應(yīng)該用用下列選項掛載:

#通用選項

#allocsize =16m RHEL 5.x,CentOS 5.x和SUSE 11.3及更早版本使用
/etc/fstab 
UUID=f0d09991-6cc9-4161-b55b-e1bacb5a5233 /data   xfs     rw,noatime,inode64,allocsize=16m   0 0

#CentOS 7系統(tǒng)的文件指定XFS選項 (每臺segment節(jié)點)
/dev/data /data xfs nodev,noatime,nobarrier,inode64 0 0  

e m:
UUID=e10f8280-df16-446c-afa2-f79b9050fec4 /data       xfs    nodev,noatime,nobarrier,inode64        0 0
UUID=4309b448-b621-42b4-bf18-66be8f40ae01 /data01     xfs    nodev,noatime,nobarrier,inode64       0 0
ZFS 文件系統(tǒng):
set zfs:zfs_arc_max=0x600000000
字符集配置
sed -i 's/zh_CN.UTF-8/en_US.UTF-8/g' /etc/sysconfig/i18n
修改/etc/ld.so.conf文件(所有主機(jī))
vi /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
/usr/local/lib64

使之生效

# ldconfig
安裝依賴包(所有主機(jī))
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 \
libssh3.x86_64 libssh3-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 \
centos-release-scl epel-release dh-autoreconf devtoolset-6-toolchain 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 python python-devel python-isomd5sum \
python-setuptools python-py python-lockfile python-paramiko
參考地址:

https://gpdb.docs.pivotal.io/43170/install_guide/prep_os_install_gpdb.html
https://gp-docs-cn.github.io/docs/best_practices/sysconfig.html

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI