安装gp(1+2)模式

调整主机

关闭防火墙
# service iptables stop
#chkconfig --list |grep iptables
永久关闭
# chkconfig iptables off
关闭SElinux
修改/etc/selinux/config文件中的SELINUX="" 为 disabled ,然后重启。
如果不想重启系统,使用命令setenforce 0

 

网卡设置
[gpadmin@mdw ~]$ cat /etc/hosts
127.0.0.1   localhost
172.31.2.2      mdw-1 mdw
172.31.3.2      mdw-2
188.100.253.233 mdw-e
172.31.2.3      sdw1-1 sdw1
172.31.3.3      sdw1-2
188.100.253.234 sdw1-e
172.31.2.4      sdw2-1 sdw2
172.31.3.4      sdw2-2
188.100.253.235 sdw2-e

[gpadmin@mdw testcode]$ cat /etc/hosts
188.100.253.233 mdw
172.31.2.2 mdw mdw-1
172.31.3.2 mdw-2

172.31.2.3 sdw1 sdw1-1
172.31.3.3 sdw1-2

172.31.2.4 sdw2 sdw2-1
172.31.3.4 sdw2-2

关闭图形界面启动
# vi /etc/inittab
id:3:initdefault:
1.内核参数设置
设置下列参数到/etc/sysctl.conf文件中.然后运行sysctl -p使其生效.
这些参数是不要随便修改它的数字,后面在执行gpcheck的时候会严格校验,发现和其中不一样,会报错.
# vi /etc/sysctl.conf
用下面内容直接覆盖该文件
********************************
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sem = 500 1024000 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
vm.overcommit_memory = 2

--233
kernel.sem = 250 64000 100 512
kernel.shmmax = 500000000
kernel.shmmni = 4096
kernel.shmall = 4000000000
kernel.sysrq = 1
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
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.conf.default.arp_filter = 1
net.core.netdev_max_backlog = 10000
vm.overcommit_memory = 2

********************************
#sysctl -p
#vi /etc/security/limits.conf
********************************
* soft nofile 65536
* hard nofile 65536
* soft nproc 131072
* hard nproc 131072
********************************


安装xfs文件系统


#rpm -ivh xfsprogs-2.9.4-4.el5.i386.rpm
修改文件系统
#mkfs.xfs -f -i size=256 -l size=10m,lazy-count=1 -d agcount=4 /dev/sdb
-i size=512 : 默认的值是256KB,当内容小于这个值时,写到inode中,超过这个值时,写到block中。
-l size=128m :注意是小写的m,不是大写的。默认值的是10m,修改这个参数成128m,可以显著的提高xfs文件系统删除文件的速度,当然还有其它,如拷贝文件的速度。 这个参数需要大内存的支持,内存太少的机器大概不能设置这么高。
-d agcount=4 : 默认值是根据容量自动设置的。可以设置成1/2/4/16等等,这个参数可以调节对CPU的占用率,值越小,占用率越低。
不采用flashcache的机器su采用raid 条带大小一般为64k.
采用flashcache的su使用raid卡条带大小(1M),sw采用读的时候磁盘数(比如10块盘,raid 1+0则为10,raid5则为9)
#vi /etc/fstab
********************************
/dev/sdb /data1 xfs rw,noatime,nodiratime,noikeep,nobarrier,inode64,allocsize=16m 1 1
********************************

[root@sdw2 ~]# mkfs.xfs /dev/vgca0p1
meta-data=/dev/vgca0p1           isize=256    agcount=32, agsize=16777214 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=536870848, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096 
log      =internal log           bsize=4096   blocks=32768, version=1
         =                       sectsz=512   sunit=0 blks, lazy-count=0
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@sdw2 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Jun  9 19:58:03 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=727b80d6-68ed-4246-812d-2b4a8e9f8094 /                       ext4    defaults        1 1
UUID=190d5cab-70e4-403f-92d7-1427cd2566cc /boot                   ext4    defaults        1 2
UUID=e27e1463-3987-4f47-a1ec-110182b334f2 /tmp                    ext4    defaults        1 2
UUID=aa90d133-db14-428c-b7f0-c6b35a154f8c swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
~
~
/dev/vgca0p1            /data                   xfs     rw,noatime,inode64,allocsize=16m 1 1
~
"/etc/fstab" 17L, 962C written
[root@sdw2 ~]# mount -a

[root@sdw2 tools]# more /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda4
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=727b80d6-68ed-4246-812d-2b4a8e9f8094 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-
8 rd_NO_MD SYSFONT=latarcyrheb-sun16  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM elevator=deadline rhgb quiet
        initrd /initramfs-2.6.32-358.el6.x86_64.img
[root@sdw2 tools]#
[root@sdw2 ~]# vi /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
blockdev --setra 16384 /dev/vgca0p1
~
~
~
~
~

[root@sdw2 etc]# more security/limits.d/90-nproc.conf
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     131072
root       soft    nproc     unlimited
[root@sdw2 etc]#


[gpadmin@mdw testcode]$ cd /opt
[gpadmin@mdw opt]$ ll
total 55396
-rwxrwxrwx. 1 root root 56715132 Jun 14 13:47 greenplum-db-4.2.5.0-build-1-RHEL5-x86_64.bin
-rwxrwxrwx. 1 root root       54 Jun 14 14:49 host_exkey
drwxrwxrwx. 2 root root     4096 Nov 12  2012 rh
[gpadmin@mdw opt]$ more host_exkey
mdw
mdw-1
mdw-2
sdw1
sdw1-1
sdw1-2
sdw2
sdw2-1
sdw2-2
[gpadmin@mdw opt]$

 

安装gp


[root@mdw opt]# ll
total 55392
-rwxrwxrwx. 1 root root 56715132 Jun 14 13:47 greenplum-db-4.2.5.0-build-1-RHEL5-x86_64.bin
drwxr-xr-x. 2 root root     4096 Nov 12  2012 rh
[root@mdw opt]# ./greenplum-db-4.2.5.0-build-1-RHEL5-x86_64.bin


[root@mdw opt]# source /usr/local/greenplum-db/greenplum_path.sh
[root@mdw opt]# gpseginstall -f host_exkey -u gpadmin -p gpdmin


[gpadmin@mdw ~]$ gpssh-exkeys -f /opt/host_exkey
[STEP 1 of 5] create local ID and authorize on local host
  ... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped

[STEP 2 of 5] keyscan all hosts and update known_hosts file

[STEP 3 of 5] authorize current user on remote hosts
  ... send to mdw-1
  ... send to mdw-2
  ... send to sdw1
  ... send to sdw1-1
  ... send to sdw1-2
  ... send to sdw2
  ... send to sdw2-1
  ... send to sdw2-2

[STEP 4 of 5] determine common authentication file content

[STEP 5 of 5] copy authentication files to all remote hosts
  ... finished key exchange with mdw-1
  ... finished key exchange with mdw-2
  ... finished key exchange with sdw1
  ... finished key exchange with sdw1-1
  ... finished key exchange with sdw1-2
  ... finished key exchange with sdw2
  ... finished key exchange with sdw2-1
  ... finished key exchange with sdw2-2

[INFO] completed successfully


[gpadmin@mdw ~]$ gpssh -h sdw1 -h sdw2
Note: command history unsupported on this machine ...
=> cd /
[gpadmin@mdw ~]$ more host_hostonly
mdw
sdw1
sdw2
[root@mdw gpadmin]# gpcheck -f host_hostonly -m mdw
20130614:15:39:35:010066 gpcheck:mdw:root-[INFO]:-dedupe hostnames
20130614:15:39:35:010066 gpcheck:mdw:root-[INFO]:-Detected platform: Generic Linux Cluster
20130614:15:39:35:010066 gpcheck:mdw:root-[INFO]:-generate data on servers
20130614:15:39:35:010066 gpcheck:mdw:root-[INFO]:-copy data files from servers
20130614:15:39:35:010066 gpcheck:mdw:root-[INFO]:-delete remote tmp files
20130614:15:39:36:010066 gpcheck:mdw:root-[INFO]:-Using gpcheck config file: /usr/local/greenplum-db/./etc/gpcheck.cnf
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(mdw): on device (sr0) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(mdw): on device (sda) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(mdw): ntpd not detected on machine
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw2): on device (sr0) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw2): on device (sda) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw2): potential NTPD issue.  gpcheck start time (Fri Jun 14 15:39:35 2013) time on machine (Fri Jun 14 15:39:10 2013)
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw2): ntpd not detected on machine
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw1): on device (sr0) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw1): on device (sda) IO scheduler 'cfq' does not match expected value 'deadline'
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw1): potential NTPD issue.  gpcheck start time (Fri Jun 14 15:39:35 2013) time on machine (Fri Jun 14 15:39:28 2013)
20130614:15:39:36:010066 gpcheck:mdw:root-[ERROR]:-GPCHECK_ERROR host(sdw1): ntpd not detected on machine
20130614:15:39:36:010066 gpcheck:mdw:root-[INFO]:-gpcheck completing...

[gpadmin@mdw ~]$ more host_exkey
mdw-1
mdw-2
sdw1-1
sdw1-2
sdw2-1
sdw2-2
[gpadmin@mdw ~]$
[root@mdw gpadmin]# gpcheckperf -f host_net2 -r N -d /tmp
/usr/local/greenplum-db/./bin/gpcheckperf -f host_net2 -r N -d /tmp

-------------------
--  NETPERF TEST
-------------------

====================
==  RESULT
====================
Netperf bisection bandwidth test
mdw-2 -> sdw1-2 = 770.940000
sdw2-2 -> mdw-2 = 1032.460000
sdw1-2 -> mdw-2 = 1091.360000
mdw-2 -> sdw2-2 = 1109.600000

Summary:
sum = 4004.36 MB/sec
min = 770.94 MB/sec
max = 1109.60 MB/sec
avg = 1001.09 MB/sec
median = 1091.36 MB/sec

[Warning] connection between mdw-2 and sdw1-2 is no good
[root@mdw gpadmin]# gpcheckperf -f host_net2 -r N -d /tmp
/usr/local/greenplum-db/./bin/gpcheckperf -f host_net2 -r N -d /tmp

-------------------
--  NETPERF TEST
-------------------

====================
==  RESULT
====================
Netperf bisection bandwidth test
mdw-2 -> sdw1-2 = 664.030000
sdw2-2 -> mdw-2 = 1098.380000
sdw1-2 -> mdw-2 = 1036.030000
mdw-2 -> sdw2-2 = 1109.880000

Summary:
sum = 3908.32 MB/sec
min = 664.03 MB/sec
max = 1109.88 MB/sec
avg = 977.08 MB/sec
median = 1098.38 MB/sec

[Warning] connection between mdw-2 and sdw1-2 is no good

[root@mdw gpadmin]# gpcheckperf -h sdw1 -h sdw2 -r ds -D   -d /data/primary -d  /data/primary   -d /data/primary -d  /data/primary   -d /data/primary -d  /data/primary   -d /data/primary -d  /data/primary   -d /data/primary -d  /data/primary   -d /data/primary -d  /data/primary -S 256G
/usr/local/greenplum-db/./bin/gpcheckperf -h sdw1 -h sdw2 -r ds -D -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -d /data/primary -S 256G

--------------------
--  DISK WRITE TEST
--------------------

--------------------
--  DISK READ TEST
--------------------

--------------------
--  STREAM TEST
--------------------

====================
==  RESULT
====================

 disk write avg time (sec): 127.29
 disk write tot bytes: 549755289600
 disk write tot bandwidth (MB/s): 4119.81
 disk write min bandwidth (MB/s): 2028.35 [sdw1]
 disk write max bandwidth (MB/s): 2091.46 [sdw2]
 -- per host bandwidth --
    disk write bandwidth (MB/s): 2028.35 [sdw1]
    disk write bandwidth (MB/s): 2091.46 [sdw2]


 disk read avg time (sec): 4.68
 disk read tot bytes: 549755289600
 disk read tot bandwidth (MB/s): 112045.66
 disk read min bandwidth (MB/s): 55304.59 [sdw1]
 disk read max bandwidth (MB/s): 56741.07 [sdw2]
 -- per host bandwidth --
    disk read bandwidth (MB/s): 55304.59 [sdw1]
    disk read bandwidth (MB/s): 56741.07 [sdw2]


 stream tot bandwidth (MB/s): 20695.96
 stream min bandwidth (MB/s): 10279.37 [sdw1]
 stream max bandwidth (MB/s): 10416.59 [sdw2]
 -- per host bandwidth --
    stream bandwidth (MB/s): 10279.37 [sdw1]
    stream bandwidth (MB/s): 10416.59 [sdw2]

[root@mdw gpadmin]# gpcheckperf -h sdw1 -h sdw2 -r ds -D -S 64G -d /data/primary
/usr/local/greenplum-db/./bin/gpcheckperf -h sdw1 -h sdw2 -r ds -D -S 64G -d /data/primary

--------------------
--  DISK WRITE TEST
--------------------

--------------------
--  DISK READ TEST
--------------------

--------------------
--  STREAM TEST
--------------------

====================
==  RESULT
====================

 disk write avg time (sec): 72.80
 disk write tot bytes: 137438953472
 disk write tot bandwidth (MB/s): 1800.47
 disk write min bandwidth (MB/s): 896.53 [sdw1]
 disk write max bandwidth (MB/s): 903.94 [sdw2]
 -- per host bandwidth --
    disk write bandwidth (MB/s): 896.53 [sdw1]
    disk write bandwidth (MB/s): 903.94 [sdw2]


 disk read avg time (sec): 11.94
 disk read tot bytes: 137438953472
 disk read tot bandwidth (MB/s): 11041.69
 disk read min bandwidth (MB/s): 5100.08 [sdw1]
 disk read max bandwidth (MB/s): 5941.61 [sdw2]
 -- per host bandwidth --
    disk read bandwidth (MB/s): 5100.08 [sdw1]
    disk read bandwidth (MB/s): 5941.61 [sdw2]


 stream tot bandwidth (MB/s): 24679.92
 stream min bandwidth (MB/s): 11527.76 [sdw2]
 stream max bandwidth (MB/s): 13152.15 [sdw1]
 -- per host bandwidth --
    stream bandwidth (MB/s): 13152.15 [sdw1]
    stream bandwidth (MB/s): 11527.76 [sdw2]

 [gpadmin@mdw cli_help]$ cd gpconfigs/
[gpadmin@mdw gpconfigs]$ ll
total 52
-r--r--r--. 1 gpadmin gpadmin 2660 Apr  6 04:40 gpinitsystem_config
-r--r--r--. 1 gpadmin gpadmin 4511 Apr  6 04:40 gpinitsystem_singlenode
-r--r--r--. 1 gpadmin gpadmin  359 Apr  6 04:40 hostfile_exkeys
-r--r--r--. 1 gpadmin gpadmin   96 Apr  6 04:40 hostfile_gpcheck
-r--r--r--. 1 gpadmin gpadmin  119 Apr  6 04:40 hostfile_gpchecknet_ic1
-r--r--r--. 1 gpadmin gpadmin  119 Apr  6 04:40 hostfile_gpchecknet_ic2
-r--r--r--. 1 gpadmin gpadmin   87 Apr  6 04:40 hostfile_gpcheckperf
-r--r--r--. 1 gpadmin gpadmin  255 Apr  6 04:40 hostfile_gpexpand
-r--r--r--. 1 gpadmin gpadmin  237 Apr  6 04:40 hostfile_gpinitsystem
-r--r--r--. 1 gpadmin gpadmin   96 Apr  6 04:40 hostfile_gpssh_allhosts
-r--r--r--. 1 gpadmin gpadmin   87 Apr  6 04:40 hostfile_gpssh_segonly
-r--r--r--. 1 gpadmin gpadmin   44 Apr  6 04:40 hostlist_singlenode
[gpadmin@mdw gpconfigs]$ cp gpinitsystem_config ~
[gpadmin@mdw gpconfigs]$ cd ~
[gpadmin@mdw ~]$ more gpinitsystem_config
ARRAY_NAME="EMC Greenplum DW"
SEG_PREFIX=gpseg
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/data/primary /data/primary /data/primary /data/primary /data/primary /data/primary /data/primary /data/p
rimary)
MASTER_HOSTNAME=mdw
MASTER_DIRECTORY=/data/master
MASTER_PORT=5432
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE
MIRROR_PORT_BASE=50000
REPLICATION_PORT_BASE=41000
MIRROR_REPLICATION_PORT_BASE=51000
declare -a MIRROR_DATA_DIRECTORY=(/data/mirror /data/mirror /data/mirror /data/mirror /data/mirror /data/mirror /data/mirror /data/m
irror)
[gpadmin@mdw ~]$
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init -B 6
 
[gpadmin@mdw ~]$ gpdeletesystem -d /data/master/gpseg-1/
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init
 
 

 

某些版本的Linux可能未加载xfs module
#rpm -ivh kmod-xfs-0.4-2.x86_64.rpm
#modprobe xfs


调整IO调度算法,提高读性能


#vi /boot/grub/menu.lst
添加
********************************
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/?elevator=deadline?rhgb quiet
********************************
设置磁盘预读扇区和io调度策略,优化读性能
#vi /etc/rc.d/rc.local
********************************
#disk block
blockdev --setra 16384 /dev/sd*
#io schedule
echo deadline > /sys/block/sdb/queue/scheduler
********************************
配置hosts文件
********************************
192.168.11.191  mdw
10.10.11.10  mdw-1
10.10.12.10  mdw-2
10.10.13.10  mdw-3
10.10.14.10  mdw-4
192.168.11.121  sdw1
10.10.11.11  sdw1-1
10.10.12.11  sdw1-2
10.10.13.11  sdw1-3
10.10.14.11  sdw1-4
192.168.11.122  sdw2
10.10.11.12  sdw2-1
10.10.12.12  sdw2-2
10.10.13.12  sdw2-3
10.10.14.12  sdw2-4
********************************

 

安装GP


运行安装包
#bash greenplum-db-4.2.1.2-build-1-RHEL5-i386.bin
创建以及配置gpadmin用户
#useradd gpadmin
#passwd gpadmin
#chown -R gpadmin /usr/local/greenplum-db
#source /usr/local/greenplum-db/greenplum_path.sh
将上条命令加入
/home/gpadmin/.bashrc


建立各节点间的ssh通信认证


#gpssh-exkeys -f /home/gpadmin/hostfile_exkeys
创建各segment节点上的gpadmin用户
#gpssh -f /home/gpadmin/segment_hosts '/usr/sbin/useradd gpadmin -d /home/gpadmin -s /bin/bash'
#gpssh -f /home/gpadmin/all_segment_hosts 'echo ecdata | passwd gpadmin --stdin'
#su - gpadmin
$gpssh-exkeys -f /home/gpadmin/hostfile_exkeys

 

部署segment上的gp文件


#gtar -cvf /home/gpadmin/gp.tar /usr/local/greenplum-db-4.2.1.2
#gpscp -f /home/gpadmin/segment_hosts /home/gpadmin/gp.tar =:/usr/local
#gpssh -f segment_hosts
=>gtar --directory / -xvf /usr/local/gp.tar
=>ln -s /usr/local/greenplum-db-4.2.1.2 /usr/local/greenplum-db
#chown -R gpadmin:gpadmin /usr/local/greenplum-db /usr/local/greenplum-db-4.2.1.2

更改数据目录权限

#mkdir -p /data/master
#chown -R gpadmin:gpadmin /data
#gpssh -f segment_hosts
=>mkdir -p /data1/primary /data2/primary
=>chown -R gpadmin:gpadmin /data1 /data2

配置NTP服务


在master节点上配置:
#cat > /etc/ntp.conf <<EOF
restrict 0.0.0.0 mask 0.0.0.0 nomodify
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
authenticate no
keys /etc/ntp/keys
EOF
#service ntpd restart
在segment节点上配置:
#cat > /etc/ntp.conf <<EOF
server 192.168.11.191
fudge 127.127.1.0 stratum 10
driftfile /var/lib/ntp/drift
broadcastdelay 0.008
authenticate no
keys /etc/ntp/keys
EOF
#service ntpd stop
#ntpdate 192.168.11.191
确认ntp服务能正常连接后,再启动。
注意:ntp服务在Server端需要320秒才能起来
#service ntpd start
确认时间同步功能正常:
#gpssh -f gp_hosts -v date
#gpssh -f gp_hosts -v ntpd
初始化GP实例
定义初始化配置文件
#su - gpadmin
$vi hostfile_gpinitsystem
********************************
sdw1-1
sdw1-2
sdw1-3
sdw1-4
sdw2-1
sdw2-2
sdw2-3
sdw2-4
********************************
$vi /home/gpadmin/gp_init_config
********************************
ARRAY_NAME="EMC Greenplum DW"
SEG_PREFIX=gpseg
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/data1/primary /data1/primary /data2/primary /data2/primary)
MASTER_HOSTNAME=mdw
MASTER_DIRECTORY=/data/master
MASTER_PORT=5432
TRUSTED SHELL=ssh
CHECK_POINT_SEGMENT=8
ENCODING=UNICODE
MACHINE_LIST_FILE=/home/gpadmin/segment_hosts
********************************

 

初始化实例


$gpinitsystem -c /home/gpadmin/gp_init_config -h /home/gpadmin/hostfile_gpinitsystem
当发生错误可以从gpAdminLogs中自动生成的配置记录回滚
$sh /home/gpadmin/gpAdminLogs/backout_gpinitsystem_gpadmin_20111024_161120
修改用户配置文件
#vi ~/.bashrc
添加
********************************
export MASTER_DATA_DIRECTORY=/data/master/gpseg-1
********************************
修改访问权限
$ vi $MASTER_DATA_DIRECTORY/pg_hba.conf
添加
********************************
host     all         gpadmin         0.0.0.0/0       trust
********************************

 
 
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init -B 6
 
[gpadmin@mdw ~]$ gpdeletesystem -d /data/master/gpseg-1/
[gpadmin@mdw ~]$ gpinitsystem -c gpinitsystem_config -h host_init
 

 

你可能感兴趣的:(安装gp(1+2)模式)