centos 安装 saltstack

  • 内容
  • 评论
  • 相关

1.系统centos 6.5 64位

2.master:192.168.2.189

   minion:192.168.2.188

3.安装准备

两个机器同时做操作:

3.1 安装epel源

# cd /usr/local/src/

# wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -ivh epel-release-6-8.noarch.rpm

 

3.2 安装rpmforge

# wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

# rpm -Uvh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

 

3.3 安装python 依赖

yum install python-jinja2

 

4.安装saltstack

192.168.2.189上安装salt-master

yum -y install salt-master enablerepr=epel-testing

image

 

192.168.2.188上安装salt-minion

yum -y install salt-minion enablerepr=epel-testing

image

 

saltstack配置

master上,编辑/etc/salt/master

interface: 0.0.0.0                  # interface (服务端监听IP),0.0.0.0 是监听所有IP
log_file: /var/log/salt/master      # 记录主控端运行日志
key_logfile: /var/log/salt/key      # 记录认证证书日志

 

minion上,编辑/etc/salt/minion

master: 192.168.2.189          # 设置主控端IP
id: web-server-188             # 设定受控端编号
log_file: /var/log/salt/minion  # 记录受控端服务日志
key_logfile: /var/log/salt/key  # 记录认证证书日志
 
编辑保存后,分别启动 salt-master  salt-minion
 
5.通信证书管理
master上运行
# salt-key
image 
# salt-key –a web-server-188
image 
6.测试

salt '*' test.ping

 

image