question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load elasticsearch class

See original GitHub issue

I am trying to run this code:

            var es_reader = spark.Read()
                            .Format("org.elasticsearch.spark.sql")
                            .Option("inferSchema", "true")
                            .Option("es.read.field.as.array.include", "tags")
                            .Option("es.nodes", "myelasticsearch:9200")
                            .Option("es.net.http.auth.user", "elastic")
                            .Option("es.net.http.auth.pass", "mypass");

                           var security_df = es_reader.Load("my-index/");
[JvmBridge] java.lang.ClassNotFoundException: Failed to find data source: org.elasticsearch.spark.sql. Please find packages at http://spark.apache.org/third-party-projects.html

This same code is working in Jupyter. I have no clue what’s going on… Can someone help me pls

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
GoEddiecommented, Aug 20, 2019

resource must be specified for Elasticsearch resources

https://www.elastic.co/guide/en/elasticsearch/hadoop/master/configuration.html#_required_settings

You must add the option es.resource ??

0reactions
mohanwdcommented, Aug 30, 2020

Hi, Folks I am also facing the similar issue. But one small difference is if i add the dependency in pyspark --packages org.elasticsearch:elasticsearch-hadoop:7.7.1 I am able to establish a connection / its trying to connect to the es cluster. Whereas with spark-submit i could not solve the class not found issue tried with hadoop / spark jars both

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to load plugin class [org.elasticsearch.xpack.security ...
Hi, I am completely new to elastic, trying to use it inside a magento store on kubernetes. (It worked with 6.8.5).
Read more >
Failed to load plugin class [org.elasticsearch.xpack. ...
I am trying to connect with elasticsearch server(6.8.0) which is x-pack enabled and starting without any error. When I am trying to connect ......
Read more >
Intermittent exception using high-level-rest-client. Unable ...
load (XContentBuilderExtension.class)); This loop finds no XContentBuilderExtension while the [org.elasticsearch.common.xcontent.
Read more >
"failed to load plugin class" When using Sgadmin
i runned sgadmin.sh. Then i get this error : WARNING: Seems you want connect to the Elasticsearch HTTP port. sgadmin connects on the...
Read more >
How To Troubleshoot Common ELK Stack Issues
“Unable to fetch mapping” indicates that Elasticsearch does not contain any entries that match the default logstash-* pattern. Typically, this ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found