community.general.aerospike_migrations 模块 – 检查或等待节点之间的迁移
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。
要在剧本中使用它,请指定:community.general.aerospike_migrations
。
概要
这可以用来检查集群中的迁移。这使得在 Aerospike 节点上进行滚动升级/更新变得容易。
如果不需要等待迁移,只需轮询直到端口 3000 可用,或者 asinfo -v status 返回 ok
参数
参数 |
注释 |
---|---|
放弃连接之前尝试连接的时间(毫秒) 默认值: |
|
在将 OK 返回给 ansible 之前,集群应该连续报告“没有迁移”多少次? 默认值: |
|
如果集群密钥发生更改,则失败。如果其他操作正在更改集群,我们可能希望失败 选项
|
|
我们使用哪个主机作为信息连接的种子 默认值: |
|
您是否希望仅在返回之前检查本地节点上的迁移,还是希望在返回之前完成集群中的所有节点? 选项
|
|
用于确定是否剩余 rx 迁移的度量标准键。由于向后兼容性,可更改。 默认值: |
|
用于确定是否剩余 tx 迁移的度量标准键。由于向后兼容性,可更改。 默认值: |
|
检查将返回错误,直到达到集群大小或直到尝试次数用尽 默认值: |
|
连接到 Aerospike 的端口(服务端口) 默认值: |
|
每次检查之间休眠的时间(秒)。 默认值: |
|
当集群中的所有 aerospike 构建都大于 4.3 版本时,将使用 如果在至少有 1 个主机 < 4.3 的集群上指定此选项,则它将被忽略,直到最小版本达到 4.3。 |
|
在我们放弃并失败之前,我们要轮询多少次? 默认值: |
属性
属性 |
支持 |
描述 |
---|---|---|
支持:完全支持 |
可以在 |
|
支持: 不支持 |
在 diff 模式下运行时,将返回有关已更改的内容(或在 |
示例
# check for migrations on local node
- name: Wait for migrations on local node before proceeding
community.general.aerospike_migrations:
host: "localhost"
connect_timeout: 2000
consecutive_good_checks: 5
sleep_between_checks: 15
tries_limit: 600
local_only: false
# example playbook:
- name: Upgrade aerospike
hosts: all
become: true
serial: 1
tasks:
- name: Install dependencies
ansible.builtin.apt:
name:
- python
- python-pip
- python-setuptools
state: latest
- name: Setup aerospike
ansible.builtin.pip:
name: aerospike
# check for migrations every (sleep_between_checks)
# If at least (consecutive_good_checks) checks come back OK in a row, then return OK.
# Will exit if any exception, which can be caused by bad nodes,
# nodes not returning data, or other reasons.
# Maximum runtime before giving up in this case will be:
# Tries Limit * Sleep Between Checks * delay * retries
- name: Wait for aerospike migrations
community.general.aerospike_migrations:
local_only: true
sleep_between_checks: 1
tries_limit: 5
consecutive_good_checks: 3
fail_on_cluster_change: true
min_cluster_size: 3
target_cluster_size: 4
register: migrations_check
until: migrations_check is succeeded
changed_when: false
delay: 60
retries: 120
- name: Another thing
ansible.builtin.shell: |
echo foo
- name: Reboot
ansible.builtin.reboot: