3242423 发表于 2016-11-9 08:52:33

Saltstack 安装

Saltstack 安装应用    master 192.168.20.156    minion 192.168.20.168一、系统准备# uname -r2.6.32-504.el6.x86_64# salt --versionsalt 2016.3.3 (Boron)
1、设置关闭 selinux# cat /etc/sysconfig/selinux |grep -v ^#    SELINUX=disabled    SELINUXTYPE=targeted
2、设置iptables# iptables -A INPUT -p tcp --dport 4505 -j ACCEPT# iptables -A INPUT -p tcp --dport 4506 -j ACCEPT# /etc/init.d/iptables save
3、安装 gcc c++# yum install gcc gcc-c++ -y
4、配置yum 源# cat /etc/yum.repos.d/saltstack.repo        name=saltstack    baseurl=https://repo.saltstack.com/yum/rhel6/    enabled=1    gpgcheck=0
# rhel7 可以以此更改URL 安装源;或者wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo或者rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm本人使用这个
5、安装配置master:# yum install salt-master salt-minion salt-ssh salt-syndic salt-cloud -y
6、配置master# mkdir /srv/{salt,pillar}# cat /etc/salt/master    interface: 192.168.20.156    # 绑定master通信IP    publish_port: 4505    master_id: master    auto_accept: True     # 打开key的自动验证    pidfile: /var/run/salt-master.pid    pki_dir: /etc/salt/pki    file_roots:      base:      - /srv/salt    # 指定saltstack文件根目录位置
    pillar_roots:      base:      - /srv/pillar    # 指定pillar的配置目录#当/etc/salt/master没有配置auto_accept: True时,需要通过salt-key命令来进行证书认证操作salt-key -L 显示已认证或未认证的被控端idsalt-key -D 删除所有认证主机id证书salt-key -d id 删除单个id证书salt-key -A 接受所有id证书salt-key -a id 接受单个id证书salt-key -j id 拒绝单个id证书salt-key –J 拒绝所有id证书#7、启动# service salt-master start# chkconfig salt-master on
8、minion 端:# yum install salt-minion -y    配置 minion# cat /etc/salt/minion    master: 192.168.20.168    id: client
9、启动# service salt-minion start# chkconfig salt-minion on
10、向客户端发送命令检测;# salt-key -L     # 查看minion 列表# salt 'client' test.ping
二、提示问题:# salt '*' test.ping    Salt request timed out. If this error persists, worker_threads may need to be increased.Failed to authenticate!This is most likely because this user is not permitted to execute commands, but there is a small possibility that a disk error occurred (check disk/inode usage).Salt因为握手不成功报错[要求增加线程]解决办法?一般都是配置问题解决方法:检测配置文件 /etc/salt/master里面的worker_threads 参数检测 IPtables和4506 4505 端口;
页: [1]
查看完整版本: Saltstack 安装