The cluster.indices.close.enable
setting in Elasticsearch controls whether indices can be closed within the cluster. When enabled, it allows users to close indices, which can help conserve resources and improve cluster performance.
- Default Value: true
- Possible Values: true, false
- Recommendations: It's generally recommended to keep this setting enabled unless there's a specific reason to prevent index closure.
This setting is a dynamic cluster-level setting that can be updated at runtime. When set to false
, it prevents any index from being closed, which can be useful in certain operational scenarios or to enforce specific policies.
Example
To disable the ability to close indices cluster-wide:
PUT _cluster/settings
{
"persistent": {
"cluster.indices.close.enable": false
}
}
Reasons for changing this setting might include:
- Preventing accidental closure of critical indices
- Enforcing a policy where all indices should remain open for immediate searchability
- Temporarily disabling index closure during maintenance or migration processes
Effects of the change:
- When set to
false
, any attempt to close an index will result in an error - Existing closed indices will remain closed, but cannot be reopened if the setting is
false
Common Issues or Misuses
- Disabling this setting without proper communication can lead to confusion among team members trying to manage indices
- Leaving it disabled for extended periods may result in unnecessary resource consumption if unused indices remain open
Do's and Don'ts
Do's:
- Use this setting as part of a broader index management strategy
- Communicate changes to this setting to all relevant team members
- Re-enable the setting after any temporary disabling for maintenance
Don'ts:
- Don't disable this setting without a clear reason and plan
- Avoid leaving unused indices open if this setting is disabled, as it may impact cluster performance
Frequently Asked Questions
Q: Can I close specific indices while keeping this setting enabled?
A: Yes, when cluster.indices.close.enable
is set to true
(default), you can close individual indices using the close index API.
Q: If I disable this setting, what happens to already closed indices?
A: Already closed indices remain closed. However, you won't be able to reopen them until the setting is enabled again.
Q: Does this setting affect index creation or deletion?
A: No, this setting only affects the ability to close or reopen indices. Creation and deletion operations are not impacted.
Q: Can I use index patterns with this setting?
A: This is a cluster-wide setting and doesn't work with index patterns. It affects all indices in the cluster equally.
Q: How does this setting interact with index lifecycle management (ILM)?
A: If this setting is disabled, ILM policies that include a 'close' action will fail to close indices. It's important to align this setting with your ILM strategies.