-
集群环境配置
- 修改每台机器的配置
- 修改文件/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.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 = 10000 65535 net.core.netdev_max_backlog = 10000 net.core.rmem_max = 2097152 net.core.wmem_max = 2097152 vm.overcommit_memory = 2
- 修改/etc/security/limits.conf
-
* soft nofile 65535 * hard nofile 65535 * soft nproc 131072 * hard nproc 131072
-
创建Greenplume账户
-
groupadd gpadmin
-
useradd gpadmin -g gpadmin
-
passwd gpadmin
-
-
配置生效:sysctl -p
- 修改每台机器的配置
-
安装gp
- 下载安装包:wget https://github.com/greenplum-db/gpdb/releases/download/6.0.0/greenplum-db-6.0.0-rhel7-x86_64.rpm
- 安装:rpm -Uvh greenplum-db-6.0.0-rhel7-x86_64.rpm
- 设置环境变量(root),在master节点执行:source /usr/local/greenplum-db/greenplum_path.sh
- 设置免密登录(每台机器)
- 生成密钥:ssh-keygen -t rsa
- 将公钥发送到要访问的机器(master->server):ssh-copy-id gpadmin@xxx
- 传输程序包(master节点):scp -r greenplum-db gpadmin@xxx:/home/gpadmin/
- 将程序移动到/user/locla下:mv greenplum-db/ /usr/local/
- 检查:安装的Greenplum(master节点):gpssh -f hostfile_exkeys -e ls -l $GPHOME
- 复制配置文件(master节点):cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config /home/gpadmin/
- 修改配置文件(master 2个节点)
- mkdir -p /mnt/data/greenplum/master
- mkdir -p greenplum/master
- chown -R gpadmin:gpadmin master
- 创建存储目录(每台机器):
- mkdir -p /mnt/data/greenplum/data/primary
- mkdir /mnt/data/greenplum/data/mirror
- chown -R gpadmin:gpadmin greenplum
- 环境变量(.bashrc)
- 初始化数据库(master):
- gpinitsystem -c gpconfigs/gpinitsystem_config -h gpconfigs/seg_host --mirror-mode=spread