Sunday, December 4, 2011

Remote connection to Greenplum

I've been testing out connectivity with Greenplum from my application via ODBC.

When connecting to Greenplum remotely, you will need to update the file pg_hba.conf found in the DB data directory.

So where is the data directory? If you are using the Demo Image by Greenplum, you can find its location in /home/gpadmin/gpsetup/gp_init_config_4.1

In this file, it says it is in /dbfast1 and /dbfast2:
ARRAY_NAME="Greenplum Database for Hadoop"
MACHINE_LIST_FILE=../hosts
SEG_PREFIX=gph
PORT_BASE=50000
declare -a DATA_DIRECTORY=(/dbfast1 /dbfast2)
MASTER_HOSTNAME=gp-single-host
MASTER_DIRECTORY=/dbfast1
MASTER_PORT=5432
TRUSTED_SHELL=ssh
CHECK_POINT_SEGMENTS=8
ENCODING=UNICODE


There may be multiple files:
[root@gp-single-host dbfast1]# find . -depth -name *hba* -print
./gp-1/pg_hba.conf
./gp0/pg_hba.conf
./gph-1/pg_hba.conf
./gph0/pg_hba.conf

Add the following entries in the file:
host all all 192.168.1.65/32 trust
host all all 192.168.1.85/32 trust

Remember to stop and start your Greenplum database and you should be able to connect now.

No comments:

Post a Comment