Goal
Configure Solr replica placement to target specific node types in Fusion 5.9 and above, using the Lucidworks-customized PolicyAffinityPlacementFactory
plugin. This is particularly relevant after the deprecation of Solr's native autoscaling policy framework in Solr 9.
Environment
- Fusion 5.9.2 and above
- Solr 9.1 and above
- Kubernetes deployments (EKS, GKE, AKS, or other platforms)
Guide
Understand the Lucidworks replica placement plugin
Fusion 5.9+ includes a customized plugin for Solr replica placement:
com.lucidworks.solr.plugin.placement.PolicyAffinityPlacementFactory
This plugin extends the default AffinityPlacementFactory
and allows defining placement policies that map replica types (NRT, TLOG, PULL) to Solr node types, which are identified via the -Dnode_type
system property in your Solr container spec (for example, -Dnode_type=search,analytics
).
Configure the placement plugin
To enable and configure the plugin, POST the following payload to the Solr /api/cluster/plugin
endpoint:
Example cURL for Fusion.
curl -u "<username>:<password>" -X POST -H "Content-Type: application/json" \ "http://104.196.224.82:6764/api/solrAdmin/api/cluster/plugin" \ -d '{ "update": { "name": ".placement-plugin", "class": "com.lucidworks.solr.plugin.placement.PolicyAffinityPlacementFactory", "config": { "minimalFreeDiskGB": 20, "prioritizedFreeDiskGB": 200, "withCollections": {}, "collectionNodeType": {}, "policies": { "system": { "*": "system" }, "search": { "nrt": "search", "tlog": "search", "pull": "analytics,search" }, "analytics": { "*": "analytics" } }, "strictPolicy": false } } }'
Key configuration fields
- policies: Each key is a policy name. Collections must reference a policy by setting the
property.policy
property in their configuration. - replica types: Use lowercase names
nrt
,tlog
, andpull
. The special value"*"
applies to all replica types. - node_type: Each Solr node must have the
node_type
system property set to match the policy definitions. - strictPolicy:
false
(default): Nonexistent or misconfigured policies will be ignored and fallback logic is applied.true
: Placement will fail if nodes don't meet policy constraints or if an unknown policy is referenced.
Example: Assign collections to policies
Ensure your collections are tagged with the appropriate policy by setting the property.policy
field during creation.
This instructs Solr to use the search
policy block defined in the plugin config.
Understand Fusion's default behavior
Fusion applies internal logic when collections are created through its UI or APIs. The following rules apply:
- type=DATA: NRT and PULL replicas are placed in
search
; PULL replicas may also go toanalytics
. TLOG and PULL must be explicitly requested viasolrParams
. - type=SIGNALS: Replicas are placed in
analytics
. Default is NRT unless changed. - type=SIGNALS_AGGREGATION: Replicas default to
search
, regardless ofsolrParams
. Requires a placement policy override to useanalytics
. - type=QUERY_REWRITE: Single-shard NRT replica in
search
.
Important: Replica placement decisions are only applied at collection creation time. Updating an existing collection's policy does not reassign existing replicas.
Additional guidance
- To ensure configuration changes take effect, restart the Solr deployments and statefulsets.
- If an application is created without the
relatedObjects=false
parameter, Fusion may auto-create related collections (e.g.,signals
,signals_aggr
), preventing full control over placement configuration.
For full control, create collections explicitly using Solr APIs and assign appropriate properties to match your policy configurations.
Comments
0 comments
Article is closed for comments.