Goal:
This article aims to provide an introduction about how we can issue Solr Admin Commands via Fusion API Endpoints.
Environment:
Fusion 4.x and above
Guide:
Solr has various admin commands that you can access via URLs (either in a browser window or via a utility like curl). However, by default the Solr process is not secured with any password, so some admins use their firewall to block requests on port 8983 (Solr's default port)
Note: Solr's URL-based API is not 100% REST compatible, Solr predates REST so many of the older URL-based commands don't look like REST; new parts of the Solr API do use REST syntax.
But the main Fusion API / Proxy service is secured and there are a couple Fusion endpoints that are effectively a pass-through to the Solr API, but with the added protection of Fusion's login authentication.
In the following examples I assume Fusion and Solr are running on the local machine. If you are accessing a remote server in your cluster, replace "localhost" in the URLs below with the IP address or DNS name of your server.
Entry Points:
There are two main Fusion pass-throughs to Solr that we'll discuss here:
- Global Admin commands (not specific to a collection or Solr core)
- Solr entry point: http://localhost:8983/solr/admin/...
- Fusion entry point: http://localhost:8764/api/solrAdmin/default/admin/collections/...
- Collection Admin commands (specific to a core or collection)
- Solr entry point: http://localhost:8983/solr/COLLECTION_NAME/...
- Fusion entry point: http://localhost:8764/api/solr/COLLECTION_NAME/...
Cluster Status:
Here's an example of a global admin command, getting the status of the SolrCloud cluster:
- via Solr: curl http://localhost:8983/solr/admin/collections?action=CLUSTERSTATUS
- via Fusion: curl -u admin:Password123 http://localhost:8764/api/solrAdmin/default/admin/collections?action=CLUSTERSTATUS
Collection Fields via Luke:
Here's an example of a collection-specific admin command, getting a full report of all fields in the collection via Luke. In this example, the collection name is "techproducts"
- via Solr: curl http://localhost:8983/solr/techproducts/admin/luke
- via Fusion: curl -u admin:Password123 http://localhost:8764/api/solr/techproducts/admin/luke
Comments
0 comments
Article is closed for comments.