SaltStack - 安装minion

准备环境

虚拟机初始化配置

注意:修改主机名为“salt-minion

开始安装

配置SaltStack yum源:

[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

加载yum源:

[root@localhost ~]# yum makecache

安装salt-minion:

[root@localhost ~]# yum install -y salt-minion

配置minion开机自动启动:

[root@localhost ~]# systemctl enable salt-minion

启动Minion:

[root@localhost ~]# systemctl start salt-minion

配置salt-minion

master: salt-master

注意:salt-master为master的主机名,需要配置本机/etc/hosts

重启salt-minion:

[root@localhost ~]# systemctl restart salt-minion

检查配置

在Salt Master上,授权该Salt Minion访问:

[root@salt-master ~]# salt-key
找到对应的主机名或IP
[root@salt-master ~]# salt-key -a -y 主机名或IP
[root@salt-master ~]# salt '主机名或IP' test.ping

如果返回值为True,则配置完成。

猜你喜欢

转载自blog.csdn.net/zjfjifei2008/article/details/78700520