젠킨슨

젠킨슨 슬레이브 노드 만들기

bo20cy 2024. 6. 21. 14:13

 

 

젠킨슨 슬레이브 노드 만들기

 

젠킨슨 설치 및 이전 작업
https://bo20cy.tistory.com/23

 

services:
  jenkins:
    image:  jenkins-jdk21
    restart:  unless-stopped
    ports:  
      -  "38080:8080"  
      -  "50000:50000"  

 

도커 컴포즈 만들때 50000 포트 열은 이유가 마스터-슬레이브 구조를 선택해서 슬레이브 배포용이었습니다.

 

 슬레이브에 젠킨슨을 깔 필요는 없으나 자바는 있어야 되기 때문에 자바를 깔아 줍니다.

자바

apt list openjdk*

 

 

이것으로 확인 해 주고 깔아서 준비 작업을 마무리 합니다.

 


 

하지만 저는 jdk 19를 쓰므로

 

openjdk말고 다른 것을

 

https://bell-sw.com/pages/repositories/#apk

 

Liberica Package Repositories

Warning! This domain doesn’t belong to BellSoft! This site is not a mirror, but the copy of the official BellSoft's web page created by a third party without our permission. When you download anything from this domain, you risk installing malicious softw

bell-sw.com

 

wget -q -O - https://download.bell-sw.com/pki/GPG-KEY-bellsoft | sudo apt-key add -
echo "deb [arch=arm64] https://apt.bell-sw.com/ stable main" | sudo tee /etc/apt/sources.list.d/bellsoft.list

sudo apt-get update
sudo apt-get install bellsoft-java21

 

공식 문서에 있는데로 java21을 설치합니다. 버전에 따라 jdk, jvm, jre다릅니다. 일반버전은 jdk가 설치되어 있습니다.

 

 

마지막으로 java 기본 설정을 바꾸어주고 마무리 합니다.

 


노드 설정

노드 설정에 들어 갑니다.

New node로 새로 만들어 줍니다.

 

 

 

 

 

Name : 노드이름

 

Number of executors : 동시 작동 갯수

 

Remote root directory : 슬레이브 노드에서 연결시킬 파일디렉토리 위치

 

Label : 노드속성(그룹? 비슷)

 

 

 

 

 

 

 

Launch method는 ssh 연결을 할것이기에 ssh 설정이 필요합니다.

 

그리고 ssh로 슬레이브와 통신하기 때문에 비밀번호를 통신할 때마다 할 필요는 없기 때문에 ssh를 지정해줍니다.

SSH 설정

ssh-keygen 명령어를 써서 ssh-key를 만듭니다.

 

open ssh 옵션은

공식 홈페이지

https://man.openbsd.org/ssh

 

ssh(1) - OpenBSD manual pages

ssh — OpenSSH remote login client ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J destination] [-L address] [

man.openbsd.org

 

ssh-keygen -t rsa -b 4096 옵션을 넣어서 적었다.

 

그리고 ssh-copy-id 를 사용해 ssh-key를 복사해주자

 

sudo ssh-copy-id bo20cy@123.456.789.000

 

그렇지만 ssh통신을 서버 자체와 하는게 아니라 컨테이너와 하기 때문에

 

jenkins 컨테이너에 들어가서 ssh로 집입해 known_hosts에 기록을 남겨주자

 

docker exec -it 젠킨슨번호 /bin/bash


ssh bo20cy@123.456.789.000

 

ssh 설정은 끝났습니다.

 

 

 

설정해야 할 목록

 

 ID: 젠킨슨용 이름텍

 

사용자 이름: 리눅스 사용자 이름

 

개인 키 : private key

 

암호 : 리눅스 사용자 암호

 

Host : 접속주소 (123.456.789.000)

 

JavaPath : java 위치

 

 

 

 

 

로그에 들어가면

 

성공적으로 로드 되었다.

 

 

 

 

참조

더보기
https://holjjack.tistory.com/275
https://charmer.tistory.com/entry/Jenkins-Jenkins%EC%97%90%EC%84%9C-Master-Slave-%EA%B5%AC%EC%84%B1%ED%95%98%EA%B8%B0
https://seosh817.tistory.com/370
https://suyeon96.tistory.com/37
https://docs.github.com/ko/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
https://ydeer.tistory.com/298
https://junyharang.tistory.com/336

실수
https://bo20cy.tistory.com/25
ssh-key