greenplum 安装 -2- 系统配置

每个node都需要进行的配置

系统配置1

配置gpadmin、ssh等

# 通过gp自带的脚本setup_gpadmin_user.bash
# 需要将源码包的名字修改为gpdb_src/
mv gpdb-6.22.2 gpdb_src
gpdb_src/concourse/scripts/setup_gpadmin_user.bash

# 实现动作
# 创建配置用户gpadmin(密码默认password)
# 为gpadmin生成sshkey,配置~/.ssh/authorized_keys
# 修改编译安装目录的user,group - /usr/local/gpdb(hard coded,如果编译时指定的不同,则此脚本不能用)
# 设置/etc/security/limits.d/gpadmin-limits.conf
# 为root设置sshkey

(可选)

将源码包移动到gpadmin
mv hgdw /home/gpadmin/
chown gpadmin:gpadmin /home/gpadmin/hgdw/

系统配置2

关闭SELinux

检查状态

# sestatus
SELinuxstatus: disabled

修改/etc/selinux/config

- SELINUX=enforcing
+ SELINUX=disabled

如果/etc/sssd/sssd.conf存在

selinux_provider=none

重启生效

reboot -f

关闭防火墙

systemctl status firewalld

如果firewalld没有关闭,则关闭

# systemctl stop firewalld.service
# systemctl deactivate firewalld.service

iptables检查

# /sbin/chkconfig --list iptables

推荐的系统设置

共享内存、网络、limits等

/etc/hosts

/etc/sysctl.conf

# kernel.shmall = _PHYS_PAGES / 2 # See Shared Memory Pages
kernel.shmall = 124059
# kernel.shmmax = kernel.shmall * PAGE_SIZE 
kernel.shmmax = 508145664

kernel.shmmni = 4096

vm.overcommit_memory = 2 # See Segment Host Memory
vm.overcommit_ratio = 95 # See Segment Host Memory

net.ipv4.ip_local_port_range = 10000 65535 # See Port Settings
kernel.sem = 250 2048000 200 8192
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.msgmni = 2048
net.ipv4.tcp_syncookies = 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.ipfrag_high_thresh = 41943040
net.ipv4.ipfrag_low_thresh = 31457280
net.ipv4.ipfrag_time = 60
net.core.netdev_max_backlog = 10000
net.core.rmem_max = 2097152
net.core.wmem_max = 2097152
vm.swappiness = 10
vm.zone_reclaim_mode = 0
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100


vm.dirty_background_ratio = 3 # See System Memory
vm.dirty_ratio = 10
## vm.dirty_background_bytes = 1610612736
## vm.dirty_bytes = 4294967296
vm.min_free_kbytes = 29774

设置生效

sysctl -p

Shared Memory Pages

kernel.shmall = ( _PHYS_PAGES / 2)
kernel.shmmax = ( _PHYS_PAGES / 2) * PAGE_SIZE

## 计算方法
$ echo $(expr $(getconf _PHYS_PAGES) / 2) 
$ echo $(expr $(getconf _PHYS_PAGES) / 2 \* $(getconf PAGE_SIZE))

System Memory

# < 64GB以下内存设置
vm.dirty_background_ratio = 3
vm.dirty_ratio = 10

屏蔽设置
## vm.dirty_background_bytes = xx
## vm.dirty_bytes = xx

## 计算vm.min_free_kbytes
awk 'BEGIN {OFMT = "%.0f";} /MemTotal/ {print "vm.min_free_kbytes =", $2 * .03;}' /proc/meminfo

System Resources Limits

/etc/security/limits.conf
// setup_gpadmin_user.bash也为gpadmin配置过了
// -> /etc/security/limits.d/gpadmin-limits.conf

* soft nofile 524288
* hard nofile 524288
* soft nproc 131072
* hard nproc 131072

重启检查生效

ulimit -u
131072

Core Dump设置

/etc/sysctl.conf

kernel.core_pattern=/var/core/core.%h.%t

/etc/security/limits.conf

* soft  core unlimited

配置生效

# sysctl -p

XFS Mount Options

可选(略)

Disk I/O Settings

可选

[root@dw1-cn ~]# /sbin/blockdev --getra /dev/sda
8192

# 设置为16384(一次性设置)
/sbin/blockdev --setra 16384 /dev/sda

# 添加到 /etc/rc.d/rc.local(持久化设置)
/sbin/blockdev --setra 16384 /dev/sda

Networking

可选(略)

Transparent Huge Pages (THP)

可选(略)

IPC Object Removal

可选(略)

SSH Connection Threshold

# /etc/ssh/sshd_config
MaxStartups 10:30:200
MaxSessions 200


service sshd restart

Synchronizing System Clocks

可选(略)

不确定

"/etc/ssh/sshd_config"
PasswordAuthentication yes
service sshd restart

你可能感兴趣的:(greenplum)