You are on page 1of 7

Notes GP 4.

2:
VM IP
MDW
: 192.168.1.250
SMDW
: 192.168.1.253
SDW1
: 192.168.1.251
SDW2
: 192.168.1.252
Start GP:
1. source /usr/local/greenplum-db-4.2.0.0/greenplum_path.sh
2. /etc/init.d/ntpd start
3. su - gpadmin
4. gpstart
5. psql
**********************************************************************
Create New GP VM:
1. Install RHEL 5.7 64 bit di VMware --> Create New VM
mdw password
smdw password
sdw1 password
sdw2 password
2. Copy file greenplum dari VM 4.2 Base /rawdata/Binaries paste ke VM baru
mkdir rawdata
mkdir Binaries di VM baru
*Untuk ubah DHCP IP menjadi Static IP:
- vi /etc/sysconfig/network-scripts/ifcfg-eth0
- edit BOOTPROTO=static
- tambah IPADDR=192.168.1.xxx
- tambah NETMASK=255.255.255.0
3. Edit hostname --> vi /etc/sysconfig/network
4. Restart network --> /sbin/service network restart
5. Close terminal lalu open terminal, hostname berubah
6. Edit or add if not exist the parameter --> vi /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
7. To take effect the changes --> sysctl -p

8. Edit --> vi /etc/security/limits.conf


*soft nofile 65536
*hard nofile 65536
*soft nproc 131072
*hard nproc 131072
9. Edit --> vi /etc/hosts
IP
Segment Explanation
192.168.1.250 mdw # master host
192.168.1.253 smdw # standby host
192.168.1.251 sdw1 # segment one
192.168.1.252 sdw2 # segment two
10. Copy file ke semua
scp /etc/hosts
scp /etc/hosts
scp /etc/hosts

segment -->
smdw:/etc/hosts (answer: YES -> password)
sdw1:/etc/hosts (answer: YES -> password)
sdw2:/etc/hosts (answer: YES -> password)

11. Ke folder installer --> cd /rawdata/Binaries


12. Unzip installer --> unzip greenplum-db-4.2.0.0-build-5-RHEL5-x86_64.zip
13. Install --> /bin/bash greenplum-db-4.2.0.0-build-5-RHEL5-x86_64.bin
--More-- (push SPACE 32 times) -> yes -> ENTER -> yes -> yes ->
ENTER
14. Source GP di rawdata/Binaries --> source /usr/local/greenplum-db-4.2.0.0/gre
enplum_path.sh
15. Dalam folder Binaries: Edit --> vi hostfile_exkeys
mdw
smdw
sdw1
sdw2
16. Execute: gpseginstall -f hostfile_exkeys -u gpadmin -p changeme
password smdw
password sdw1 (ERROR: password salah???)
Looping terus minta password. Stop (CTRL+c).
Efek dari stop error password: tdk bisa input command, close terminal open lagi.
Skip dulu.
Solusi: Ganti hostname semua segment (SMDW,SDW1,SDW2) lalu restart network servi
ce.
Solved.
17. Dari root ([root@mdw /]), mkdir data -> cd data -> mkdir master
18. Di data, change ownership directory --> chown gpadmin:gpadmin /data/master
19. Source GP di data --> source /usr/local/greenplum-db-4.2.0.0/greenplum_path.
sh
20. Buat directory yg
(ERROR: [smdw] mkdir:
rectory)
Solusi: gpssh -h smdw
u baru buat directory
Solved.

sama di SMDW --> gpssh -h smdw -e 'mkdir /data/master'


cannot create directory `/data/master': No such file or di
-e 'mkdir -p /data/master' (-p : buat directory parent dul
selanjutnya)

21. Change ownership directory di SMDW --> gpssh -h smdw 'chown gpadmin:gpadmin

/data/master'
22. Change directory to --> cd /rawdata/Binaries
23. Create file --> vi hostfile_gpssh_segonlyssh
sdw1
sdw2
24. Create primary mirror di Binaries:
--> source /usr/local/greenplum-db-4.2.0.0/greenplum_path.sh
--> gpssh -f hostfile_gpssh_segonly -e 'mkdir /data/primary /data/mirror
;
chown gpadmin:gpadmin /data/primary /data/mirror'
25. Change the permission on the dir /loaddata --> gpssh -h sdw1 -e 'chown -R gp
admin:gpadmin /loaddata'
If ERROR: mkdir loaddata in sdw1 root first.
26. Edit ntp file --> vi /etc/ntp.conf
Place a comment:
#server 0.rhel.pool.ntp.org
#server 1.rhel.pool.ntp.org
#server 2.rhel.pool.ntp.org
Add 'server 192.168.1.250' under 'fudge...' line
27. Start service as ROOT --> /etc/init.d/ntpd start
ERROR: Starting ntpd: ntpd: error while loading shared libraries: libz.s
o.1: failed to map segment from shared object: Permission denied
[FAILED]
Setelah restart OS starting ntpd OK.
28. Connect to SDW1 and do step 26-27:
-->
ssh sdw1
vi /etc/ntp.conf
edit: Step26 + Add 'server mdw prefer [ENTER] server smdw' under 'fudg
e...' line
/etc/init.d/ntpd start
29. Copy ntp.conf to SDW2 (still on ssh sdw1):
-->
source /usr/local/greenplum-db/greenplum_path.sh
gpscp -h sdw2 /etc/ntp.conf =:/etc/ntp.conf
gpssh -h sdw2 -e '/etc/init.d/ntpd start'
29. Connect to SMDW:
-->
exit (from sdw1)
ssh smdw
vi /etc/ntp.conf
edit: Step 26 + Add 'server mdw prefer [ENTER] server 192.168.1.253' u
nder 'fudge...' line
/etc/init.d/ntpd start
exit (from smdw)
30. In root MDW check hostname --> hostname ;
Run verification test --> gpcheck -h mdw
31. Update I/O scheduler value for fd0 device
--> echo deadline > /sys/block/fd0/queue/scheduler
32. Update readhead value for sdb1 device

--> /sbin/blockdev --setra 16385 /dev/sdb1


33. Rexecute verification test --> gpcheck -h mdw
34. Update device in all hosts (Notes in GAA&I_LabGuide.pdf page 43 num 8)
--> /rawdata/solutions/lab2/update_block_devices_IO_scheduler.sh
SKIP
35. Create file in root hosts_gpcheck
-->
cat > hosts_gpcheck
mdw
smdw
sdw1
sdw2
CTRL+d (file langsung disimpan,tanpa melalui command vi)
36. Check in all segments --> gpcheck -f hosts_gpcheck
37. Create file in root --> cat > host_file
mdw
smdw
sdw1
sdw2
37. Disable firewall in all segments:
cd /rawdata/Binaries
source /usr/local/greenplum-db-4.2.0.0/greenplum_path.sh
gpssh -f hostfile_exkeys -e 'service iptables save'
gpssh -f hostfile_exkeys -e 'service iptables stop'
gpssh -f hostfile_exkeys -e 'chkconfig iptables off'
38. Verify the configuration in root
--> gpcheckperf -f host_file -d /data -D
39. Connect to gpadmin --> su - gpadmin
40. Create directory --> mkdir gpconfigs
41. Copy file --> cp /usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsyste
m_config ~/gpconfigs/gpinitsystem_config
42. To gpconfigs dir --> cd gpconfigs
43. Create file --> cat > hostfile_gpinitsystem
sdw1
sdw2
44. Edit file --> vi gpinitsystem_config
-> declare -a DATA_DIRECTORY=(/data/primary)
-> declare -a MIRROR_DATA_DIRECTORY=(/data/mirror)
-> uncomment " MIRROR_PORT_BASE=50000
REPLICATION_PORT_BASE=41000
MIRROR_REPLICATION_PORT_BASE=51000 "
-> :wq! (to save the read only file)
===================14-11-2012
45. Create GPDB using the values defined in the config (gpinitsystem_config) fil
e:
-> source /usr/local/greenplum-db-4.2.0.0/greenplum_path.sh
-> gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem -s smdw
-S

-> confirm overwrite y+[ENTER]


-> continue with GP creation y+[ENTER]
46. To home dir --> cd ~ OR cd /home/gpadmin
47. Edit file --> vi /home/gpadmin/.bash_profile
Add this to the bottom of the line:
GPHOME=/usr/local/greenplum-db
export GPHOME
MASTER_DATA_DIRECTORY=/data/master/gpseg-1
export MASTER_DATA_DIRECTORY
source $GPHOME/greenplum_path.sh
48. Make the changes active --> source .bash_profile
49. Repeat step 46-48 on the standby host.
50. Verify GP instance status summary --> gpstate
51. In gpadmin home,start psql session --> psql template1
52. Create gpadmin DB --> create database gpadmin;
53. Edit file --> vi /home/gpadmin/.bash_profile
Add this before 'source $GPHOME/greenplum_path.sh' line:
PGDATABASE=gpadmin
export PGDATABASE
54. Install
-->
-->
-->
-->
rt 5432

GP Performance Monitor
In ROOT: cd /rawdata/Binaries
unzip greenplum-perfmon-web-4.1.1.8-build-1.RHEL5-x86_64.zip
su - gpadmin
In gpadmin ROOT: gpperfmon_install --enable --password changeme --po

55. Restart database in gpadmin root --> gpstop -r


Continue with GP instance shutdown choose y [ENTER]
56. Verify performance monitor --> ps -ef | grep gpmmon
57. Verify client collection agents --> gpssh -h mdw -h sdw1 -e 'ps -ef | grep g
psmon'
58. Push the GPDB security to the standby master
--> gpscp -h smdw $MASTER_DATA_DIRECTORY/pg_hba.conf =:$MASTER_DATA_DIRE
CTORY/pg_hba.conf
--> gpscp -h smdw ~/.pgpass =:~/.pgpass
59. Change to root go to Binaries dir
--> su --> password
--> cd /rawdata/Binaries
60. Install
-->
-->
-->
-->
-->
-->

GP performance monitor console


/bin/bash greenplum-perfmon-web-4.1.1.8-build-1-RHEL5-x86_64.bin
push [SPACE] to skip license agreement (more than 30 times)
yes [ENTER]
[ENTER]
yes [ENTER]
yes [ENTER]

61. Change the ownership of the newly created dir


--> chown -R gpadmin /usr/local/greenplum-perfmon-web-4.1.1.8-build-1
62. Back to gpadmin --> su - gpadmin
63. Edit file --> vi .bash_profile
Add to the end of the line:
source /usr/local/greenplum-perfmon-web-4.1.1.8-build-1/gpperfmon_path.s
h
[ESC] :wq to save and quit
64. Re-read the contents --> . ~/.bash_profile
65. Create instance of GP performance monitor
--> gpperfmon --setup
Ex: Instance name --> Training
master host for GPDB remote --> n [ENTER]
Instance name --> Training Instance
GPDB default port 5432 --> [ENTER]
Web server default port 28080 --> [ENTER]
Enable SSL for web API --> y [ENTER]
Information for certificate :
Country name: US
State or province name: MA
Locality name: Franklin
Organization name: EdServices
Organizational Unit: Training
Common name: mdw
Email address: gpadmin@mdw
Enable ipV6 --> n [ENTER]
66. Edit file
--> vi $GPPERFMONHOME/instances/Training/conf/gpperfmonui.conf
OR
--> vi /usr/local/greenplum-perfmon-web-4.1.1.8-build-1/instances/Traini
ng/conf/gpperfmonui.conf
Add new line --> allow_trust_logon = yes
Note: setting to yes is insecure and only for testing
68. Edit file
--> vi $MASTER_DATA_DIRECTORY/pg_hba.conf
OR
--> vi /data/master/gpseg-1/pg_hba.conf
Add new line --> host gpperfmon all 0.0.0.0/0 trust
69. In gpadmin, re-read authentication file pg_hba.conf --> gpstop -u
70. Start GP performance monitor web service -- > gpperfmon --start
Using internet browser go to -> https://localhost:28080/
Choose 'I understand the risks'
Add exception
Get certificate
Confirm security exception
*Notes: The content requires the Adobe Flash Player.
Login username: gpadmin ; password: password
*Notes: In windows 7,VMware using NAT network adapter.
If there is another segment using NAT or host-only, the GP connection wo
n't work.

71. Set configuration parameters, in gpadmin user:


--> cd $MASTER_DATA_DIRECTORY
--> vi postgresql.conf
Edit line, uncomment and change value:
#log_min_messages = warning
TO
log_min_messages = info
72. Reload to take effect --> gptop -u

You might also like