0
votes

We have small array of Greenplum database.

When trying to read External table in it. Getting error

proddb=# select count(*) from ext_table;
ERROR:  external table gphdfs protocol command ended with error. sh: java: command not found  (seg0 slice1 sdw:
40000 pid=8675)
DETAIL:  
Command: 'gphdfs://path/to/hdfs External table revenuereport_stg0, file gphdfs://Path/to/hdfs

We tried :

Checked Java env on greenplum master host.

Also checked , Setting up - the parameters for GPDB

[gpadmin@admin ~]$ gpconfig -c gp_hadoop_home -v "'/usr/lib/gphd'" [gpadmin@admin ~]$ gpconfig -c gp_hadoop_target_version -v "'gphd-2.0'"

But it is failing with this error

[gpadmin@mdw ~]$ gpconfig -c gp_hadoop_home -v "'/usr/lib/gphd'"
20170123:02:02:04:017762 gpconfig:mdw:gpadmin-[ERROR]:-failed updating the postgresql.conf files on host: sdw
20170123:02:02:04:017762 gpconfig:mdw:gpadmin-[ERROR]:-failed updating the postgresql.conf files on host: mdw
20170123:02:02:09:017762 gpconfig:mdw:gpadmin-[ERROR]:-finished with errors

Therefore ,Test for HDFS Access from greenplum host is not working.

Checked if  HDFS is accessible from any of the segment servers

[gpadmin@sdw1 ~]$hdfs dfs -ls hdfs://hdm2:8020/

Any help on it would bemuch appreciated !

2

2 Answers

1
votes
export JAVA_HOME=/usr/local/jdk18
export HADOOP_HOME=/opt/apps/hadoop
export GP_JAVA_OPT='-Xmx1000m -XX:+DisplayVMOutputToStderr'
export PATH=$JAVA_HOME/bin:$PATH
export KRB5CCNAME=$GP_SEG_DATADIR/gpdb-gphdfs.krb5cc
JAVA=$JAVA_HOME/bin/java

java_home 和 hadoop_home 要给具体数值,置于最前面,写成从环境变量获取JAVA_HOME=$JAVA_HOME,GP处理时获取会为空值。