saltstack安装

注意:配置文件配置项与值之间加空格

master安装

[root@localhost ~]# date
Fri May  5 23:32:37 HKT 2017
[root@localhost ~]# date -s "2017-11-6 14:48:00"
Mon Nov  6 14:48:00 HKT 2017
[root@localhost ~]# rpm --import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub
[root@localhost ~]# yum clean all
[root@localhost ~]# vim /etc/yum.repos.d/
back/              CentOS-Media.repo  epel.repo          epel-testing.repo  saltstack.repo     
[root@localhost ~]# vim /etc/yum.repos.d/saltstack.repo 
[saltstack-repo]
name=SaltStack repo for RHEL/CentOS $releasever
baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub                                                     
[root@localhost ~]# yum update
[root@localhost ~]# yum install salt-master -y
[root@localhost ~]# sed -i 's/#interface: 0.0.0.0/interface: 192.168.200.113/g' /etc/salt/master
[root@localhost ~]# sed -e '/^$/d;/^#/d;' /etc/salt/master
[root@localhost ~]# systemctl start salt-master.service 

minion安装

[root@localhost ~]# date -s "2017-11-6 14:29:00"
[root@localhost ~]# rpm --import https://repo.saltstack.com/yum/redhat/6/x86_64/latest/SALTSTACK-GPG-KEY.pub
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim saltstack.repo
[saltstack-repo]
name=SaltStack repo for RHEL/CentOS $releasever
baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub                                                                 
[root@localhost yum.repos.d]# yum clean expire-cache
[root@localhost yum.repos.d]# yum update
[root@localhost yum.repos.d]# yum install salt-minion -y
[root@localhost yum.repos.d]# sed -i 's/#master: salt/master: 192.168.200.113/g' /etc/salt/minion
[root@localhost yum.repos.d]# sed -e '/^$/d;/^#/d;' /etc/salt/minion
master: 192.168.200.113
[root@localhost yum.repos.d]# systemctl start salt-minion.service 
[root@localhost yum.repos.d]# systemctl status salt-minion.service 
● salt-minion.service - The Salt Minion
   Loaded: loaded (/usr/lib/systemd/system/salt-minion.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2017-11-06 18:14:07 HKT; 2s ago
     Docs: man:salt-minion(1)
           file:///usr/share/doc/salt/html/contents.html
           https://docs.saltstack.com/en/latest/contents.html
 Main PID: 18112 (salt-minion)
   CGroup: /system.slice/salt-minion.service
           ├─18112 /usr/bin/python /usr/bin/salt-minion
           ├─18116 /usr/bin/python /usr/bin/salt-minion
           └─18120 /usr/bin/python /usr/bin/salt-minion

Nov 06 18:14:07 localhost.localdomain systemd[1]: Starting The Salt Minion...
Nov 06 18:14:07 localhost.localdomain systemd[1]: Started The Salt Minion.
Nov 06 18:14:08 localhost.localdomain salt-minion[18112]: [ERROR   ] The Salt Master has cached the public key for this node, th...icate
Hint: Some lines were ellipsized, use -l to show in full.

master授权并测试

[root@localhost ~]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
192.168.201.34
Rejected Keys:
[root@localhost ~]# salt-key -a 192.168.201.34
The following keys are going to be accepted:
Unaccepted Keys:
192.168.201.34
Proceed? [n/Y] y
Key for minion 192.168.201.34 accepted.
[root@localhost ~]# salt-key -L
Accepted Keys:
192.168.201.34
Denied Keys:
Unaccepted Keys:
Rejected Keys:
[root@localhost ~]# salt saltstack-minion test.ping
No minions matched the target. No command was sent, no jid was assigned.
ERROR: No return received
[root@localhost ~]# salt 192.168.201.34 test.ping  
192.168.201.34:
    True

其它

1

sed [-nefr] [动作]
-e :直接在命令列模式上进行 sed 的动作编辑;
-i :直接修改读取的文件内容,而不是输出到终端。

2

sed -e '/^$/d;/^#/d;' /etc/salt/minion

删除空行与删除以#打头行

3

Yum 报错 curl#60 – “Peer’s Certificate has expired.”
curl#60 – “Peer’s Certificate has expired.”
可能是由于服务器时间不正确导致https证书认证错误,更新服务器时间即可

4

vim中
Ctrl+u和Ctrl+d是上下翻半页。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值