이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Appendix A. OCF Return Codes


This appendix describes the OCF return codes and how they are interpreted by Pacemaker.
The first thing the cluster does when an agent returns a code is to check the return code against the expected result. If the result does not match the expected value, then the operation is considered to have failed, and recovery action is initiated.
For any invocation, resource agents must exit with a defined return code that informs the caller of the outcome of the invoked action.
There are three types of failure recovery, as described in Table A.1, “Types of Recovery Performed by the Cluster”.
Table A.1. Types of Recovery Performed by the Cluster
TypeDescriptionAction Taken by the Cluster
soft
A transient error occurred.
Restart the resource or move it to a new location .
hard
A non-transient error that may be specific to the current node occurred.
Move the resource elsewhere and prevent it from being retried on the current node.
fatal
A non-transient error that will be common to all cluster nodes occurred (for example, a bad configuration was specified).
Stop the resource and prevent it from being started on any cluster node.
Table A.2, “OCF Return Codes” provides The OCF return codes and the type of recovery the cluster will initiate when a failure code is received. Note that even actions that return 0 (OCF alias OCF_SUCCESS) can be considered to have failed, if 0 was not the expected return value.
Table A.2. OCF Return Codes
Return CodeOCF LabelDescription
0
OCF_SUCCESS
The action completed successfully. This is the expected return code for any successful start, stop, promote, and demote command.
Type if unexpected: soft
1
OCF_ERR_GENERIC
The action returned a generic error.
Type: soft
The resource manager will attempt to recover the resource or move it to a new location.
2
OCF_ERR_ARGS
The resource’s configuration is not valid on this machine. For example, it refers to a location not found on the node.
Type: hard
The resource manager will move the resource elsewhere and prevent it from being retried on the current node
3
OCF_ERR_UNIMPLEMENTED
The requested action is not implemented.
Type: hard
4
OCF_ERR_PERM
The resource agent does not have sufficient privileges to complete the task. This may be due, for example, to the agent not being able to open a certain file, to listen on a specific socket, or to write to a directory.
Type: hard
Unless specifically configured otherwise, the resource manager will attempt to recover a resource which failed with this error by restarting the resource on a different node (where the permission problem may not exist).
5
OCF_ERR_INSTALLED
A required component is missing on the node where the action was executed. This may be due to a required binary not being executable, or a vital configuration file being unreadable.
Type: hard
Unless specifically configured otherwise, the resource manager will attempt to recover a resource which failed with this error by restarting the resource on a different node (where the required files or binaries may be present).
6
OCF_ERR_CONFIGURED
The resource’s configuration on the local node is invalid.
Type: fatal
When this code is returned, Pacemaker will prevent the resource from running on any node in the cluster, even if the service configuraiton is valid on some other node.
7
OCF_NOT_RUNNING
The resource is safely stopped. This implies that the resource has either gracefully shut down, or has never been started.
Type if unexpected: soft
The cluster will not attempt to stop a resource that returns this for any action.
8
OCF_RUNNING_MASTER
The resource is running in master mode.
Type if unexpected: soft
9
OCF_FAILED_MASTER
The resource is in master mode but has failed.
Type: soft
The resource will be demoted, stopped and then started (and possibly promoted) again.
other
N/A
Custom error code.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.