saltstack安装
Posted 从零开始的linux
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了saltstack安装相关的知识,希望对你有一定的参考价值。
saltstack安装
机器
192.168.6.71 node01
192.168.6.72 node02
node01
# yum install -y epel-release
# yum -y install salt-master salt-minion
node02
# yum install -y epel-release
# yum -y install salt-minion
node01
# vim /etc/salt/minion //16行
master: 192.168.6.71
启动服务
[root@node01 ~]# service salt-master startStarting salt-master daemon: [ OK ][root@node01 ~]# service salt-minion startStarting salt-minion daemon: [ OK ]
node02
[root@node02 ~]# vim /etc/salt/minion
master: 192.168.6.71
启动服务
[root@node02 ~]# service salt-minion startStarting salt-minion daemon: [ OK ]
saltstack配置认证
root@node01 ~]# salt-key -a node02
The following keys are going to be accepted:
Unaccepted Keys:
node02
Proceed? [n/Y] y
Key for minion node02 accepted.
[root@node01 ~]# salt-key -a node01
The following keys are going to be accepted:
Unaccepted Keys:
node01
Proceed? [n/Y] y
Key for minion node01 accepted.
查看签名的所有主机
[root@node01 ~]# salt-key
Accepted Keys:
node01
node02
Denied Keys:
Unaccepted Keys:
Rejected Keys:
[root@node02 ~]# ls /etc/salt/pki/minion/
minion_master.pub minion.pem minion.pub
验证
[root@node01 ~]# salt '*' test.ping
node02:
True
node01:
True
[root@node01 ~]# salt '*' cmd.run 'df -h'
node02:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.5G 2.5G 6.6G 28% /
tmpfs 491M 12K 491M 1% /dev/shm
/dev/sda1 190M 27M 154M 15% /boot
/dev/sr0 3.6G 3.6G 0 100% /mnt
node01:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 9.5G 2.7G 6.4G 30% /
tmpfs 491M 16K 491M 1% /dev/shm
/dev/sda1 190M 27M 154M 15% /boot
/dev/sr0 3.6G 3.6G 0 100% /mnt
以上是关于saltstack安装的主要内容,如果未能解决你的问题,请参考以下文章