salt-ssh 설치 실패 해결

yum 설치 salt-ssh 오류:
[root@linux-node1 yum.repos.d]# yum install salt-ssh -y
     :fastestmirror
base                                                                                                            | 3.6 kB  00:00:00
epel                                                                                                            | 4.7 kB  00:00:00
extras                                                                                                          | 3.4 kB  00:00:00
updates                                                                                                         | 3.4 kB  00:00:00
Loading mirror speeds from cached hostfile
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-ssh-2015.5.10-2.el7.noarch   
-->         
  :   :salt-ssh-2015.5.10-2.el7.noarch (epel)
            :salt = 2015.5.10-2.el7
             : salt-2017.7.1-1.el7.noarch (@salt-latest)
              salt = 2017.7.1-1.el7
            : salt-2015.5.10-2.el7.noarch (epel)
              salt = 2015.5.10-2.el7
         --skip-broken         
        :rpm -Va --nofiles --nodigest

오류 프롬프트에 매개변수 "--skip-broken"을 추가하면 실행 결과가 실패합니다.
[root@linux-node1 yum.repos.d]# yum install salt-ssh -y --skip-broken
     :fastestmirror
Loading mirror speeds from cached hostfile
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-ssh-2015.5.10-2.el7.noarch   
 
               :
    salt-ssh-2015.5.10-2.el7.noarch    epel

오류 알림에 따라 명령을 실행하고yum 설치를 실행하는 데 실패했습니다.
[root@linux-node1 yum.repos.d]# rpm -Va --nofiles --nodigest
[root@linux-node1 yum.repos.d]# yum install salt-ssh -y
     :fastestmirror
Loading mirror speeds from cached hostfile
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-ssh-2015.5.10-2.el7.noarch   
-->         
  :   :salt-ssh-2015.5.10-2.el7.noarch (epel)
            :salt = 2015.5.10-2.el7
             : salt-2017.7.1-1.el7.noarch (@salt-latest)
              salt = 2017.7.1-1.el7
            : salt-2015.5.10-2.el7.noarch (epel)
              salt = 2015.5.10-2.el7
         --skip-broken         
        :rpm -Va --nofiles --nodigest

네티즌의 도움말에 따라salt-ssh 명령을 직접 다운로드합니다.
[root@linux-node1 yum.repos.d]# wget ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/Packages/s/salt-ssh-2015.5.10-2.el7.noarch.rpm
--2018-04-10 13:44:35--  ftp://mirror.switch.ch/pool/4/mirror/epel/7/ppc64/Packages/s/salt-ssh-2015.5.10-2.el7.noarch.rpm
           => “salt-ssh-2015.5.10-2.el7.noarch.rpm”
       mirror.switch.ch (mirror.switch.ch)... 130.59.113.36, 2001:620:0:1002::20
     mirror.switch.ch (mirror.switch.ch)|130.59.113.36|:21...    。
    anonymous    ...     !
==> SYST ...   。   ==> PWD ...   。
==> TYPE I ...   。 ==> CWD (1) /pool/4/mirror/epel/7/ppc64/Packages/s ...   。
==> SIZE salt-ssh-2015.5.10-2.el7.noarch.rpm ... 15108
==> PASV ...   。   ==> RETR salt-ssh-2015.5.10-2.el7.noarch.rpm ...   。
  :15108 (15K) (     )
 
100%[=============================================================================================>] 15,108      22.0KB/s    0.7s   
 
2018-04-10 13:44:40 (22.0 KB/s) - “salt-ssh-2015.5.10-2.el7.noarch.rpm”     [15108]

rpm 설치 실패:
[root@linux-node1 yum.repos.d]# rpm -ivh salt-ssh-2015.5.10-2.el7.noarch.rpm 
  :      :
        salt = 2015.5.10-2.el7   salt-ssh-2015.5.10-2.el7.noarch   

rpm 설치 실패: "--force"매개 변수 추가(패키지 및 파일 충돌 무시)
[root@linux-node1 yum.repos.d]# rpm -ivh salt-ssh-2015.5.10-2.el7.noarch.rpm --force
  :      :
        salt = 2015.5.10-2.el7   salt-ssh-2015.5.10-2.el7.noarch   

rpm 설치 성공: "--nodeps"매개 변수 추가(의존성 관계 검사하지 않음)
[root@linux-node1 yum.repos.d]# rpm -ivh salt-ssh-2015.5.10-2.el7.noarch.rpm --force --nodeps
   ...                          ################################# [100%]
    /  ...
   1:salt-ssh-2015.5.10-2.el7         ################################# [100%]

참조 문서:https://www.cnblogs.com/vathe/p/6736104.html- CentOS에서 rpm 명령 자세히 보기
salt-ssh 구성 파일 수정 결과:
[root@linux-node1 yum.repos.d]# cd ~
[root@linux-node1 ~]# cat /etc/salt/roster
# Sample salt-ssh config file
#web1:
#  host: 192.168.42.1 # The IP addr or DNS hostname
#  user: fred         # Remote executions will be executed as user fred
#  passwd: foobarbaz  # The password to use for login, if omitted, keys are used
#  sudo: True         # Whether to sudo to root, not enabled by default
#web2:
#  host: 192.168.42.2
linux-node1:
  host: 192.168.56.11
  user: root
  passwd: 123123
  port: 22
linux-node2:
  host: 192.168.56.12
  user: root
  passwd: 123123
  port: 22

salt-ssh 명령을 실행하지 못했습니다.
[root@linux-node1 ~]# salt-ssh '*' test.ping
[ERROR   ] MySQL returner could not connect to database: (1045, "Access denied for user 'root'@'linux-node1' (using password: YES)")
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/client/ssh/__init__.py", line 617, in run
    self.returners['{0}.save_load'.format(self.opts['master_job_cache'])](jid, job_load)
  File "/usr/lib/python2.7/site-packages/salt/returners/mysql.py", line 321, in save_load
    with _get_serv(commit=True) as cur:
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/lib/python2.7/site-packages/salt/returners/mysql.py", line 258, in _get_serv
    raise salt.exceptions.SaltMasterError('MySQL returner could not connect to database: {exc}'.format(exc=exc))
SaltMasterError: MySQL returner could not connect to database: (1045, "Access denied for user 'root'@'linux-node1' (using password: YES)")
[ERROR   ] Could not save load with returner mysql: MySQL returner could not connect to database: (1045, "Access denied for user 'root'@'linux-node1' (using password: YES)")
[CRITICAL] MySQL returner could not connect to database: (1045, "Access denied for user 'root'@'linux-node1' (using password: YES)")
[CRITICAL] Could not store return with MySQL returner. MySQL server unavailable.
linux-node1:
    ----------
    retcode:
        254
    stderr:
    stdout:
        The host key needs to be accepted, to auto accept run salt-ssh with the -i flag:
        The authenticity of host '192.168.56.11 (192.168.56.11)' can't be established.
        ECDSA key fingerprint is 2d:a2:8e:9e:5a:5c:fb:94:ac:80:ba:fa:7f:9e:3c:cd.
        Are you sure you want to continue connecting (yes/no)? 
[CRITICAL] MySQL returner could not connect to database: (1045, "Access denied for user 'root'@'linux-node1' (using password: YES)")
[CRITICAL] Could not store return with MySQL returner. MySQL server unavailable.
linux-node2:
    True

이 때 yum에 salt-ssh가 설치되어 있으며 이 명령이 설치되어 있음을 알립니다.
[root@linux-node1 ~]# yum -y install salt-ssh
     :fastestmirror
Loading mirror speeds from cached hostfile
    salt-ssh-2015.5.10-2.el7.noarch           
      

rpm에서 이전에 설치한salt-ssh 명령을 yum 방식으로 제거합니다.
[root@linux-node1 ~]# yum remove salt-ssh-2015.5.10-2.el7.noarch
     :fastestmirror
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt-ssh                      noarch                      2015.5.10-2.el7                        installed                      3.1 k
 
    
=======================================================================================================================================
    1    
 
    :3.1 k
    ?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  :RPM        yum     。
          : salt-ssh-2015.5.10-2.el7.noarch                                                                                    1/1 
           : salt-ssh-2015.5.10-2.el7.noarch                                                                                    1/1 
 
  :
  salt-ssh.noarch 0:2015.5.10-2.el7                                                                                                    
 
  !

salt-ssh 명령을 설치하는 동안 발생한 문제가 다시 발생했습니다.
[root@linux-node1 ~]# yum -y install salt-ssh
     :fastestmirror
Loading mirror speeds from cached hostfile
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-ssh-2015.5.10-2.el7.noarch   
-->         
  :   :salt-ssh-2015.5.10-2.el7.noarch (epel)
            :salt = 2015.5.10-2.el7
             : salt-2017.7.1-1.el7.noarch (@salt-latest)
              salt = 2017.7.1-1.el7
            : salt-2015.5.10-2.el7.noarch (epel)
              salt = 2015.5.10-2.el7
         --skip-broken         
        :rpm -Va --nofiles --nodigest

yum 방식으로 이전 명령 실행 출력에서 언급한 "설치됨"패키지를 삭제합니다.
[root@linux-node1 ~]# yum remove salt-2017.7.1-1.el7.noarch
     :fastestmirror
        
-->       
--->     salt.noarch.0.2017.7.1-1.el7      
-->          salt = 2017.7.1-1.el7,      salt-minion-2017.7.1-1.el7.noarch   
-->          salt = 2017.7.1-1.el7,      salt-master-2017.7.1-1.el7.noarch   
-->       
--->     salt-master.noarch.0.2017.7.1-1.el7      
--->     salt-minion.noarch.0.2017.7.1-1.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt                            noarch                     2017.7.1-1.el7                      @salt-latest                      36 M
      :
 salt-master                     noarch                     2017.7.1-1.el7                      @salt-latest                     1.6 M
 salt-minion                     noarch                     2017.7.1-1.el7                      @salt-latest                      69 k
 
    
=======================================================================================================================================
    1     (+2      )
 
    :38 M
    ?[y/N]:y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
          : salt-minion-2017.7.1-1.el7.noarch                                                                                  1/3 
  :/etc/salt/minion      /etc/salt/minion.rpmsave
          : salt-master-2017.7.1-1.el7.noarch                                                                                  2/3 
  :/etc/salt/master      /etc/salt/master.rpmsave
          : salt-2017.7.1-1.el7.noarch                                                                                         3/3 
  :/etc/salt/roster      /etc/salt/roster.rpmsave
           : salt-2017.7.1-1.el7.noarch                                                                                         1/3 
           : salt-master-2017.7.1-1.el7.noarch                                                                                  2/3 
           : salt-minion-2017.7.1-1.el7.noarch                                                                                  3/3 
 
  :
  salt.noarch 0:2017.7.1-1.el7                                                                                                         
 
       :
  salt-master.noarch 0:2017.7.1-1.el7                                salt-minion.noarch 0:2017.7.1-1.el7                               
 
  !

명령 출력을 통해 마스터와 미니언 패키지도 삭제된 것 같습니다.
yum이 salt-ssh를 설치했습니다.
[root@linux-node1 ~]# yum -y install salt-ssh
     :fastestmirror
Loading mirror speeds from cached hostfile
        
-->       
--->     salt-ssh.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-ssh-2015.5.10-2.el7.noarch   
-->       
--->     salt.noarch.0.2015.5.10-2.el7      
-->          m2crypto,      salt-2015.5.10-2.el7.noarch   
-->       
--->     m2crypto.x86_64.0.0.21.1-17.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt-ssh                       noarch                       2015.5.10-2.el7                          epel                        15 k
      :
 m2crypto                       x86_64                       0.21.1-17.el7                            base                       429 k
 salt                           noarch                       2015.5.10-2.el7                          epel                       4.1 M
 
    
=======================================================================================================================================
    1     (+2      )
 
    :4.5 M
    :20 M
Downloading packages:
(1/3): salt-ssh-2015.5.10-2.el7.noarch.rpm                                                                      |  15 kB  00:00:00
(2/3): m2crypto-0.21.1-17.el7.x86_64.rpm                                                                        | 429 kB  00:00:06
(3/3): salt-2015.5.10-2.el7.noarch.rpm                                                                          | 4.1 MB  00:00:09
---------------------------------------------------------------------------------------------------------------------------------------
                                                                                                     476 kB/s | 4.5 MB  00:00:09
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
          : m2crypto-0.21.1-17.el7.x86_64                                                                                      1/3 
          : salt-2015.5.10-2.el7.noarch                                                                                        2/3 
          : salt-ssh-2015.5.10-2.el7.noarch                                                                                    3/3 
           : salt-2015.5.10-2.el7.noarch                                                                                        1/3 
           : salt-ssh-2015.5.10-2.el7.noarch                                                                                    2/3 
           : m2crypto-0.21.1-17.el7.x86_64                                                                                      3/3 
 
   :
  salt-ssh.noarch 0:2015.5.10-2.el7
 
       :
  m2crypto.x86_64 0:0.21.1-17.el7                                     salt.noarch 0:2015.5.10-2.el7
 
  !

salt 명령을 직접 실행할 수 없습니다. 마스터와 미니언 패키지가 삭제되었을 것입니다.
[root@linux-node1 ~]# salt '*' test.ping
-bash: salt:      

/etc/salt/roster 파일을 다시 수정한 후 salt-ssh를 테스트합니다.
[root@linux-node1 ~]# salt-ssh '*' test.ping
linux-node2:
    True
linux-node1:
    True

앞서 설명한 saltstack 배치 절차에 따라 salt-master(yum install salt-master-y)와 salt-minion(yum install salt-minion-y)을 다시 설치하고/etc/salt/minion 프로필을 수정하여 각각 salt-master(systemctl start salt-master)와 salt-minion(systemctl start salt-minion)을 시작하면 salt-minion(시스템ctl start salt-minion)을 정상적으로 사용할 수 있다.
[root@linux-node1 ~]# salt '*' test.ping
linux-node1.example.com:
    True
linux-node2.example.com:
    True

salt-master와 salt-minion이 정상으로 회복되면 salt-ssh를 테스트해도 문제가 없습니다.
[root@linux-node1 ~]# salt-ssh '*' test.ping
linux-node1:
    True
linux-node2:
    True

뒤에서saltstack '설정 관리' 를 깊이 배울 때salt 명령을 실행합니다:'salt'*'state.highstate '. 심각한 오류가 발생했습니다.
[root@linux-node1 web]# salt '*' state.highstate
linux-node2.example.com:
    Data failed to compile:
----------
    Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 3629, in call_highstate
    top = self.get_top()
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 3089, in get_top
    tops = self.get_tops()
  File "/usr/lib/python2.7/site-packages/salt/state.py", line 2787, in get_tops
    saltenv
  File "/usr/lib/python2.7/site-packages/salt/fileclient.py", line 189, in cache_file
    return self.get_url(path, '', True, saltenv, cachedir=cachedir)
  File "/usr/lib/python2.7/site-packages/salt/fileclient.py", line 495, in get_url
    result = self.get_file(url, dest, makedirs, saltenv, cachedir=cachedir)
  File "/usr/lib/python2.7/site-packages/salt/fileclient.py", line 1044, in get_file
    hash_server, stat_server = self.hash_and_stat_file(path, saltenv)
TypeError: 'bool' object is not iterable
 
linux-node1.example.com:
----------
          ID: states
    Function: no.None
      Result: False
     Comment: No Top file or external nodes data matches found.
     Started: 
    Duration: 
     Changes:   
 
Summary
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
ERROR: Minions returned with non-zero exit code

위의 오류 출력 정보에서 "linux-node1.example.com"노드의 핵심 정보는 "No Top file or external nodes data matches found."입니다.이 문제는 줄곧 처리되지 않았지만, 앞의saltstack 필기를 정리한 후, 이 오보 정보는 저절로 사라졌다.(이 노드에 대한 수정 사항이 없는 경우'salt'linux-node1*'state.highstate'명령을 실행하여 스스로 정상으로 돌아갑니다.)
[root@linux-node1 web]# salt 'linux-node1*' state.highstate
linux-node1.example.com:
----------
          ID: apache-install
    Function: pkg.installed
        Name: httpd
      Result: True
     Comment: Package httpd is already installed.
     Started: 14:27:16.058668
    Duration: 1902.564 ms
     Changes:   
----------
          ID: apache-service
    Function: service.running
        Name: httpd
      Result: True
     Comment: Service httpd is already enabled, and is in the desired state
     Started: 14:27:17.962102
    Duration: 418.927 ms
     Changes:   
 
Summary
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2

다음은 "linux-node2.example.com"노드의 고장 처리에 중심을 두고 설명합니다.
"salt'*'test.ping"명령을 실행하는 것은 정상적인 출력이기 때문에, 처음에는 마스터와 미니언 패키지를 삭제하고 다시 설치한 것을 의심했고, 설정 파일이 패키지를 다시 설치한 후, 기본 설정 파일은 원래의 설정 파일을 덮어씁니다.앞에서 정리한 필기를 정리해 보니 이 의심은 거의 배제할 수 있었다.
[root@linux-node1 web]# salt '*' test.ping
linux-node2.example.com:
    True
linux-node1.example.com:
    True

그러나 이전의saltstack 노트를 정리할 때 테스트 실행 명령 1개가 나에게 새로운 발견을 가져다 주었다.
[root@linux-node1 salt]# salt '*' grains.get saltversion
linux-node2.example.com:
    2017.7.1
linux-node1.example.com:
    2015.5.10

명령을 실행하는 출력 결과 두 노드의saltstack 버전이 다르다는 것을 알 수 있습니다.본문 앞에서'yum remove salt-2017.7.1-1.el7.noarch'명령을 실행하고'yum install salt-minion-y'명령을 다시 실행하는 출력을 보면 기본적으로 이런 판단을 할 수 있다.
이때 내가 할 수 있는 유일한 일은'linux-node2.example.com'노드의 미니언도 삭제하고 다시 설치하는 것이다.
salt-minion 프로필의 경로를 찾아서 미니언 파일을 백업합니다:
[root@linux-node2 ~]# cd /etc/salt/
[root@linux-node2 salt]# ll
    124
-rw-r----- 1 root root  2624 8    8 2017 cloud
drwxr-xr-x 2 root root     6 8    8 2017 cloud.conf.d
drwxr-xr-x 2 root root     6 8    8 2017 cloud.deploy.d
drwxr-xr-x 2 root root     6 8    8 2017 cloud.maps.d
drwxr-xr-x 2 root root     6 8    8 2017 cloud.profiles.d
drwxr-xr-x 2 root root     6 8    8 2017 cloud.providers.d
-rw-r----- 1 root root 48789 8    8 2017 master
drwxr-xr-x 2 root root     6 8    8 2017 master.d
-rw-r----- 1 root root 34879 11   9 19:21 minion
drwxr-xr-x 2 root root    27 9    5 2017 minion.d
-rw-r--r-- 1 root root    23 9    5 2017 minion_id
drwxr-xr-x 4 root root    32 9    4 2017 pki
-rw-r----- 1 root root 28002 8    8 2017 proxy
drwxr-xr-x 2 root root     6 8    8 2017 proxy.d
-rw-r----- 1 root root   344 8    8 2017 roster
[root@linux-node2 salt]# cp minion /tmp/

미니언을 삭제하려면 다음과 같이 하십시오.
[root@linux-node2 salt]# yum -y remove salt-minion
     :fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
        
-->       
--->     salt-minion.noarch.0.2017.7.1-1.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt-minion                     noarch                     2017.7.1-1.el7                      @salt-latest                      69 k
 
    
=======================================================================================================================================
    1    
 
    :69 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
          : salt-minion-2017.7.1-1.el7.noarch                                                                                  1/1 
           : salt-minion-2017.7.1-1.el7.noarch                                                                                  1/1 
 
  :
  salt-minion.noarch 0:2017.7.1-1.el7
 
  !

salt-minion 재설치 실패
[root@linux-node2 salt]# yum install salt-minion -y
     :fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base                                                                                                            | 3.6 kB  00:00:00
centos-openstack-pike                                                                                           | 2.9 kB  00:00:00
centos-qemu-ev                                                                                                  | 2.9 kB  00:00:00
epel/x86_64/metalink                                                                                            | 8.2 kB  00:00:00
epel                                                                                                            | 4.7 kB  00:00:00
extras                                                                                                          | 3.4 kB  00:00:00
updates                                                                                                         | 3.4 kB  00:00:00
epel/x86_64/updateinfo         FAILED
http://mirrors.nipa.cloud/epel/7/x86_64/repodata/0cf4a4a36afabff928c5aca5da8cc4cb50174d29fdec7dc56db18310146df319-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found
        。
To address this issue please refer to the below knowledge base article 
 
https://access.redhat.com/articles/1320623
 
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
 
(1/7): centos-qemu-ev/7/x86_64/primary_db                                                                       |  37 kB  00:00:01
(2/7): epel/x86_64/group_gz                                                                                     | 266 kB  00:00:04
(3/7): extras/7/x86_64/primary_db                                                                               | 185 kB  00:00:04
(4/7): epel/x86_64/updateinfo                                                                                   | 909 kB  00:00:12
(5/7): updates/7/x86_64/primary_db                                                                              | 6.9 MB  00:00:19
(6/7): centos-openstack-pike/x86_64/primary_db                                                                  | 1.0 MB  00:00:26
(7/7): epel/x86_64/primary_db                                                                                   | 6.3 MB  00:00:38
Determining fastest mirrors
 * base: mirror.bit.edu.cn
 * epel: mirror01.idc.hinet.net
 * extras: mirrors.cn99.com
 * updates: mirror.bit.edu.cn
        
-->       
--->     salt-minion.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-minion-2015.5.10-2.el7.noarch   
-->         
  :   :salt-minion-2015.5.10-2.el7.noarch (epel)
            :salt = 2015.5.10-2.el7
             : salt-2017.7.1-1.el7.noarch (@salt-latest)
              salt = 2017.7.1-1.el7
            : salt-2015.5.10-2.el7.noarch (epel)
              salt = 2015.5.10-2.el7
         --skip-broken         
        :rpm -Va --nofiles --nodigest

이 패키지 삭제 작업은 이전에'linux-node1'에서도 실행되었는데 이 문제의 핵심이라고 할 수 있다.
[root@linux-node2 salt]# yum -y remove salt-2017.7.1-1.el7.noarch
     :fastestmirror
        
-->       
--->     salt.noarch.0.2017.7.1-1.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt                       noarch                       2017.7.1-1.el7                       @salt-latest                        36 M
 
    
=======================================================================================================================================
    1    
 
    :36 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
          : salt-2017.7.1-1.el7.noarch                                                                                         1/1 
  :/etc/salt/minion      /etc/salt/minion.rpmsave
           : salt-2017.7.1-1.el7.noarch                                                                                         1/1 
 
  :
  salt.noarch 0:2017.7.1-1.el7                                                                                                         
 
  !

미니언을 설치했습니다.
[root@linux-node2 salt]# yum install salt-minion -y
     :fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * epel: mirror01.idc.hinet.net
 * extras: mirrors.cn99.com
 * updates: mirror.bit.edu.cn
        
-->       
--->     salt-minion.noarch.0.2015.5.10-2.el7      
-->          salt = 2015.5.10-2.el7,      salt-minion-2015.5.10-2.el7.noarch   
-->       
--->     salt.noarch.0.2015.5.10-2.el7      
-->          m2crypto,      salt-2015.5.10-2.el7.noarch   
-->       
--->     m2crypto.x86_64.0.0.21.1-17.el7      
-->         
 
      
 
=======================================================================================================================================
 Package                                                                                                                       
=======================================================================================================================================
    :
 salt-minion                       noarch                       2015.5.10-2.el7                       epel                        26 k
      :
 m2crypto                          x86_64                       0.21.1-17.el7                         base                       429 k
 salt                              noarch                       2015.5.10-2.el7                       epel                       4.1 M
 
    
=======================================================================================================================================
    1     (+2      )
 
    :4.5 M
    :20 M
Downloading packages:
(1/3): m2crypto-0.21.1-17.el7.x86_64.rpm                                                                        | 429 kB  00:00:00
(2/3): salt-minion-2015.5.10-2.el7.noarch.rpm                                                                   |  26 kB  00:00:00
(3/3): salt-2015.5.10-2.el7.noarch.rpm                                                                          | 4.1 MB  00:00:08
---------------------------------------------------------------------------------------------------------------------------------------
                                                                                                     511 kB/s | 4.5 MB  00:00:09
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
          : m2crypto-0.21.1-17.el7.x86_64                                                                                      1/3 
          : salt-2015.5.10-2.el7.noarch                                                                                        2/3 
          : salt-minion-2015.5.10-2.el7.noarch                                                                                 3/3 
           : salt-2015.5.10-2.el7.noarch                                                                                        1/3 
           : salt-minion-2015.5.10-2.el7.noarch                                                                                 2/3 
           : m2crypto-0.21.1-17.el7.x86_64                                                                                      3/3 
 
   :
  salt-minion.noarch 0:2015.5.10-2.el7                                                                                                 
 
       :
  m2crypto.x86_64 0:0.21.1-17.el7                                     salt.noarch 0:2015.5.10-2.el7                                    
 
  !

새로 설치한 미니언은 기본 프로필 (이salt버전은 비교적 낡았다) 과 이전 미니언 프로필 (이salt버전은 비교적 새롭다) 의 차이가 적지 않다.여기 백업 좀 해주세요.
[root@linux-node2 salt]# mv minion /tmp/minion.ori

이전에 백업한 미니언 프로파일을 기존 프로파일로 덮어쓰기:
[root@linux-node2 salt]# mv /tmp/minion .

미니언 서비스를 시작하려면 다음과 같이 하십시오.
[root@linux-node2 salt]# systemctl start salt-minion

linux-node1 노드에서 테스트하고 "node2"만 테스트합니다.
[root@linux-node1 web]# salt 'linux-node2*' state.highstate
linux-node2.example.com:
----------
          ID: apache-install
    Function: pkg.installed
        Name: httpd
      Result: True
     Comment: Package httpd is already installed.
     Started: 14:54:50.795000
    Duration: 1276.067 ms
     Changes:   
----------
          ID: apache-service
    Function: service.running
        Name: httpd
      Result: True
     Comment: Service httpd is already enabled, and is in the desired state
     Started: 14:54:52.071785
    Duration: 351.635 ms
     Changes:   
 
Summary
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2

성공했습니다.
최초의 오류 보고 명령인'salt'*'state.highstate'를 실행하는 것도 성공적입니다.
[root@linux-node1 web]# salt '*' state.highstate
linux-node2.example.com:
----------
          ID: apache-install
    Function: pkg.installed
        Name: httpd
      Result: True
     Comment: Package httpd is already installed.
     Started: 14:55:14.326489
    Duration: 1508.146 ms
     Changes:   
----------
          ID: apache-service
    Function: service.running
        Name: httpd
      Result: True
     Comment: Service httpd is already enabled, and is in the desired state
     Started: 14:55:15.835477
    Duration: 368.446 ms
     Changes:   
 
Summary
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2
linux-node1.example.com:
----------
          ID: apache-install
    Function: pkg.installed
        Name: httpd
      Result: True
     Comment: Package httpd is already installed.
     Started: 14:55:14.582278
    Duration: 5233.738 ms
     Changes:   
----------
          ID: apache-service
    Function: service.running
        Name: httpd
      Result: True
     Comment: Service httpd is already enabled, and is in the desired state
     Started: 14:55:19.831056
    Duration: 396.626 ms
     Changes:   
 
Summary
------------
Succeeded: 2
Failed:    0
------------
Total states run:     2

salt-ssh를 다시 테스트해도 문제 없음:
[root@linux-node1 web]# salt-ssh '*' test.ping
linux-node2:
    True
linux-node1:
    True

마지막 설명: 두 버전의 마스터와 미니언 프로필은 내용 차이가 매우 크다.이 문제를 빨리 해결하기 위해서, 마스터, 미니언 전의 프로필을 삭제하고 다시 설치한 프로필을 덮어씁니다.
구체적인 차이에 대해서는 나중에 다시 이야기하자.

좋은 웹페이지 즐겨찾기