ASP站长网简单来说GPDB是一个分布式数据库软件,其可以管理和处理分布在多个不同主机上的海量数据。对于GPDB来说,一个DB实例实际上是由多个独立的PostgreSQL实例组成的,它们分布在不同的物理主机上,协同工作,呈现给用户的是一个DB的效果。Master是GPDB系统的访问入口,其负责处理客户端的连接及SQL 命令、协调系统中的其他Instance(Segment)工作,Segment负责管理和处理用户数据。
环境准备:
操作系统:CentOS Linux release 7.6.1810 (Core) 64位
master 1台(架构图中的主节点),Standby 1台(架构图中的从节点),Segment 2台。共4台服务器。
一、Master主机 Root 用户上操作
1. 修改/etc/hosts文件,添加下面内容(注:4台服务器相同的配置)
vim /etc/hosts
192.168.18.130 gp-master
192.168.18.131 gp-standby
192.168.18.132 gp-node1
192.168.18.133 gp-node2
2. 服务器关闭selinux,防火墙4台服务器相互开放,测试环境可以直接先关闭防火墙。(注:4台服务器相同的配置)
关闭Firewalld
systemctl stop firewalld
systemctl disable firewalld
永久关闭Selinux
vim /etc/selinux/conf
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
注:查看Selinux运行状态:getenforce,CLI界面非永久生效设置SeLinux:setenforce 0(0-1对应关闭和开启)
3. 操作系统参数设置
vim /etc/sysctl.conf (注:4台服务器相同的配置)
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
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.conf.default.arp_filter = 1
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2
kernel.msgmni = 2048
net.ipv4.ip_local_port_range = 1025 65535
vim /etc/security/limits.conf (注:4台服务器相同的配置)
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
大型站长资讯类网站! https://www.0792zz.cn