Community Articles
Find and share helpful community-sourced technical articles

How to clean up & recreate collections on Ambari Infra

Sometimes you need to clean up an installation that went with issues and there are missing collections on Ambari Infra solr.

In order to do this, go thry the next list of steps to clean up solr collections and recreate them from scratch.

IMPORTANT: This steps will delete all collection data, so unless you are sure data can be removed dont perform these steps.

1) Switch adudit solr to OFF from Ranger -> Ranger Audit configuration. Restarted all affected.
2) Stop Altas service
3) From the ambari infra host remove all the collections using rest api
$ kinit -kt /etc/security/keytabs/ambari-infra-solr.service.keytab infra-solr/....
$ export SOLR_HOST=<solr host fqdn>
## Ranger collection:
$ curl -i -v --negotiate -u : "http://$SOLR_HOST:8886/solr/admin/collections?action=DELETE&name=ranger_audits"
## Atlas collections:
$ curl -i -v --negotiate -u : "http://$SOLR_HOST:8886/solr/admin/collections?action=DELETE&name=vertex_index"
$ curl -i -v --negotiate -u : "http://$SOLR_HOST:8886/solr/admin/collections?action=DELETE&name=edge_index"
$ curl -i -v --negotiate -u : "http://$SOLR_HOST:8886/solr/admin/collections?action=DELETE&name=fulltext_index"
4) Stop the Ambari Infra
5) Remove the /infra-solr znode
IMPORTANT: This next command will remove all the configuration of all the collections on zookeeper for infra-solr.
$ zookeeper-client
> rmr /infra-solr
6) Start Ambari Infra again (once started the znode /infra-solr should be created again)
7) Switch adudit solr back ON from Ranger -> Ranger Audit configuration
8) Restart all affected
9) Still need to restart all Ranger components one more time
10) Start Atlas
11) After all services come up on zookeeper you should see the following znodes have been created:
[vertex_index, edge_index, fulltext_index, ranger_audits]


Don't have an account?
Version history
Revision #:
1 of 1
Last update:
‎04-12-2017 09:13 PM
Updated by:
Top Kudoed Authors