首頁 > 軟體

RHEL5上安裝salt-minion

2020-06-16 18:00:53

本文適用於rhel5.4, 6.4, 7. 僅以el5.4為例。

1 線上安裝方式極為簡單:

# wget --no-check-certificate -O install_salt.sh https://bootstrap.saltstack.com
# sh install_salt.sh -I

以上適用於el5, el6, el7等版本。可以在/etc/yum.repos.d/下面發現一堆repo,儲存好下面幾個:

epel.repo
epel-testing.repo
saltstack-salt-el5-epel-5.repo

2 下面主要說明離線安裝方式:
這裡主要是伺服器無法上外網,所以要採用rpm包安裝。離線安裝rpm包。

首先是安裝downloadonly外掛:

# yum install yum-downloadonly
然後將1中的repo檔案複製到/etc/yum.repos.d/下面:

epel.repo
epel-testing.repo
saltstack-salt-el5-epel-5.repo

下載安裝包:

# yum install -y --downloadonly --downloaddir=/root/salt salt-minion
就在/root/salt下面獲得了全部的離線安裝包。將這些安裝包複製到其他rhel5.4的機器,即可使用rpm安裝。

# rpm -ivh *.rpm 
# service salt-minion status|restart|stop 

附錄1:epel.repo

[root@el5-test salt]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
mirrorlist=http://mirrors.Fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 5 - $basearch - Debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

[epel-source]
name=Extra Packages for Enterprise Linux 5 - $basearch - Source
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

附錄2:epel-testing.repo

[root@el5-test salt]# cat /etc/yum.repos.d/epel-testing.repo
[epel-testing]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch
failovermethod=priority
enabled=0
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/5/$basearch/debug
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-debug-epel5&arch=$basearch
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

[epel-testing-source]
name=Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/5/SRPMS
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-source-epel5&arch=$basearch
failovermethod=priority
enabled=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
gpgcheck=0

附錄3:saltstack-salt-el5-epel-5.repo

[root@el5-test salt]# cat /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo
[saltstack-salt-el5]
name=Copr repo for salt-el5 owned by saltstack
baseurl=https://copr-be.cloud.fedoraproject.org/results/saltstack/salt-el5/epel-5-$basearch/
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/saltstack/salt-el5/pubkey.gpg
enabled=1


IT145.com E-mail:sddin#qq.com