lucidworks / hive-solr

Code to index Hive tables to Solr and Solr indexes to Hive
Apache License 2.0
47 stars 34 forks source link

Support for Solr basic authentication #64

Open ykzeng opened 5 years ago

ykzeng commented 5 years ago

Hi all,

I am trying to use the hive_1x branch and have built solr-hive-serde-3.0.0.jar based on your instructions. I was also able to add this jar in my Hive runtime and create external table based on the docs here: https://doc.lucidworks.com/fusion/2.4/Importing_Data/Import-via-Hive.html.

However, when I tried to insert data into the Hive-Solr table, I am getting the followings:

Caused by: shaded.org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at https://example.com:8983/solr/hive_solr_test: Expected mime type application/octet-stream but got text/html. <html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 401 require authentication</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /solr/hive_solr_test/update. Reason:
<pre>    require authentication</pre></p>
</body>
</html>

Obviously this is due to improper authentication. But throughout the readme file I only saw instructions on how to authenticate through Kerberos, while our Solr cloud enforces basic username/password authentication. Could you guys provide some insights on how I can apply basic authentication in hive-solr driver?

Thanks, Vincent

danillogontijo commented 5 years ago

Using param 'solr.server.url' you'd pass 'http://user:password@solr.instance:8983/solr', but using Zookeeper Quorum param 'solr.zkhost' I can't connect with basic auth and I don't know how do it.