9.12. Administering fence devices
The pcs command-line interface provides a variety of commands you can use to administer your fence devices after you have configured them.
9.12.1. Displaying configured fence devices 링크 복사링크가 클립보드에 복사되었습니다!
The following command shows all currently configured fence devices. If a stonith_id is specified, the command shows the options for that configured fencing device only. If the --full option is specified, all configured fencing options are displayed.
pcs stonith config [stonith_id] [--full]
9.12.2. Exporting fence devices as pcs commands 링크 복사링크가 클립보드에 복사되었습니다!
You can display the pcs commands that can be used to re-create configured fence devices on a different system using the --output-format=cmd option of the pcs stonith config command.
The following commands create a fence_apc_snmp fence device and display the pcs command you can use to re-create the device.
# pcs stonith create myapc fence_apc_snmp ip="zapc.example.com" pcmk_host_map="z1.example.com:1;z2.example.com:2" username="apc" password="apc"
# pcs stonith config --output-format=cmd
Warning: Only 'text' output format is supported for stonith levels
pcs stonith create --no-default-ops --force -- myapc fence_apc_snmp \
ip=zapc.example.com password=apc 'pcmk_host_map=z1.example.com:1;z2.example.com:2' username=apc \
op \
monitor interval=60s id=myapc-monitor-interval-60s
9.12.3. Exporting fence level configuration 링크 복사링크가 클립보드에 복사되었습니다!
The pcs stonith config and the pcs stonith level config commands support the --output-format= option to export the fencing level configuration in JSON format and as pcs commands.
-
Specifying
--output-format=cmddisplays thepcscommands created from the current cluster configuration that configure fencing levels. You can use these commands to re-create configured fencing levels on a different system. -
Specifying
--output-format=jsondisplays the fencing level configuration in JSON format, which is suitable for machine parsing.
9.12.4. Modifying and deleting fence devices 링크 복사링크가 클립보드에 복사되었습니다!
Modify or add options to a currently configured fencing device with the following command.
pcs stonith update stonith_id [stonith_device_options]
Updating a SCSI fencing device with the pcs stonith update command causes a restart of all resources running on the same node where the fencing resource was running. You can use either version of the following command to update SCSI devices without causing a restart of other cluster resources. SCSI fencing devices can be configured as multipath devices.
pcs stonith update-scsi-devices stonith_id set device-path1 device-path2
pcs stonith update-scsi-devices stonith_id add device-path1 remove device-path2
Use the following command to remove a fencing device from the current configuration.
pcs stonith delete stonith_id
9.12.5. Manually fencing a cluster node 링크 복사링크가 클립보드에 복사되었습니다!
You can fence a node manually with the following command. If you specify the --off option this will use the off API call to stonith which will turn the node off instead of rebooting it.
pcs stonith fence node [--off]
In a situation where no fence device is able to fence a node even if it is no longer active, the cluster may not be able to recover the resources on the node. If this occurs, after manually ensuring that the node is powered down you can enter the following command to confirm to the cluster that the node is powered down and free its resources for recovery.
If the node you specify is not actually off, but running the cluster software or services normally controlled by the cluster, data corruption and cluster failure occurs.
pcs stonith confirm node
9.12.6. Disabling a fence device 링크 복사링크가 클립보드에 복사되었습니다!
To disable a fencing device, run the pcs stonith disable command.
The following command disables the fence device myapc.
# pcs stonith disable myapc
9.12.7. Preventing a node from using a fencing device 링크 복사링크가 클립보드에 복사되었습니다!
To prevent a specific node from using a fencing device, you can configure location constraints for the fencing resource.
The following example prevents fence device node1-ipmi from running on node1.
# pcs constraint location node1-ipmi avoids node1