일반 환경
여기서 일반 환경이라 함은,salt-minion
이 이미 설치되어 다른 salt-master
에 연결되어 있지 않은 환경을 말합니다.
즉, salt-minion
이 이미 가동되고 있지 않은 환경을 뜻합니다.
Yum install
Salt official installation guide (https://repo.saltproject.io/3001.html#rhel)
→ Enter into the linked page, and then choose “Redhat / CentOS 7 PY3” tab button.
SaltStack 저장소 등록
$ yum install -y epel-release $ rpm --import https://repo.saltproject.io/py3/redhat/7/x86_64/archive/3001.4/SALTSTACK-GPG-KEY.pub $ curl -fsSL https://repo.saltproject.io/py3/redhat/7/x86_64/archive/3001.4.repo | sudo tee /etc/yum.repos.d/salt.repo $ yum clean expire-cache
Salt-Minion 설치
$ yum install -y salt-minion
Config 설정
Salt-Minion :
$ vim /etc/salt/minion.d/minion.conf
master
: Salt-Master IP를 넣는다. Ex) 192.168.45.1id
: Salt 에서 확인하는 Unique ID. 다른 Salt-minion ID와 중복되면 안된다. Ex) minion1, minion2## log_level ## # One of 'garbage', 'trace', 'debug', info', 'warning'(default), 'error', 'critical'. log_level: info master: <master ip address> id: <생략 시, hostname = minion id>
서비스 시작
$ systemctl enable salt-minion $ systemctl start salt-minion $ systemctl status salt-minion
Windows에 설치하는 salt-minion은 Python fork 지연 이슈로 인해, 아래와 같이 설정 파일에서multiprocessing: False
로 바꿔야 한다. (salt-minion 정지 상태에서)
> C:\salt\conf\minion
####### Thread settings ########
###########################################
# Disable multiprocessing support, by default when a minion receives a
# publication a new process is spawned and the command is executed therein.
# WARNING: Disabling multiprocessing may result in substantial slowdowns
# when processing large pillars. See https://github.com/saltstack/salt/issues/38758
# for a full explanation.
multiprocessing: False
Agent의 Hostname 확인
수집 Agent(Telegraf)의 Hostname이 초기 설정 “localhost.localdomain”이면 다른 수집 Agent와 Hostname이 중복되지 않게 변경하기를 권고합니다.
수집 Agent의 데이터 수집 후 InfluxDB에 저장할 때 데이터 중복 오류가 발생할 수 있습니다.
CH 1.0.1이상에서는 minion id와 telegraf의 hostname이 같도록 강제 적용합니다. (UI를 통해 설정할 경우에만)
Off internet
폐쇄망 환경에서 Package Deployment on Private Network(Agent) 설치 방법입니다.
For SWAN only
SWAN edge 장비는 edge Software가 이미 salt를 사용하고 있으므로,
같은 환경에 Yum을 통하여 설치하면 같은 SW간 충돌되어 사용하지 못함에 주의해야 합니다.
Conda 환경에 Salt-Minion 설치
이미 Salt Minion이 설치되어 있거나, 다른 Application의 의존성 문제가 예상될 경우를 대비하여,
Conda 가상 환경으로 Minion을 구동합니다.
부득이, Yum install을 사용하고자 할 경우, https://seversky.atlassian.net/wiki/spaces/CSHD/pages/217022681/Installing+Server+Node#Yum-install 에서 salt-minion만 설치하면 됩니다.
단, 아래의 conda 환경일 경우와 기본 설치 경로(“/opt/miniconda3” => “/”)가 다름을 고려하여 config 등을 작성해야 합니다. 또한 서비스 이름도 본래의 이름(salt-minion) 사용합니다.
Download Install Script
CloudHub v1.0.1부터는 “install_conda.sh”가 “install_salt_on_conda.sh”로 파일명이 변경되었습니다.
v1.0.0 이전 버전은 “install_conda.sh”를 사용해야 합니다.
v1.0.1:curl -O https://raw.githubusercontent.com/snetsystems/cmp/master/etc/install_salt_on_conda.sh
v1.0.0:curl -O https://raw.githubusercontent.com/snetsystems/cloudhub/1.0.0-hotfix02/etc/install_conda.sh
설치 방법
$ chmod 755 install_salt_on_conda.sh $ ./install_salt_on_conda.sh -m [salt-master ip address] -i [salt-minion ID]
Argument
-m : Salt-Master의 IP address (혹은 domain)를 입력합니다.
-i : Salt-Minion의 ID를 입력합니다.
입력하지 않을 경우 hostname으로 등록
-h : Argument의 설명
[root@localhost ~]# ./install_salt_on_conda.sh -h usage: install_salt_on_conda.sh [options] Installs Miniconda3 & Salt-Minion -m Set salt-master ip address, -m [ip address] -i Set salt-minion ID (default : hostname), -i [minion id]
설치항목 선택
'N' 입력 (Salt-Minion만 설치)
$ Do you install Salt-Master?' [y/N] N
Conda 설치경로
기본 설치경로 :
/opt/miniconda3
설치경로 변경 예제
[root@localhost ~]# ./install_salt_on_conda.sh -m 192.168.56.101 -i minion1 -------------------------------------------------- Salt-Master : 192.168.56.101 Salt-Minion ID : minion1 -------------------------------------------------- Miniconda3 will now be installed into this location: /opt/miniconda3 - Press ENTER to confirm the location - Press CTRL-C to abort the installation - Or specify a different location below [/opt/miniconda3] >>> "설치경로 입력 (미입력 시 기본설치 폴더에 설치)"
Salt-Minion 서비스 시작
설치 완료 후 Salt-Minion 서비스를 자동으로 시작할 수 있습니다.
Do you want to start the 'snet-salt-minion.service' [y/N]?
Agent의 Hostname 확인
수집 Agent(Telegraf)의 Hostname이 초기 설정 “localhost.localdomain”이면 다른 수집 Agent와 Hostname이 중복되지 않게 변경하기를 권고합니다.
수집 Agent의 데이터 수집 후 InfluxDB에 저장할 때 데이터 중복 오류가 발생할 수 있습니다.
설치 후 확인사항
Minion Config
[root@localhost ~]# cat /opt/miniconda3/etc/salt/minion # Set the location of the salt master server. If the master server cannot be # resolved, then the minion will fail to start. master: 192.168.56.101 id: minion1 # The directory to store the pki information in root_dir: /opt/miniconda3/ #file_roots: # base: # - /opt/conda/srv/salt/prod
서비스 시작, 서비스 상태
[root@localhost ~]# systemctl start snet-salt-minion [root@localhost ~]# systemctl status snet-salt-minion ● 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 Thu 2020-02-27 17:05:18 KST; 6s ago Main PID: 12991 (salt-minion) CGroup: /system.slice/snet-salt-minion.service ├─12991 /opt/conda/envs/saltenv/bin/python /opt/conda/envs/saltenv/bin/salt-minion -c /opt/conda/etc/salt ├─12996 /opt/conda/envs/saltenv/bin/python /opt/conda/envs/saltenv/bin/salt-minion -c /opt/conda/etc/salt └─12998 /opt/conda/envs/saltenv/bin/python /opt/conda/envs/saltenv/bin/salt-minion -c /opt/conda/etc/salt Feb 27 17:05:18 localhost.localdomain systemd[1]: Starting The Salt Minion... Feb 27 17:05:18 localhost.localdomain systemd[1]: Started The Salt Minion. Feb 27 17:05:18 localhost.localdomain salt-minion[12991]: [WARNING ] /opt/conda/envs/saltenv/lib/python3.7/site-packages/salt/utils/dictdiffer.py:16: DeprecationWarning: ...op working Feb 27 17:05:18 localhost.localdomain salt-minion[12991]: from collections import Mapping Feb 27 17:05:23 localhost.localdomain salt-minion[12991]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds be...thenticate Hint: Some lines were ellipsized, use -l to show in full.
Add Comment