Chapter 16. Configuring node-specific values using node attributes


Pacemaker supports the configuration of node-specific values, which you specify using node attributes. You can use node attributes to track information associated with a node. For example, you can define node attributes for how much RAM and disk space each node has, which OS each node uses, or which server room rack each node is in.

There are three primary uses for node attributes:

  • In Pacemaker rules for the cluster configuration

    For example, you can set a node attribute named department to accounting or IT on each node, depending on which department that node is dedicated to. You can then configure a location rule to ensure that an accounting database runs only on servers where department is set to accounting.

    For information about node attribute expressions in Pacemaker rules, see Pacemaker rules.

  • In resource agents for the specific resource requirements

    For example, a database resource agent can use a node attribute to track the latest replication position for use in a promote action.

  • In external scripts for use outside Pacemaker

    For example, you can set data-center and rack attributes for each node, for use by an external inventory script.

Defining a node attribute

You define a node attribute with the pcs node attribute command. A node attribute has a name and a value, and can have a distinct value for each node.

When you define a node attribute with the pcs node attribute command, the node attribute is permanent. Permanent node attributes keep their values even when the cluster restarts on a node.

Note

You can define a transient node attribute, which is kept in the CIB’s status section, and does not remain when the cluster stops on the node. For information about defining transient node attributes, see the crm_attribute(8) and attrd_updater(8) man pages on your system.

Procedure

  1. Run the following commands to define a node attribute with the name rack for node1 and node2, setting a value of 1 for the rack attribute of node1 and a value of 2 for the rack attribute of node2.
# pcs node attribute node1 rack=1
# pcs node attribute node2 rack=2
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat