[GreenPlum] 对redhat安装开源GreenPlum和配置的小结

一、Linux创建用户

groupadd -g 3030 gpadmin
useradd -u 3030 gpadmin -g gpadmin -d /home/db/gpadmin
passwd gpadmin

 

二、修改内核参数


#step2.1配置内核参数
$ vi /etc/sysctl.conf
#By greenplum
net.ipv4.ip_forward = 0
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 1
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.sem = 250 64000 100 512
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 250 64000 100 512
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_max_syn_backlog=4096
net.core.netdev_max_backlog=10000
vm.overcommit_memory=2
net.ipv4.conf.all.arp_filter = 1

#step2.2生效sysctl.conf
$ sysctl -p

#step2.3
$ vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072

#step2.4 磁盘优化
$ vi /boot/grub/menu.lst
elevator=deadline
$ vi /etc/rc.d/rc.local
#step2.5 重启系统
$ reboot
#step2.6 域名解析
$ vi /etc/hosts
128.128.97.247 hostname

 

三、配置ssh免密登录、安装GP


#step3.1 配置ssh免密
$ ssh-keygen -t dsa
$ cd .ssh/
$ cat *.pub > authorized_keys
$ ssh hostname date
$ chmod 644 authorized_keys

#Step3.2 解压安装包、创建目录、修改用户配置文件
$ unzip greenplum-db-4.3.0.0-build-3-RHEL5-x86_64.zip 
$ ./greenplum-db-4.3.0.0-build-3-RHEL5-x86_64.bin
$ mkdir -p /home/ap/gpadmin/master
$ mkdir -p /home/ap/gpadmin/data/gp1  
$ mkdir -p /home/ap/gpadmin/data/gp2 
$ mkdir -p /home/ap/gpadmin/data/gp3 
$ mkdir -p /home/ap/gpadmin/data/gp4
$ vi .bash_profile 
source /usr/local/greenplum-db/greenplum_path.sh
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1

export PGPORT=5432
export PGUSER=gpadmin
export PGDATABASE=sordb

$ vi all_hosts_file
sordb

#Step3.3 初始化系统
$ cd /usr/local/greenplum-db/docs/cli_help/gpconfigs/
declare -a DATA_DIRECTORY=(/home/ap/gpadmin/data/gp1 /home/ap/gpadmin/data/gp2 /home/ap/gpadmin/data/gp3 /home/ap/gpadmin/data/gp4)
MASTER_HOSTNAME=goolen
MASTER_DIRECTORY=/home/ap/gpadmin/master
DATABASE_NAME=sordb

$ gpinitsystem -c gpinitsystem_config -h seg_hosts_file

三、修改master的通信配置

$ vi pg_hba.conf

添加:

host    all         all         0.0.0.0/0             krb5

 

四、用户权限

【4.1】 创建linux的AP用户

#注明gra#ant是因为格式有问题
psql -d sordb -h 128.128.97.247 -U dzyh_app -p 5432
psql -d sordb -h 192.168.64.129 -U dzyh_app -p 5432
gr#ant all on schema dzyh_app to dzyh_app;
gr#ant all on tables in schema dzyh_app to dzyh_app;

groupadd -g 344 dba
useradd -u 344 app -g dba -d /home/ap/app

 

【4.2】创建GP用户和赋权

#注明gr#ant是因为格式有问题
psql -U postgres -h 127.0.0.1
create user "dzyh_app" with password 'PASSWORD' nocreatedb;
create database "sordb" with owner="dzyh_app";
创建Schema
create schema dzyh_app

赋予dzyh_app所有权限
gr#ant all on schema dzyh_app to public;

赋予dzyh_app创建可读/可写外部表的权限
alter role dzyh_app with createexttable(type='readable',protocol='gpfdist');
alter role dzyh_app with createexttable(type='writable',protocol='gpfdist');
分类上一篇:     分类下一篇:

Leave a Reply