Coomad to add an entry in the pg_hba.conf file of all the segments including master

Post date: Jan 09, 2015 1:59:32 AM

1. Log into the master.

2. gpssh -f ~/gpconfigs/hostfile

3.$ps -ef | grep postgres | grep silent | grep -v grep | awk '{print $10}' | while read line ; do cp $line"/pg_hba.conf" $line"/pg_hba.conf.bk."$(date +"%m-%d-%Y-%H:%M:%S") ; done

4. ps -ef | grep postgres | grep silent | grep -v grep | awk '{print $10}' | while read line ; do echo "host all gpadmin 172.28.12.250/32 trust" >> $line"/pg_hba.conf" ; done

5.ps -ef | grep postgres | grep silent | grep -v grep | awk '{print $10}' | while read line ; do tail -1 $line/pg_hba.conf ; done