Centos 7安装salt-stack

网友投稿 842 2022-10-13

Centos 7安装salt-stack

Centos 7安装salt-stack

1.环境准备​

[root@master ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.210 master192.168.56.211 minion01192.168.56.212 minion02[root@master ~]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core)

2.安装salt源​​​​

[root@master ~]# sudo rpm --import ~]# curl -fsSL | sudo tee /etc/yum.repos.d/salt.repo

3.在master节点安装salt

[root@master ~]# yum -y install salt-master salt-minion

4.在minion01和minion02安装salt

[root@minon01 ~]# yum -y install salt-minion[root@minon02 ~]# yum -y install salt-minion

5.在master节点~]# cat /etc/salt/master | grep -w interface | grep -v "#"interface: 192.168.56.210

6.在minion节点​

[root@minion01 ~]# cat /etc/salt/minion | grep "master:" | grep -v "#"master: 192.168.56.210 [root@minion01 ~]# cat /etc/salt/minion | grep "id:" | grep -v "#"id: minion01[root@minion02 ~]# cat /etc/salt/minion | grep "master:" | grep -v "#"master: 192.168.56.210 [root@minion02 ~]# cat /etc/salt/minion | grep "id:" | grep -v "#"id: minion02

7.启动master节点

[root@master ~]# systemctl restart salt-master[root@master ~]# systemctl enable salt-masterCreated symlink from /etc/systemd/system/multi-user.target.wants/salt-master.service to /usr/lib/systemd/system/salt-master.service.

8.启动minion节点

[root@minion01 ~]# systemctl restart salt-minion[root@minion01 ~]# systemctl enable salt-minionCreated symlink from /etc/systemd/system/multi-user.target.wants/salt-minion.service to /usr/lib/systemd/system/salt-minion.service.[root@minion02 ~]# systemctl restart salt-minion[root@minion02 ~]# systemctl enable salt-minionCreated symlink from /etc/systemd/system/multi-user.target.wants/salt-minion.service to /usr/lib/systemd/system/salt-minion.service.

7.查看master节点认证列表

[root@master ~]# salt-key -LAccepted Keys:Denied Keys:Unaccepted Keys:masterminion01minion02Rejected Keys:

8.对Minion节点认证

[root@master ~]# salt-key -a minion01The following keys are going to be accepted:Unaccepted Keys:minion01Proceed? [n/Y] yKey for minion minion01 accepted.[root@master ~]# salt-key -a minion02The following keys are going to be accepted:Unaccepted Keys:minion02Proceed? [n/Y] yKey for minion minion02 accepted.

9.查看是否认证成功

[root@master ~]# salt '*' test.pingminion02: Trueminion01: True[root@master ~]# salt minion01 test.pingminion01: True[root@master ~]# salt minion02 test.pingminion02: True

LINUX

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Centos 7.6下安装Grafana 6.6.2
下一篇:ChatApp一个使用Django构建的小型点对点消息中心应用程序
相关文章

 发表评论

暂时没有评论,来抢沙发吧~