Ansible 批量安装 node_exporter
· 阅读需 3 分钟
Ansible 批量安装 node_exporter
安装配置 Ansible
配置 hosts ,并测试连通性
# 节点主机名写入hosts
echo "192.168.0.112 prome-master01" >> /etc/hosts
echo "192.168.0.127 prome-node01" >> /etc/hosts
# master上生成ssh key 并拷贝到node上
ssh-keygen
ssh-copy-id prome_node_01
# 测试ssh联通
ssh prome_node_01
Master 上安装 ansible
yum install -y ansible
# 关闭hostcheck
vim /etc/ansible/ansible.cfg
ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no