Support Video: How to list/ create/ delete collections from Ambari-Infra-Solr using APIs?
- Oct 5, 2026 8:58 AM UTC
- 0 replies
- 3945 views
- Translate All
Many a times, it is necessary for a engineer/administrator to manipulate the content of Ambari-Infra-Solr using the command line utilities. They might or might not have access to the GUI interface.
This video helps to understand the basic manipulation of:
- Listing collections and checking cluster status of Solr cloud.
- Creating new collections.
- Deleting the existing collections.
- To check if ambari-infra-solr server instance is running on the node, run the following:
# ps -elf | grep -i infra-solr
# netstat -plant | grep -i 8886 - If the cluster is Kerberized. Check for valid kerberos tickets:
# klist -A - Obtain a kerberos ticket, if not present:
# kinit -kt /etc/security/keytabs/ambari-infra-solr.service.keytab
$(klist -kt /etc/security/keytabs/ambari-infra-solr.service.keytab
|sed -n "4p"|cut -d ' ' -f7) - List SOLR collections:
curl --negotiate -u : "http://$(hostname -f):8886/solr/admin/collections?action=list" - Create a collection:
# curl --negotiate -u : "http://$(hostname -f):
8886/solr/admin/collections?action=CREATE&name=<collection_name>&numShards=<number>" - The following are the optional Values:
&maxShardsPerNode=<number>
&replicationFactor=<number> - Delete a collection:
# curl --negotiate -u : "http://$(hostname -f):
8886/solr/admin/collections?action=DELETE&name=collection" - Check status of the Solr Cloud cluster:
# curl --negotiate -u : "http://$(hostname -f):
8886/solr/admin/collections?action=clusterstatus&wt=json" | python -m json.tool - INDEX Keys:
*solr_host = Host where solr instance(s) is running.
*collection = Name of collection.
*shard = Name of shard.
*action = CREATE ( to add a collection(s) )
*action = DELETE ( to delete a collection(s) )
*action = CLUSTERSTATUS ( to get the list of available collection(s) in the Solr cloud cluster )

