Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • conda에는 salt-minion만 설치합니다.

  • USB 또는 CD에 있는 conda 압축 파일을 Local 디렉토리(e.g. /root/conda)에 복사합니다.

    Code Block
    languagebash
    # conda 설치 경로에 압축 풀기
    # '/opt/miniconda3' 폴더 자동 생성
    #
    $ tar zxvf conda.tar.gz -C /
    
    
    # bash에 conda 설정
    #
    $ echo ". /opt/miniconda3/etc/profile.d/conda.sh" >> ~/.bashrc
    $ source ~/.bashrc > /dev/null 2>&1
    $ source /opt/miniconda3/etc/profile.d/conda.sh
  • conda 가상환경 conda의 saltenv 가상 환경을 실행합니다.

    Code Block
    languagebash
    # conda 가상환경 리스트에서 saltenv 확인
    #
    $ conda env list
    # conda environments:
    #
    base                  *  /opt/miniconda3
    saltenv                  /opt/miniconda3/envs/saltenv
    
    
    # saltenv 가상환경 실행
    #
    $ conda activate saltenv
    
    
  • logrotate.d 에 salt-minion log 등록합니다.

    Code Block
    # create salt log
    #
    $ echo "/opt/miniconda3/var/log/salt/minion {
        rotate 7
        daily
        missingok
        dateext
        notifempty
        compress
    }" > /etc/logrotate.d/snet-salt
  • salt-minoin 실행합니다service 파일 작성합니다.

    Code Block
    languagebash
    # create salt-minion service
    #
    $ echo "[Unit]
    Description=The Salt Minion
    After=network.target
    
    [Service]
    KillMode=process
    Type=notify
    NotifyAccess=all
    LimitNOFILE=8192
    ExecStart=/opt/miniconda3/envs/saltenv/bin/salt-minion -c '/opt/miniconda3/etc/salt'
    
    [Install]
    WantedBy=multi-user.target" > /usr/lib/systemd/system/snet-salt-minion.service
  • snet-salt-minion.service

    서비스 등록 및 시작합니다.

    Code Block
    languagebash
    # snet-salt-minion.service 등록
    #
    $ systemctl daemon-reload > /dev/null 2>&1
    $ systemctl enable snet-salt-minion.service > /dev/null 2>&1
    
    # snet-salt-minion.service 시작
    $ systemctl start snet-salt-minion.service
    $ systemctl status snet-salt-minion.service
    ● snet-salt-minion.service - The Salt Minion
       Loaded: loaded (/usr/lib/systemd/system/snet-salt-minion.service; enabled; vendor preset: disabled)
       Active: active (running) since 수 2020-12-23 08:31:51 KST; 1s ago
     Main PID: 2568 (salt-minion)
       CGroup: /system.slice/snet-salt-minion.service
               ├─2568 /opt/miniconda3/envs/saltenv/bin/python /opt/miniconda3/envs/saltenv/bin/salt-minion -c /opt/miniconda3/etc/salt
               ├─2573 /opt/miniconda3/envs/saltenv/bin/python /opt/miniconda3/envs/saltenv/bin/salt-minion -c /opt/miniconda3/etc/salt
               └─2575 /opt/miniconda3/envs/saltenv/bin/python /opt/miniconda3/envs/saltenv/bin/salt-minion -c /opt/miniconda3/etc/salt
    
    12월 23 08:31:51 conda systemd[1]: Starting The Salt Minion...
    12월 23 08:31:51 conda systemd[1]: Started The Salt Minion.
    12월 23 08:31:51 conda salt-minion[2568]: [WARNING ] /opt/miniconda3/envs/saltenv/lib/python3.7/site-packages/salt/utils/dictdiffer.py:16: DeprecationWarning: Using or importing the ABCs from 'collections' instead of fro...will stop working
    12월 23 08:31:51 conda salt-minion[2568]: from collections import Mapping
    Hint: Some lines were ellipsized, use -l to show in full.
    
    .
  • saltenv conda 가상 환경에서 빠져나옵니다.

    Code Block
    languagebash
    # saltenv 가상환경 종료
    #
    (saltenv) [root@conda salt]# conda deactivate