配置greenplum参数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置greenplum参数相关的知识,希望对你有一定的参考价值。

在进行一个greenplum安装之前需要进行配置一下相关的系统参数,否则很容易出现意想不到的错误.

1.修改系统参数
编辑 /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  
修改后需要reboot
2.修改文件打开数等限制
编辑/etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

编辑/etc/security/limits.d/90-nproc.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

3.修改scheduler
编辑scheduler,原先默认是cfq
echo deadline > /sys/block/vda/queue/scheduler
[[email protected] ~]# more  /sys/block/vda/queue/scheduler 
noop anticipatory [deadline] cfq 

4.编辑/boot/grub/grub.conf
新增 elevator=deadline
[root @bigdata03 ~]# more /boot/grub/grub.conf
...elevator=deadline crashkernel=auto ...

5.编辑设备块大小
[root@bigdata03 ~]# /sbin/blockdev --setra 16384 /dev/vda
[root@bigdata03 ~]# /sbin/blockdev --getra /dev/vda
16384

具体参考:http://gpdb.docs.pivotal.io/4370/prep_os-system-params.html#topic3

其实我没改相关系统参数之前,碰到最多的错误就是"设备磁盘空间不足".

官网给出的修改方案固然可行,不过有更方便的修改方案:

针对第一条:修改系统参数

sysctl -p - >> /etc/sysctl.conf <<EOF
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
EOF
这样修改的可以不用reboot

以上是关于配置greenplum参数的主要内容,如果未能解决你的问题,请参考以下文章

GreenPlum 常用命令

GreenPlum 集群常用命令

出现错误:将备份恢复到 5.x Greenplum DB 时无法识别配置参数“gp_strict_xml_parse”

Greenplum pxf 连接hadoop

Greenplum 实时数据仓库实践——Greenplum安装部署

Greenplum 实时数据仓库实践——Greenplum安装部署