Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can't populate Phoenix Index with IndexTool

Can't populate Phoenix Index with IndexTool

New Contributor

Hi,


I'm trying to populate an ASYNC Index with the MR IndexTool. However I can't make it to work on HDP 3.0.0.

When I try to execute the IndexTool like this:

hbase org.apache.phoenix.mapreduce.index.IndexTool --schema <schema> --data-table <table> --index-table <index-name> --output-path <hdfs-path>

I get this exception:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/DefaultParser

at org.apache.phoenix.mapreduce.index.IndexTool.parseOptions(IndexTool.java:183)

at org.apache.phoenix.mapreduce.index.IndexTool.run(IndexTool.java:522)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:90)

at org.apache.phoenix.mapreduce.index.IndexTool.main(IndexTool.java:769)

Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.DefaultParser

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 5 more


This is obviously a problem with the dependencies, but adding commons-cli 1.4, which has that class creates some compability issues with the 1.2 version that is also somewhere on the classpath, but I can't find where. Which jar should I add to the HADOOP_CLASSPATH var when executing the command?

1 REPLY 1

Re: Can't populate Phoenix Index with IndexTool

New Contributor

I had the same problem. It seems to be a classpath dependency issue. In my case I solved it by adding the following line prior to calling the Index Tool: -

 

export HBASE_CLASSPATH_PREFIX=commons-cli-1.4.jar

 

You would need to download the jar above from Maven central.

Don't have an account?
Coming from Hortonworks? Activate your account here