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
    评论
SaltStack是一套基于Python开发的配置管理工具,它采用C/S架构,包括一个服务器端(Master)和多个客户端(Minion)。安装和部署SaltStack的过程如下: 1. 首先启动SaltStack服务,通过以下命令启动Master和Minion服务: systemctl start salt-master systemctl start salt-minion 2. 安装SaltStack,可以通过以下步骤进行: - 在Master和Minion上安装SaltStack软件包。 - 配置Master和Minion的配置文件,其中包括指定Master地址和端口等信息。 - 启动Master和Minion服务。 3. SaltStack的工作机制如下: - Master监听配置文件中定义的端口,用于接收Minion的请求。 - Minion在运行时会自动连接到配置文件中定义的Master地址和端口,并进行连接认证。 - 当Master和Minion成功建立通信后,就可以进行配置管理和远程执行等操作。 4. SaltStack的主要功能包括: - 配置管理:可以通过SaltStack对多台机器进行配置管理,实现统一的配置管理和更新。 - 远程执行:可以通过SaltStack在多台机器上进行并行执行命令和任务。 - 云管理:可以通过SaltStack进行云平台的管理和扩展。 总结起来,安装和部署SaltStack需要先启动Master和Minion服务,然后安装和配置SaltStack软件,最后通过配置文件进行连接认证。安装完成后,可以利用SaltStack进行配置管理、远程执行和云管理等操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [saltstack安装部署](https://blog.csdn.net/qq_54947566/article/details/114492742)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [SaltStack安装及简单部署](https://blog.csdn.net/weixin_42446031/article/details/92769652)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值