安装教程

This section contains instructions to install Salt. If you are setting up your environment for the first time, you should install a Salt master on a dedicated management server or VM, and then install a Salt minion on each system that you want to manage using Salt. For now you don't need to worry about your architecture, you can easily add components and modify your configuration later without needing to reinstall anything.

The general installation process is as follows:

  1. Install a Salt master using the instructions for your platform or by running the Salt bootstrap script. If you use the bootstrap script, be sure to include the -M option to install the Salt master.
  2. Make sure that your Salt minions can find the Salt master.
  3. Install the Salt minion on each system that you want to manage.
  4. Accept the Salt minion keys after the Salt minion connects.

After this, you should be able to run a simple command and receive returns from all connected Salt minions.

salt '*' test.ping

快速安装

On most distributions, you can set up a Salt Minion with the Salt bootstrap.

对应平台的安装教程

这些指引将带你了解在给定的平台中如何安装Salt.

Initial Configuration

依赖

Salt可以运行在类Unix平台,安装时需要解决如下依赖:

  • Python 2.6 >= 2.6 <3.0
  • msgpack-python - 高性能的消息交换格式

  • YAML - Python YAML bindings
  • Jinja2 - 解析Salt States (在master配置文件中配置)

  • MarkupSafe - Implements a XML/HTML/XHTML Markup safe string for Python
  • apache-libcloud - 与大量的主流云服务提供者进行交互时统一API的Python类

  • Requests - HTTP library
  • Tornado - Web framework and asynchronous networking library
  • futures - Backport of the concurrent.futures package from Python 3.2

Depending on the chosen Salt transport, ZeroMQ or RAET, dependencies vary:

  • ZeroMQ:
  • RAET:
    • libnacl - Python bindings to libsodium
    • ioflo - The flo programming interface raet and salt-raet is built on
    • RAET - The worlds most awesome UDP protocol

Salt defaults to the ZeroMQ transport, and the choice can be made at install time, for example:

python setup.py --salt-transport=raet install

This way, only the required dependencies are pulled by the setup script if need be.

If installing using pip, the --salt-transport install option can be provided like:

pip install --install-option="--salt-transport=raet" salt

注解

Salt does not bundle dependencies that are typically distributed as part of the base OS. If you have unmet dependencies and are using a custom or minimal installation, you might need to install some additional packages from your OS vendor.

可选依赖

  • mako - 一个可选的Salt States解析器(在master配置文件中配置)

  • gcc - 动态 Cython 模块编译器

升级Salt

当升级Salt的时候,master(s)应该首先升级。masters向后兼容,minions运行版本比masters版本新是不能保证运行正常的。

只要可能,新masters向后兼容旧minions的特性就会被保留下来。一般来说,唯一例外的情况是有安全漏洞的情况下。

参见

Installing Salt for development 并且给项目做贡献。