In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what are the OCF return values". In the daily operation, I believe many people have doubts about the OCF return values. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "what are the OCF return values?" Next, please follow the editor to study!
3 return value
For any call, the resource agent must give a return value when exiting, which tells the caller.
3.1 OCF_SUCCESS (0)
The behavior was carried out completely successfully. This is the expected return value for all successful start, stop, promote, demote,migrate_from, migrate_to, meta_data, help, and usage after successful execution
For monitor (and its discarded alias status), use a convention to use this return value:
For some basic (stateless) resources, the OCF_SUCCESS of the monitor behavior means that the resource is running, and resources that are not running or normally closed must return OCF_NOT_RUNNING
For master/slave (stateful) resources, OCF_SUCCESS means that resources run in slave mode, resources running as Master resources should return OCF_RUNNING_MASTER, while normally closed resources must return OCF_NOT_RUNNING
3.2 OCF_ERR_GENERIC (1)
The behavior returns a general error. When there is no other error code, the resource agent should use this exit code.
The cluster resource manager interprets the exit code as a soft error. This means that, unless otherwise stated, the resource on which such an error occurs is usually restarted on the same node.
3.3 OCF_ERR_ARGS (2)
Call parameters with the wrong resource. This is a security warning when a resource is called, such as using the wrong number of parameters.
Note: if the resource call uses an unsupported behavior parameter, you should not use this return code, but use OCF_ERR_UNIMPLEMENTED
3.4 OCF_ERR_UNIMPLEMENTED (3)
This value should be returned when the resource agent performs an unimplemented behavior.
Not all resource agent behaviors are mandatory. Promote, demote,migrate_from,notify, etc., are optional behaviors, and resource proxies may not be implemented. For example, when a stateless resource agent is misconfigured as a master/slave resource, the resource agent should return OCF_ERR_UNIMPLEMENTED in promote and demote behaviors.
3.5 OCF_ERR_PERM (4)
This error is due to lack of permissions. Maybe the resource doesn't have permission to open a file, a socket, a directory, or something like that.
Cluster resource management interprets this error as a hard error. This means that if there is no special configuration, the resource manager will try to restart the resource on another node (maybe there is no such permission problem on the new node).
3.6 OCF_ERR_INSTALLED (5)
This error is due to a missing component that is required for the execution of the behavior. This may be because a required binary is not executed or a critical configuration file is unreadable.
Cluster resource management interprets this error as a hard error. This means that if there is no special configuration, the resource manager will try to restart the resource on another node (perhaps the relevant files or binaries are available on the new node).
3.7 OCF_ERR_CONFIGURED (6)
This error is due to the misconfiguration of resources. For example, for example, the user is configured as a string of letters where integers are needed.
Cluster resource management interprets this error as a fatal error. Because this configuration file spreads to the full cluster, this error cannot be recovered at another node. When this error occurs while the resource is running, the cluster manager attempts to close the resource and wait for the system administrator to intervene.
3.8 OCF_NOT_RUNNING (7)
The resource was not found to be running. This is the exit code returned by the monitor behavior. Note that returning this value means that the resource is either safely closed or not started.
If the resource is not running under an error condition, the monitor behavior should return one of the OCF_ERR_ exit codes, or OCF_FAILED_MASTER
3.9 OCF_RUNNING_MASTER (8)
The resource is not running as Master. This return value applies only to Master/Slave resources, as well as to monitor behaviors.
Note:
There is no exit code for slave identity run. This is because it is no different from the normal operation of stateless resources. So for stateful resources running as slave, the return code for monitor behavior should be OCF_SUCCESS.
3.10 OCF_FAILED_MASTER (9)
The resource was found to have failed to run as master. This return value applies only to the monitor behavior of Master/Slave resources.
The resource manager interprets this error as a soft error. This means that if there is no other configuration, the resource will be downgraded (demoting), stopped, started, and promoted (promoting) in place (on the same node).
At this point, the study of "what are the return values of OCF" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.