SaltStack基于Python语言实现,结合轻量级消息队列(ZeroMQ)
与Python第三方模块(Pyzmq、PyCrypto、Pyjinjia2、python-msgpack和PyYAML等)构建。
client:
yum -y install salt-minion --enablerepo=epel-testing
/etc/salt/pki/minion/
minion.pem 和 minion.pub -->to master
master:
yum -y install salt
/etc/salt/pki/master/minions
salt-key -L 查看
SaltStack master启动后默认监听4505和4506两个端口。
4505(publish_port)MQ
4506(ret_port)master-client
lsof -i :4505
salt '*' test.ping
salt '*' cmd.run 'uptime'
salt '*' cp.get_file salt://hellotest/rocketzhang /root/rocketzhang
salt '*' cp.get_url http://xxx.xyz.com/download/0/files.tgz /root/files.tgz
salt '*' cmd.run 'netstat -ntlp'
salt '*' cron.set_job root '*/5' '*' '*' '*' '*' 'date >/dev/null 2>&1'
salt '*' cron.raw_cron root
salt '*' service.stop crond