[ 
https://issues.apache.org/jira/browse/PHOENIX-4880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16611483#comment-16611483
 ] 

Josh Elser commented on PHOENIX-4880:
-------------------------------------

Let me re-summarize to make sure the problem and solution are clear. Using 
`bin/hbase` to launch Phoenix tools ultimately fails because phoenix-server.jar 
wasn't bundling some necessary classes. If we trivially tried to include those 
jars, they fail a different way because it conflicts with other HBase 
dependencies (e.g. commons-cli).

The solution was to make sure that phoenix-server.jar brings all dependencies 
it needs *except* those that are provided by HBase in the standard location: 
e.g. hbase, hadoop, log4j, slf4j, zookeeper, and protobuf jars. We can also 
remove things from phoenix-core which we know aren't relevant when inside 
HBase: e.g. jline, sqlline.

The rest of the dependencies are things that phoenix-core declares it needs, so 
we bundle it and ensure that it's relocated to {{org.apache.phoenix.shaded}}.

I tested that sqlline.py still works as expected and that I can launch 
IndexTool per the Phoenix documentation.

> Phoenix IndexTool doesn't work on HBase2 per documentation
> ----------------------------------------------------------
>
>                 Key: PHOENIX-4880
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-4880
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Major
>             Fix For: 4.15.0, 5.1.0
>
>         Attachments: PHOENIX-4880.001.patch
>
>
> The website documentation states that to run {{IndexTool}}, you should do:
> {code}
> $ hbase org.apache.phoenix.mapreduce.index.IndexTool
> {code}
> This ends up running the class using the phoenix-server jar which fails 
> because we have conflicting versions of commons-cli, as described by 
> HBASE-20201. Phoenix-client.jar does not have this problem as we did the 
> workaround there as well.
> {code}
> $ hadoop jar $PHOENIX_HOME/phoenix-*client.jar 
> org.apache.phoenix.mapreduce.index.IndexTool
> {code}
> Does work, however. I suppose we still want to fix phoenix-server.jar? (no 
> reason not to?)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to