SSH Key 생성하기
$ mkdir ~/.ssh && chmod 700 ~/.ssh
$ cd ~/.ssh
$ ssh-keygen -t rsa -C "JenkinsAgentRSA" -f "jenkinsAgent_rsa"
$ ls
jenkinsAgent_rsa  jenkinsAgent_rsa.pub- 
이 키는 한번 만들어두면 여러 agent 서버에 사용할 수 있다. 
Worker 서버에 공개키 등록하기(Agent)
$ cat jenkinsAgent_rsa.pub >> ~/.ssh/authorized_keysManager에 비밀키 등록하기(Jenkins)
- 
plugin 설치: SSH Build Agents 
- 
credentials 생성 - 
Add Credentials로 추가- 
Username: 접속하고자 하는 서버의 계정 
- 
Private Key: 서버에서 생성한 private key 
- 
Passphrase: ssh key 생성시 입력한 passphrase 
 
- 
 
- 
SSH Agent 추가하기
- 
# of executors갯수는 전체 코어 갯수보다 적게 설정해야 한다. →lscpu명령어로 cpu 정보 확인 가능
 https://stackoverflow.com/a/9626974/3793078
- 
Host Key Verification Strategy값은Manually trusted key Verification Strategy로 설정해줘야 한다.
- 
launcher agent로 설치 
Troubleshooting
Failed to create parent directories for tracking file
[WARNING] Failed to write tracking file /home/user/.m2/repository/...- 
원인: 빌드가 동작하는 노드가 예전에 docker로 jenkins를 띄웠었는데, 그 때 m2 디렉토리 권한을 root로 변경시킴 
- 
해결방법: $ chown -R user:user ~/.m2
도커 worker(aka. agent, node) 설치시 workser 서버에 yum 업데이트할 때 커널 제외하기 * https://www.cyberciti.biz/faq/yum-update-except-kernel-package-command/
locale 설정
각 노드 서버에 locale을 설정해두었더라도 jenkins master가 ssh를 통해 작업을 실행시키는 경우 locale이 반영 안되는 이슈
jenkins node 설정에서 LANG 값을 주입시킴으로써 해결
- 
Node > Configure > Node Properties > Environment variables 
- 
Environment variables 추가 - 
이름 
 LANG
- 
값 
 ko_KR.utf8
 
-