Linux

[CentOS]Linux 환경 젠킨스 설치

  • -
반응형

최근에 CentOS에 젠킨스를 설치해야할 일이 생겼습니다.

과정이 어렵지는 않았으나 첫 과정이었기에 포스팅에 남기려고 합니다.

설치 과정은 어렵지 않았지만 오랜만에 리눅스 명령어를 사용하려니 하나씩 찾아보며 해야하는 점이 힘들었던 것 같습니다. 리눅스 명령어를 먼저 익히고 진행하면 좀 더 쉽게 진행할 수 있을 것 같습니다.


젠킨스 저장소 설치(안정버전)
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

 

저장소 추가시 아래와 같은 에러가 났으나 sudo yum install -y ca-certificates 명령어로 해결할 수 있었다.

--2021-12-16 17:17:42--  https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 146.75.50.133, 2a04:4e42:7c::645
Connecting to pkg.jenkins.io (pkg.jenkins.io)|146.75.50.133|:443... connected.
ERROR: cannot verify pkg.jenkins.io's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
  Issued certificate has expired.
To connect to pkg.jenkins.io insecurely, use `--no-check-certificate'.

 

sudo yum install -y ca-certificates

다시 설치 명령어를 입력하면 아래와 같이 완료된다.

 

젠킨스 설치
sudo yum install jenkins -y

만약 에러가 발생한다면 아래 명령어를 입력한다.

yum install epel-release # repository that provides 'daemonize'
yum install jenkins java-1.8.0-openjdk-devel

 

AWS 이용시 demonize 에러가 발생하는데 이는 Amazon Linux는 deamonize라는 모듈을 지원하지 않기 때문이다. 그래서 별도의 설치 과정이 필요하다.

vim /etc/yum.repos.d/epelfordaemonize.repo

epelfordaemonize.repo 아래 내용 입력 후 저장

[daemonize]
baseurl=https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/
gpgcheck=no
enabled=yes

daemonize 설치

yum install daemonize -y

 

젠킨스 설치 확인
rpm -qa | grep jenkins

 

젠킨스 포트 변경
 vi /etc/sysconfig/jenkins

명령어를 입력하면 모드가 변경된다. i 입력 후 엔터를 누르면 입력모드로 변경된다.

포트를 8080에서 9090으로 변경해준다.

이후 esc를 한 번 누른 후 :(세미콜론)wq을 입력하고 엔터를 누르면 저장 후 닫기가 된다.

 

방화벽 젠킨스 포트 허용
 sudo firewall-cmd --permanent --zone=public --add-port=9090/tcp

 

방화벽 재시작
sudo firewall-cmd --reload

 

젠킨스 시작
sudo service jenkins start

 

이제 젠킨스가 설치된 서버의 IP 또는 localhost:9090을 입력해보면 젠킨스 접속이 가능해진다.

기본 플러그인 설치 후 넘어가면 된다.

 

참고자료
 

Redhat Jenkins Packages

Jenkins Redhat Packages To use this repository, run the following command: sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key If you've previous

pkg.jenkins.io

반응형

'Linux' 카테고리의 다른 글

리눅스 명령어 모음  (2) 2022.10.18
[CentOS]MySQL8 설치  (0) 2022.02.12
[CentOS]Virtual Box + CentOS7 설치  (0) 2022.02.11
[CentOS]Linux Tomcat 서비스 등록  (0) 2021.12.21
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.