crm_attribute
crm_attribute
is a command-line tool from the crmsh (Cluster Resource Manager Shell) suite used in Pacemaker clusters. It allows administrators to query, set, and remove dynamic attributes stored in the Cluster Information Base (CIB). These attributes can be used to influence cluster behavior, store configuration flags, or serve as markers for custom policies.
Purpose
Dynamic Configuration: Modify and update cluster-wide or node-specific attributes on the fly, which can affect resource allocation, priority, or other policy decisions.
Monitoring and Troubleshooting: Query existing attributes to help diagnose cluster issues or verify that configuration changes have taken effect.
Automation and Scripting: Integrate attribute management into scripts for automated cluster management and operational tasks.
Basic Syntax
Without any options, it may list current attributes. Common operations include listing, setting, and unsetting attributes.
Common Options
-l, --list
List all the currently defined attributes in the cluster.-S, --set
Set or update an attribute by specifying a key-value pair.Example:
This command sets the attribute
maintenance
totrue
across the cluster.-U, --unset
Remove a specific attribute.Example:
This command removes the
maintenance
attribute.-h, --help
Display help and usage information.
Example Usage
Listing Attributes: To view all current attributes in the cluster:
Setting an Attribute: To mark the cluster as in maintenance mode:
This attribute might be used by other policies or scripts to modify resource behavior during maintenance windows.
Unsetting an Attribute: When maintenance is complete, remove the attribute:
Conclusion
crm_attribute
provides a flexible and dynamic way to manage custom attributes within a Pacemaker cluster. By allowing administrators to list, set, and remove attributes directly from the command line, it supports both manual configuration and automated scripts—helping to tailor cluster behavior and assist in monitoring and troubleshooting.
Last updated