Salt Master服务器配置:
CentOS 7.9.2009
IP: 192.168.0.2
0.架构
标准安装需要四个组件,可以合在一起,如果要高可用的话建议每个组件分不同节点安装
- A Salt master
- A PostgreSQL database node
- A Redis database node
- A RaaS node, also known as SaltStack Config
1 安装准备工作
1.1 预先配置
sudo yum install openssl epel-release -y sudo yum install python36-cryptography python36-pyOpenSSL -y
如果是离线环境,则需预先安装好Python的pycryptodomex包
本文采用的是pycryptodomex-3.13.0-cp35-abi3-manylinux2010_x86_64.whl
下载地址:https://files.pythonhosted.org/packages/37/26/46c3b56846e1ab86f414a048d16a10343a93e081ee6215924f11e838865b/pycryptodomex-3.13.0-cp35-abi3-manylinux2010_x86_64.whl
python3 -m pip install --upgrade pycryptodomex-3.13.0-cp35-abi3-manylinux2010_x86_64.whl
1.2 安装Salt Master
Salt Master为SaltStack中的服务器
sudo yum install https://repo.saltstack.com/py3/redhat/salt-py3-repo-latest.el7.noarch.rpm sudo yum clean expire-cache sudo yum install -y salt-master salt-minion sudo cat << EOF > /etc/salt/minion.d/master.conf master: localhost EOF sudo systemctl enable salt-master --now sudo systemctl enable salt-minion --now
1.3 安装Salt Minion
在其他服务器上Salt Minion,即客户端
此处使用了配置文件指定Master服务器,也可使用DNS或hosts加入salt地址记录直接指向
sudo yum install salt-minion -y sudo cat << EOF > /etc/salt/minion.d/master.conf master: 192.168.0.2 EOF sudo systemctl enable salt-minion --now
1.4 在Master端接受Minion
Minion启动后会发起向Master的连接,Master端需要接受后才能正常通信
salt-key -L salt-key -a <minion名称> 回答y来接受 salt-key -L <- 新的minion会列在Acceptedkeys里
1.5 准备安装文件
安装程序从这个下载(SaltStack已被VMware收购)
https://customerconnect.vmware.com/downloads/details?downloadGroup=VRA-SSC-862&productId=1206&rPId=80829
tar -xvzf SaltStack_Config-8.6.2.11-1_Installer.zip sudo rpmkeys --import sse-installer/keys/*.asc
1.6 配置防火墙
firewall-cmd --add-service=https --permanent firewall-cmd --permanent --zone=public --add-port=4505-4506/tcp firewall-cmd --reload
2 安装SaltStack Config (即StackStack Enterprise)
2.1 单节点安装
在salt master上,将解压的sse-install目录下的问题复制到对应目录
sudo ./setup_single_node.sh
安装过程会出现如下日志,约5分钟完成
The Salt Master package is already installed… skipping.
The Salt Minion package is already installed… skipping.
The Salt Master and Salt Minion packages were already installed.
Installing SaltStack Enterprise…
……
Total states run: 40
Total run time: 362.406 s
SaltStack Enterprise installation script completed.
2.2 安装license
把license文件复制到/etc/raas/目录下,并修改权限,重启服务
chown raas:raas raas.license mv raas.license /etc/raas systemctl restart raas
2.3 重启Salt Master
systemctl restart salt-master
2.4 访问Salt Master
https://<salt master对应的FQDN或IP>
默认用户名:root,密码:salt