lucidworks / spark-solr

Tools for reading data from Solr as a Spark RDD and indexing objects from Spark into Solr using SolrJ.
Apache License 2.0
446 stars 251 forks source link

Solr with Basic Auth #269

Open DwaneHall opened 5 years ago

DwaneHall commented 5 years ago

Hi team. I’m just wondering if there are any missing dependencies on the classpath for this project as I'm running into a class not found exception when connecting to a secure solr cloud instance (basic auth, ssl). Everything is working as expected on a non-secure solr cloud instance.

The process looks pretty straightforward according to the doco so I’m wondering if I’m missing anything obvious or if I need to bring any extra classes to the classpath when using this project?

Any advice would be greatly appreciated.

Thanks,

Dwane

Environments tried 7.6 and 8.1.1 solr cloud SSL, Basic Auth Plugin, Rules Based Authorisation Plugin enabled Spark v 2.4.3 Spark-Solr build spark-solr-3.7.0-20190619.153847-16-shaded.jar

ClassNotFoundSparkSolr.txt


./spark-2.4.3-bin-hado./spark-2.4.3-bin-hadoop2.7/bin/spark-shell --master local[*] --jars spark-solr-3.7.0-20190619.153847-16-shaded.jar --conf 'spark.driver.extraJavaOptions=-Dbasicauth=solr:SolrRocks'

val options = Map(
        "collection" -> "My_Collection",
        "zkhost" -> "zkn1:2181,zkn2:2181,zkn3:2181/solr/SPARKTEST"
      )

val df = spark.read.format("solr").options(options).load 
parisni commented 5 years ago

hi

the syntax for basic auth you are using is correct and works for me (spark 2.4.1 / solr 8.1.1 / spark-solr 3.7.0)

kiranchitturi commented 4 years ago

Can you try including jetty-client into the classpath? We exclude jetty in the shaded jar