使用gphdfs协议创建外部表时出现JNI错误:greenplum

时间:2016-12-02 14:50:36

标签: greenplum

1)使用链接 - http://gpdb.docs.pivotal.io/4360/admin_guide/load/topics/g-one-time-hdfs-protocol-installation.html#topic20

完成“一次性HDFS协议安装”

2)将hdfs系统上的'csv'文件复制到路径 - data/etl/ext01

3)使用以下命令创建外部表 create external table orgData(orghk varchar(200),eff_datetime timestamp, source varchar(20), handle_id varchar(200), created_by_d varchar(100), created_datetime timestamp) location ('gphdfs://<hostname>:8020/data/etl/ext01/part-r-00000-3eae416a-d0ff-4562-a762-d53469d42cd2.csv') Format 'CSV' (DELIMITER ',')

但是在执行命令后 - 从orgData中选择* 我收到了以下错误

ERROR: ERROR: external table gphdfs protocol command ended with 
error. Error: A JNI error has occurred, please check your 
installation and try again (seg1 slice1 
<hostname2>:40000 pid=4977) Detail:  

Exception in thread "main" java.lang.NoClassDefFoundError: 
org/apache/hadoop/mapreduce/lib/input/FileInputFormat   at 
java.lang.Class.getDeclaredMethods0(Native Method)  at 
java.lang.Class.privateGetDeclaredMethods(Class.java:2701)  at 
java.lang.Class.privateGetMethodRecursive(Class.java:3048)  at 
java.lang.Class.getMethod0(Class.java:3018)     at 
java.lang.Class.getMethod(Class.java:1784)  at 
sun.launcher.LauncherHelper.valid Command: 
'gphdfs://<hostname>:8040/data/etl/ext01/part-r-00000-3eae416a-d0ff-4562-a762-d53469d42cd2.csv' 
External table orgdata, file 
gphdfs://<hostname>:8040/data/etl/ext01/part-r-00000-3eae416a-d0ff-4562-a762-d53469d42cd2.csv

我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

您是否可以验证是否在所有段上设置了JAVA_HOMEHADOOP_HOME,然后重新启动了群集?

gpssh -f clusterHostfile -e 'egrep (JAVA_HOME|HADOOP_HOME) ~/.bashrc | wc -l'

您应该会看到群集中每个主机的号码2