Friday, October 13, 2023
HomeBig DataUtilizing Apache Solr REST API in CDP Public Cloud

Utilizing Apache Solr REST API in CDP Public Cloud


Summary

The Apache Solr cluster is on the market in CDP Public Cloud, utilizing the “Information exploration and analytics” knowledge hub template. On this article we are going to examine how to hook up with the Solr REST API operating within the Public Cloud, and spotlight the efficiency impression of session cookie configurations when Apache Knox Gateway is used to proxy the site visitors to Solr servers. Data on this weblog put up might be helpful for engineers growing Apache Solr shopper purposes.

The Apache Solr servers within the Cloudera Information Platform (CDP) expose a REST API, protected by Kerberos authentication. Typically, all of the Solr server cases can deal with site visitors when the Solr cluster is operating in a distributed mode. The given Solr server that’s receiving the request from the shopper will ahead the question to all of the servers dealing with shards for the gathering and mix the outcomes earlier than sending again the response to the shopper. For scalability, it’s best to distribute the queries among the many Solr servers in a round-robin trend.

When Solr is deployed within the public cloud utilizing the “knowledge exploration and analytics” knowledge hub template, there are two methods to succeed in the Solr cluster from a separate shopper host. The primary, simpler strategy is to succeed in Solr utilizing Knox Gateway as a proxy. The Apache Knox Gateway is a system that gives a single level of authentication and entry for Apache Hadoop companies in a cluster. Within the CDP Information Hub cluster Knox accepts HTTP primary authentication, so CDP customers can use their workload or machine consumer credentials for authentication. Primarily based on these credentials Knox will ahead the requests to Solr servers in round-robin, utilizing Kerberos and Easy and Protected GSSAPI Negotiation Mechanism (SPNEGO) on behalf of the authenticated finish consumer. (See Determine 1)

Determine 1. Sending Solr queries to the Solr cluster via Knox Gateway

Once we connect with Solr via Knox, the Knox Gateway units the KNOXSESSIONID cookie within the HTTPS response. This cookie might be reused and set in every subsequent request, which is able to drastically enhance the efficiency of dealing with Solr requests.

One other strategy is to hook up with any Solr server occasion instantly, utilizing HTTPS with SPNEGO authentication. On this case the Knox Gateway shouldn’t be used. Organising this connection might be tougher, as no primary authentication is feasible however Kerberos credentials are required. Additionally, if the Solr shopper host is exterior of the CDP atmosphere, then all Solr server ports on the employee hosts have to be uncovered. (See Determine 2) 

Determine 2. Sending Solr queries on to a Solr Server occasion

Benchmarking

To measure the efficiency of the Solr API, we developed a small efficiency benchmark script and executed it from a gateway node of the information hub cluster. The benchmark script is on the market underneath Apache 2.0 license in this repository. 

The next desk and graph current our benchmark outcomes. We executed brief Solr queries on a really small Solr assortment. We various the variety of parallel threads (1..10) and on every thread we executed 100 Solr REST calls utilizing the “curl” command. We examined the Solr API each instantly (connecting to a single given Solr server with out load balancing) and utilizing Knox (connecting to Solr via a Knox Gateway occasion). We repeated the checks each with and with out reusing the cookies despatched again within the HTTPS responses. In all circumstances, the benchmark script was operating on the gateway host of the Solr knowledge hub cluster. 

Desk 1: Efficiency benchmark outcomes (common response time and throughput) displaying the impact of cookie reuse between subsequent Solr API calls. Colours of the cells correspond to strains visualized in Determine 3.

 

Determine 3: Efficiency benchmark outcomes (common response) displaying the impact of cookie reuse between subsequent Solr API calls. Colours of the strains correspond to colours utilized in Desk 1.

Our outcomes clearly present how vital it’s to concentrate to make use of the KNOXSESSIONID cookie when connecting to Solr utilizing the Knox Gateway. When the cookie is about, the efficiency is principally the identical, suggesting that the Knox Gateway shouldn’t be the bottleneck for this specific benchmark. Nonetheless, with out setting KNOXSESSIONID we get a really important efficiency degradation, which is brought on by the truth that the Knox Gateway must authenticate every HTTPS request one after the other, but when this cookie is about Knox can depend on earlier authentication.

Conclusion

We described two methods to hook up with Solr REST API within the CDP Public Cloud; hopefully the knowledge on this weblog put up will allow you to to decide on the perfect one on your mission. Connecting via Knox is preferable because the Knox Gateway supplies load balancing and likewise eases the authentication by eliminating the necessity for shopper facet Kerberos configuration. Direct connection to the Solr server cases can be potential and could be strategy if Knox gateway turns into a bottleneck or if the additional routing step made by Knox proves so as to add an excessive amount of further latency to the site visitors. Nonetheless, for many of the circumstances we advise beginning the mission through the use of Knox Gateway to succeed in Solr, primarily as a result of organising safe connection and cargo balancing for a direct Solr entry might be tougher. Utilizing the KNOXSESSIONID cookie may also help to succeed in efficiency just like the direct setup.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments