rhel.rst 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. .. _installation-rhel:
  2. ==============================================================
  3. RHEL / CentOS / Scientific Linux / Amazon Linux / Oracle Linux
  4. ==============================================================
  5. .. _installation-rhel-repo:
  6. Salt should work properly with all mainstream derivatives of Red Hat Enterprise
  7. Linux, including CentOS, Scientific Linux, Oracle Linux, and Amazon Linux.
  8. Report any bugs or issues on the `issue tracker
  9. <https://github.com/saltstack/salt/issues>`__.
  10. Installation from the Official SaltStack Repository
  11. ===================================================
  12. Packages for Redhat, CentOS, and Amazon Linux are available in
  13. the SaltStack Repository.
  14. - `Red Hat / CentOS <https://repo.saltstack.com/#rhel>`_
  15. - `Amazon Linux <https://repo.saltstack.com/#amzn>`_
  16. .. note::
  17. Archived builds from unsupported branches:
  18. **Red Hat / CentOS**
  19. - `Archive 1 <https://archive.repo.saltstack.com/py3/redhat/>`__
  20. - `Archive 2 <https://archive.repo.saltstack.com/yum/redhat/>`__
  21. If looking to use archives, the same directions from the `RHEL/CentOS
  22. install directions <https://repo.saltstack.com/#rhel>`__ can be used by
  23. replacing the URL paths with the appropriate archive location. The
  24. repository configuration endpoint also needs to be adjusted to point to the
  25. archives. Here is an example ``sed`` command:
  26. .. code-block:: bash
  27. # Salt repo configurations are found in the /etc/yum.repos.d/ directory
  28. sed -i 's/repo.saltstack.com/archive.repo.saltstack.com/g' /etc/yum.repos.d/salt*.repo
  29. **Amazon Linux**
  30. - `Archive 1 <https://archive.repo.saltstack.com/py3/amazon/>`__
  31. - `Archive 2 <https://archive.repo.saltstack.com/yum/amazon/>`__
  32. If looking to use archives, the same directions from the `Amazon
  33. install directions <https://repo.saltstack.com/#amzn>`__ can be used by
  34. replacing the URL paths with the appropriate archive location. The
  35. repository configuration endpoint also needs to be adjusted to point to the
  36. archives. Here is an example ``sed`` command:
  37. .. code-block:: bash
  38. # Salt repo configurations are found in the /etc/yum.repos.d/ directory
  39. sed -i 's/repo.saltstack.com/archive.repo.saltstack.com/g' /etc/yum.repos.d/salt*.repo
  40. .. note::
  41. As of 2015.8.0, EPEL repository is no longer required for installing on
  42. RHEL systems. SaltStack repository provides all needed dependencies.
  43. .. warning::
  44. If installing on Red Hat Enterprise Linux 7 with disabled (not subscribed on)
  45. 'RHEL Server Releases' or 'RHEL Server Optional Channel' repositories,
  46. append CentOS 7 GPG key URL to SaltStack yum repository configuration to
  47. install required base packages:
  48. .. code-block:: cfg
  49. [saltstack-repo]
  50. name=SaltStack repo for Red Hat Enterprise Linux $releasever
  51. baseurl=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest
  52. enabled=1
  53. gpgcheck=1
  54. gpgkey=https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/SALTSTACK-GPG-KEY.pub
  55. https://repo.saltstack.com/yum/redhat/$releasever/$basearch/latest/base/RPM-GPG-KEY-CentOS-7
  56. .. note::
  57. ``systemd`` and ``systemd-python`` are required by Salt, but are not
  58. installed by the Red Hat 7 ``@base`` installation or by the Salt
  59. installation. These dependencies might need to be installed before Salt.
  60. Installation from the Community-Maintained Repository
  61. =====================================================
  62. Beginning with version 0.9.4, Salt has been available in `EPEL`_.
  63. .. note::
  64. Packages in this repository are built by community, and it can take a little
  65. while until the latest stable SaltStack release becomes available. Using the
  66. SaltStack Repository is highly preferred, instead.
  67. .. _`EPEL`: https://fedoraproject.org/wiki/EPEL
  68. RHEL/CentOS 6 and 7, Scientific Linux, etc.
  69. -------------------------------------------
  70. .. warning::
  71. Salt 2015.8 is currently not available in EPEL due to unsatisfied
  72. dependencies: ``python-crypto`` 2.6.1 or higher, and ``python-tornado``
  73. version 4.2.1 or higher. These packages are not currently available in EPEL
  74. for Red Hat Enterprise Linux 6 and 7.
  75. Enabling EPEL
  76. *************
  77. If the EPEL repository is not installed on your system, you can download the
  78. RPM for `RHEL/CentOS 6`_ or for `RHEL/CentOS 7`_ and install it
  79. using the following command:
  80. .. code-block:: bash
  81. rpm -Uvh epel-release-X-Y.rpm
  82. Replace ``epel-release-X-Y.rpm`` with the appropriate filename.
  83. .. _RHEL/CentOS 6: http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html
  84. .. _RHEL/CentOS 7: http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html
  85. Installing Stable Release
  86. *************************
  87. Salt is packaged separately for the minion and the master. It is necessary
  88. to install only the appropriate package for the role the machine will play.
  89. Typically, there will be one master and multiple minions.
  90. - ``yum install salt-master``
  91. - ``yum install salt-minion``
  92. - ``yum install salt-ssh``
  93. - ``yum install salt-syndic``
  94. - ``yum install salt-cloud``
  95. Installing from ``epel-testing``
  96. ********************************
  97. When a new Salt release is packaged, it is first admitted into the
  98. ``epel-testing`` repository, before being moved to the stable EPEL repository.
  99. To install from ``epel-testing``, use the ``enablerepo`` argument for ``yum``:
  100. .. code-block:: bash
  101. yum --enablerepo=epel-testing install salt-minion
  102. Installation Using pip
  103. ======================
  104. Since Salt is on `PyPI`_, it can be installed using pip, though most users
  105. prefer to install using RPM packages (which can be installed from `EPEL`_).
  106. Installing from pip has a few additional requirements:
  107. * Install the group 'Development Tools', ``yum groupinstall 'Development Tools'``
  108. * Install the 'zeromq-devel' package if it fails on linking against that
  109. afterwards as well.
  110. A pip install does not make the init scripts or the /etc/salt directory, and you
  111. will need to provide your own systemd service unit.
  112. Installation from pip:
  113. .. _`PyPI`: https://pypi.org/project/salt/
  114. .. code-block:: bash
  115. pip install salt
  116. .. warning::
  117. If installing from pip (or from source using ``setup.py install``), be
  118. advised that the ``yum-utils`` package is needed for Salt to manage
  119. packages. Also, if the Python dependencies are not already installed, then
  120. you will need additional libraries/tools installed to build some of them.
  121. More information on this can be found :ref:`here
  122. <installing-for-development>`.
  123. ZeroMQ 4
  124. ========
  125. We recommend using ZeroMQ 4 where available. SaltStack provides ZeroMQ 4.0.5
  126. and ``pyzmq`` 14.5.0 in the :ref:`SaltStack Repository
  127. <installation-rhel-repo>`.
  128. If this repository is added *before* Salt is installed, then installing either
  129. ``salt-master`` or ``salt-minion`` will automatically pull in ZeroMQ 4.0.5, and
  130. additional steps to upgrade ZeroMQ and pyzmq are unnecessary.
  131. Package Management
  132. ==================
  133. Salt's interface to :mod:`yum <salt.modules.yumpkg>` makes heavy use of the
  134. **repoquery** utility, from the yum-utils_ package. This package will be
  135. installed as a dependency if salt is installed via EPEL. However, if salt has
  136. been installed using pip, or a host is being managed using salt-ssh, then as of
  137. version 2014.7.0 yum-utils_ will be installed automatically to satisfy this
  138. dependency.
  139. .. _yum-utils: http://yum.baseurl.org/wiki/YumUtils
  140. Post-installation tasks
  141. =======================
  142. Master
  143. ------
  144. To have the Master start automatically at boot time:
  145. **RHEL/CentOS 5 and 6**
  146. .. code-block:: bash
  147. chkconfig salt-master on
  148. **RHEL/CentOS 7**
  149. .. code-block:: bash
  150. systemctl enable salt-master.service
  151. To start the Master:
  152. **RHEL/CentOS 5 and 6**
  153. .. code-block:: bash
  154. service salt-master start
  155. **RHEL/CentOS 7**
  156. .. code-block:: bash
  157. systemctl start salt-master.service
  158. Minion
  159. ------
  160. To have the Minion start automatically at boot time:
  161. **RHEL/CentOS 5 and 6**
  162. .. code-block:: bash
  163. chkconfig salt-minion on
  164. **RHEL/CentOS 7**
  165. .. code-block:: bash
  166. systemctl enable salt-minion.service
  167. To start the Minion:
  168. **RHEL/CentOS 5 and 6**
  169. .. code-block:: bash
  170. service salt-minion start
  171. **RHEL/CentOS 7**
  172. .. code-block:: bash
  173. systemctl start salt-minion.service
  174. Now go to the :ref:`Configuring Salt<configuring-salt>` page.