Cluster Singleton Plugins
The Solr distribution includes some Cluster Singleton plugins. Additional plugins can be added - they have to implement the ClusterSingleton interface. The configuration entry may also contain a config element if the plugin implements the ConfigurablePlugin interface.
Plugin Configuration
Cluster Singleton plugins can be configured in two ways, either by using the cluster plugins API or by declaring them in solr.xml.
All cluster plugins must be declared using the same method. It is not possible to declare some plugins in solr.xml and use the cluster plugins API to manage other plugins.
Cluster Singleton Plugins Included with Solr
Solr includes the following plugins out-of-the-box.
Inactive Shard Remover
This plugin will periodically find and delete shards that have an INACTIVE shard state. Shards become INACTIVE when they are split, and the documents they contain are now managed by two or more sub-shards.
Configuration using the cluster plugin API
curl -X POST -H 'Content-type: application/json' -d '{
"add":{
"name": ".inactive-shard-remover",
"class": "org.apache.solr.cluster.maintenance.InactiveShardRemover",
"config": {
"scheduleIntervalSeconds": 3600,
"ttlSeconds": 1800,
"maxDeletesPerCycle": 20
}
}}'
http://localhost:8983/api/cluster/plugin
Configuration in solr.xml
<clusterSingleton name=".inactive-shard-remover" class="org.apache.solr.cluster.maintenance.InactiveShardRemover">
<long name="scheduleIntervalSeconds">3600</long>
<long name="ttlSeconds">1800</long>
<int name="maxDeletesPerCycle">20</int>
</clusterSingleton>
The Inactive Shard Remover plugin configuration MUST use the predefined name .inactive-shard-remover .
There can be only one (or none) of these configurations defined.
|
Configuration
scheduleIntervalSeconds
-
Optional
Default:
900
SecondsThis value determines how often the inactive shard remover will run
ttlSeconds
-
Optional
Default:
900
SecondsThis value defines the minimum period of time that a Shard must be INACTIVE before it is considered for deletion.
maxDeletesPerCycle
-
Optional
Default:
20
This is the maximum number of shards that will be deleted each time the inactive shard remover runs. If there are more Shards that could be deleted, they will be considered during the next cycle.