码迷,mamicode.com
首页 > 其他好文 > 详细

SaltStack 安装

时间:2017-12-02 11:27:41      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:sts   table   执行   安全   tab   安全性   release   nbsp   pre   

服务端(192.168.5.131)配置:

[root@localhost ~]# hostname Server
[root@localhost ~]# bash
[root@Server ~]# iptables -F
[root@Server ~]# setenforce 0
[root@Server ~]# vim /etc/hosts
192.168.5.131 Server
192.168.5.134 Client
[root@Server ~]# yum install -y epel-release
[root@Server ~]# yum install -y salt-master salt-minion              # 安装客户端和服务端
[root@Server ~]# echo "master: 192.168.5.131" >> /etc/salt/minion    # 指定服务端
[root@Server ~]# /etc/init.d/salt-master start                       # 启动服务端
[root@Server ~]# /etc/init.d/salt-minion start                       # 启动客户端

客户端(192.168.5.134)配置:

[root@localhost ~]# hostname Client
[root@localhost ~]# bash
[root@Client ~]# iptables -F
[root@Client ~]# setenforce 0
[root@Client ~]# vim /etc/hosts
192.168.5.131 Server
192.168.5.134 Client
[root@Client ~]# yum install -y epel-release
[root@Client ~]# yum install -y salt-minion                          # 安装客户端
[root@Client ~]# echo "master: 192.168.5.131" >> /etc/salt/minion    # 指定服务端
[root@Client ~]# /etc/init.d/salt-minion start                       # 启动客户端

服务端管理客户端需要配置认证来保证安全性,在服务端配置如下:

[root@Server ~]# salt-key -y -a Client            # 添加客户端主机名
[root@Server ~]# salt-key -y -a Server            # 添加服务端主机名
[root@Server ~]# salt Client cmd.run ‘df -h‘    # 根据主机名测试远程执行命令,如果有多台客户端可以写成 salt ‘*‘ cmd.run ‘df -h‘

 

 

 

 

 

 

      

SaltStack 安装

标签:sts   table   执行   安全   tab   安全性   release   nbsp   pre   

原文地址:http://www.cnblogs.com/pzk7788/p/7952928.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!