一:Greenplum5.10.2 生产环境安装配置 (系统初始化、安装准备)
Centos7.5安裝配置Greenplum5.10.2 (生產環境)
服務簡介:
Greenplum Master
Master只存儲系統元數據,業務數據全部分布在Segments上。其作為整個數據庫系統的入口,負責建立與客戶端的連接,SQL的解析并形成執行計劃,分發任務給Segment實例,并且收集Segment的執行結果
Master通過synchronization process,保持與Primary Master的catalog和事務日志一致,當Primary Master出現故障時,Standby Master承擔Master的全部工作。
Segment
Greenplum中可以存在多個Segment,Segment主要負責業務數據的存儲和存取(圖3),用戶查詢SQL的執行,每個Segment存放一部分用戶數據,但是用戶不能直接訪問Segment,所有對Segment的訪問都必須經過Master。進行數據訪問時,所有的Segment先并行處理與自己有關的數據,如果需要關聯處理其他Segment上的數據,Segment可以通過Interconnect進行數據的傳輸。Segment節點越多,數據就會打的越散,處理速度就越快。因此與Share All數據庫集群不同,通過增加Segment節點服務器的數量,Greenplum的性能會成線性增長。
Interconnect
Interconnect是Greenplum架構中的網絡層(圖4),是GPDB系統的主要組件,默認情況下,使用UDP協議,但是Greenplum會對數據包進行校驗,因此可靠性等同于TCP,但是性能上會更好。在使用TCP協議的情況下,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/LinuxCentOS Linux release 7.5.1804 (Core) Greenplum Version:5.10.2PostgreSQL :8.3.23集群節點簡介
|----主機名---|-業務IP地址|---角色---|-----disk---|-cpu/mem-|-network-| |cndh1321-6-11|172.20.6.11|Segment |ssd 960G * 2|16c/64G| 10G| |cndh1321-6-12|172.20.6.12|Segment |ssd 960G * 2|16c/64G| 10G| |cndh1321-6-13|172.20.6.13|Segment |ssd 960G * 2|16c/64G| 10G| |cndh1321-6-14|172.20.6.14|Segment |ssd 960G * 2|16c/64G| 10G| |cndh1322-6-15|172.20.6.15|gp-master |ssd 960G * 2|16c/64G| 10G| |cndh1322-6-16|172.20.6.16|gp-standby|ssd 960G * 2|16c/64G| 10G|部署集群環境準備:
設置主機名 (集群所有節點):
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創建安裝目錄:
mkdir -p /workspace/gpdb
下載軟件包 greenplum,greenplum-cc-web:
注意:登陸Pivotal Network賬號以后,才能下載:
地址:https://network.pivotal.io/products/pivotal-gpdb/#/releases/158026/file_groups/1083
內部下載地址:
wget dl.#kjh#.com/greenplum-db-5.10.2-rhel7-x86_64.rpm
創建主機列表 (master節點):
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 EOFsegment 節點
cat >/workspace/gpdb/gp-sg.txt<<-EOF gpnode611.kjh.com gpnode612.kjh.com gpnode613.kjh.com gpnode614.kjh.com EOF添加host文件解析 (集群所有節點)
cat >/etc/hosts<<-EOF 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6172.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初始化安裝部署節點系統環境(集群所有節點):
關閉防火墻,確保各個主機可以訪問端口號(所有主機)
iptables -F setenforce 0 sed -ri "/^SELINUX/cSELINUX=disabled" /etc/selinux/config systemctl stop firewalld systemctl disable firewalld修改文件打開限制(所有主機)
# vi /etc/security/limits.conf #追加 * soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072修改系統內核(所有主機)
# 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禁用內存大頁(所有主機)
方法1:修改 /etc/rc.local
# vi /etc/rc.local #追加,禁用大頁 if test -f /sys/kernel/mm/transparent_hugepage/enabled; thenecho never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; thenecho never > /sys/kernel/mm/transparent_hugepage/defrag fi方法2:grubby 命令添加 (重啟系統后生效):
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]修改讀塊大小(所有主機)
# /usr/sbin/blockdev --setra 16384 /dev/sda #此處sda磁盤要改成本機磁盤路徑方法1: 修改 /etc/rc.local
# echo deadline > /sys/block/sda/queue/scheduler #此處sda磁盤要改成本機磁盤路徑 # 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=ALLRHEL 6.x or CentOS 6.x 系統添加:
/boot/grub/grub.conf kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=LABEL=/elevator=deadline crashkernel=128M@16M quiet console=tty1console=ttyS1,115200 panic=30 transparent_hugepage=never initrd /initrd-2.6.18-274.3.1.el5.img文件系統掛載項修改
ext4 文件系統:
mount -o noatime,nodiratime,nobarrier,discard,nodelalloc,data=writeback /dev/sdb1 /dataxfs 文件系統:
XFS是Greenplum數據庫數據目錄的最佳實踐文件系統,XFS應該用用下列選項掛載:
#通用選項#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系統的文件指定XFS選項 (每臺segment節點) /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 0ZFS 文件系統:
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文件(所有主機)
vi /etc/ld.so.conf include ld.so.conf.d/*.conf /usr/local/lib /usr/local/lib64使之生效
# ldconfig安裝依賴包(所有主機)
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 \ 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
轉載于:https://blog.51cto.com/michaelkang/2167195
總結
以上是生活随笔為你收集整理的一:Greenplum5.10.2 生产环境安装配置 (系统初始化、安装准备)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: maven中如何将所有引用的jar包打包
- 下一篇: java信息管理系统总结_java实现科