我试图编写一些业务流程状态,以便将HBase转换为高可用模式。要做到这一点,有两个检查要求:
ALL
节点上启动和运行。ALL
节点上启动和运行。two
节点上启动和运行。g 210
因此,我得到了ALL
隐式免费。
{# If all minions passed, then this will pass #}
2_1_example_pod_is_dn_running:
salt.function:
- name: cmd.run
- tgt: 'G@stype:hbase and G@pod_name:example_pod'
- tgt_type: compound
- arg:
- ps aux | grep datanode
- failhard: True
但是如何检查一两个any
呢?
{# Pseduo code. This won't work. #}
2_3_example_pod_is_nn_running:
- name: cmd.run
- tgt: 'G@stype:hbase and G@pod_name:example_pod'
- tgt_type: compound
- arg:
- ps aux | grep namenode
- successful_count: 2 {# <== namenode process has to be running on two minions #}
- failhard: True
发布于 2021-10-14 21:39:57
所以,你想要的是知道哪些奴才应该“失败”检查。如果您知道,您可以使用fail_minions标记将不会有namenode的仆从。
对于这样的事情,几乎总是要么是具体的。当你设置它的时候,你就会知道哪个奴才会有namenode。或者,要跳过检查,使用子集仅在2台服务器上启动namenode。子集将随机选择目标仆从子集的服务器数量,并仅在该子集上运行命令。
https://stackoverflow.com/questions/69255362
复制相似问题