本文gpdb版本:greenplum-db-4.3.6.2
[root@yz_dev /]# groupadd -g 8000 gpadmin [root@yz_dev /]# useradd -m -d /home/gpadmin -g gpadmin -u 8000 gpadmin [root@yz_dev /]# passwd gpadmin
[root@yz_dev /]# mkdir -p /opt/gp/greenplum # install path [root@yz_dev /]# mkdir -p /opt/gp/gpmaster [root@yz_dev /]# mkdir -p /opt/gp/gpdata [root@yz_dev /]# chown -R gpadmin:gpadmin /opt/gp
[gpadmin@yz_dev ~]$ ./greenplum-db-4.3.6.2-build-1-RHEL5-x86_64.bin # 在询问安装路径时,输入安装路径:/opt/gp/greenplum
[gpadmin@yz_dev ~]$ vi .bash_profile # 增加: . /opt/gp/greenplum/greenplum_path.sh # 执行完此操作请重新登录以便使环境变量生效
hostname为localhost.localdomain会报warning。因此设置新的hostname,永久保存需要修改/etc/sysconfig/network。
[root@yz_dev /]# hostname dev1_230 [gpadmin@yz_dev ~]$ hostname yz_dev [gpadmin@yz_dev ~]$ hostname > hostlist_singlenode [root@dev1_230 /]# vi /etc/hosts # 如果没有DNS 192.168.3.144 yz_dev
[gpadmin@yz_dev ~]$ gpssh-exkeys -h 127.0.0.1 [STEP 1 of 5] create local ID and authorize on local host [STEP 2 of 5] keyscan all hosts and update known_hosts file [STEP 3 of 5] authorize current user on remote hosts ... send to 127.0.0.1 [STEP 4 of 5] determine common authentication file content [STEP 5 of 5] copy authentication files to all remote hosts ... finished key exchange with 127.0.0.1 [INFO] completed successfully
[gpadmin@yz_dev ~]$ cp /opt/gp/greenplum/docs/cli_help/gpconfigs/gpinitsystem_singlenode ~ [gpadmin@yz_dev ~]$ chmod +w gpinitsystem_singlenode [gpadmin@yz_dev ~]$ vi gpinitsystem_singlenode
# 192.168.3.144有4核CPU,因此创建4个segment instance
# gpinitsystem需要添加参数"-m 25",即master的maxconnections=25,segment的maxconnections=75。默认值为master的maxconnections=250,segment的maxconnections=750,这时在192.168.3.144上最多只能创建两个segment,否则报错,提示超过系统semaphore个数限制。
[gpadmin@yz_dev ~]$ gpinitsystem -m 25 -c gpinitsystem_singlenode
[gpadmin@yz_dev ~]$ vi .bash_profile # 增加: export MASTER_DATA_DIRECTORY=/opt/gp/gpmaster/gpsne-1
[gpadmin@yz_dev ~]$ vi /opt/gp/gpmaster/gpsne-1/pg_hba.conf # 增加: host all gpadmin 192.168.0.0/16 trust
[gpadmin@yz_dev ~]$ gpstate
[gpadmin@yz_dev ~]$ psql -d template1 -h yz_dev -p 5432 -U gpadmin [gpadmin@yz_dev ~]$ psql template1
[gpadmin@yz_dev ~]$ touch .psqlr [gpadmin@yz_dev ~]$ vi .psqlr
内容:
\timing \pset NULL 'NULL' \encoding unicode