Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (2)
avatar
Contributor

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.

 

  1. 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
  2. If the cluster is Kerberized. Check for valid kerberos tickets:
    # klist -A
  3. 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)
  4. List SOLR collections:
    curl --negotiate -u : "http://$(hostname -f):8886/solr/admin/collections?action=list"
  5. Create a collection:
    # curl --negotiate -u : "http://$(hostname -f):
    8886/solr/admin/collections?action=CREATE&name=<collection_name>&numShards=<number>"
  6. The following are the optional Values:
    &maxShardsPerNode=<number>
    &replicationFactor=<number>
  7. Delete a collection: 
    # curl --negotiate -u : "http://$(hostname -f):
    8886/solr/admin/collections?action=DELETE&name=collection"
  8. 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
  9. 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 )
3,946 Views
0 Kudos
Version history
Last update:
‎04-08-2020 11:43 PM
Updated by: