01. wget을 jenkins repository를 설정파일을 생성합니다.
wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@pms01 ~]# wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
--2021-01-05 07:34:18-- https://pkg.jenkins.io/redhat-stable/jenkins.repo
Resolving pkg.jenkins.io (pkg.jenkins.io)... 151.101.2.133, 151.101.66.133, 151.101.130.133, ...
Connecting to pkg.jenkins.io (pkg.jenkins.io)|151.101.2.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85
Saving to: ‘/etc/yum.repos.d/jenkins.repo’
100%[======================================>] 85 --.-K/s in 0s
2021-01-05 07:34:19 (646 KB/s) - ‘/etc/yum.repos.d/jenkins.repo’ saved [85/85]
만약 -bash: wget: command not found
이란 문구를 본다면, wget 이 아직 설치 되어있지 않다는 의미입니다. 우선, wget을 yum을 통해 설치 해줍니다.
yum -y install wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.navercorp.com
* extras: mirror.navercorp.com
* updates: mirror.navercorp.com
base | 3.6 kB 00:00
extras | 2.9 kB 00:00
prel-release-noarch | 2.9 kB 00:00
ps-80-release-x86_64 | 2.9 kB 00:00
tools-release-x86_64 | 2.9 kB 00:00
updates | 2.9 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7_6.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
wget x86_64 1.14-18.el7_6.1 base 547 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 547 k
Installed size: 2.0 M
Downloading packages:
wget-1.14-18.el7_6.1.x86_64.rpm | 547 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : wget-1.14-18.el7_6.1.x86_64 1/1
Verifying : wget-1.14-18.el7_6.1.x86_64 1/1
Installed:
wget.x86_64 0:1.14-18.el7_6.1
Complete!
02. key를 import 합니다.
rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
03. yum 을 이용하여 jenkins을 설치 합니다.
yum -y install jenkins
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.navercorp.com
* extras: mirror.navercorp.com
* updates: mirror.navercorp.com
jenkins | 2.9 kB 00:00
jenkins/primary_db | 35 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package jenkins.noarch 0:2.263.1-1.1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
jenkins noarch 2.263.1-1.1 jenkins 64 M
Transaction Summary
================================================================================
Install 1 Package
Total download size: 64 M
Installed size: 64 M
Downloading packages:
jenkins-2.263.1-1.1.noarch.rpm | 64 MB 00:12
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : jenkins-2.263.1-1.1.noarch 1/1
Verifying : jenkins-2.263.1-1.1.noarch 1/1
Installed:
jenkins.noarch 0:2.263.1-1.1
Complete!
04. Jenkins의 기본 포트는 8080 이며, 만약 기존 서비스가 포트 8080을 쓰고 있다면, /etc/sysconfig/jenkins 에서 포트 번호를 번경 해 줍니다. 해당 사항이 없으면 건너 뛰면 됩니다.
vi /etc/sysconfig/jenkins
중간에 보면 JENKINS_PORT="8080" 가 존재합니다. 이 부분에 사용할 포트 번호를 변경해줍니다.
## Type: integer(0:65535)
## Default: 8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"
## Type: string
## Default: ""
05. 해당 서비스를 외부에서 접속해서 사용할 수 있게끔, 해당 포트 방화벽을 열어줍니다.
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
06. 부팅시 서비스를 가능하게 해줍니다.
systemctl enable jenkins
07. 서비스를 실행시켜줍니다.
systemctl start jenkins
08. 웹브라우저를 통해 jenkins에 접속 후 나머지 플러그인 과 관리자 계정을 생성해줍니다.
vi /var/lib/jenkins/secrets/initialAdminPassword
09. Jenkins 설치 및 세팅이 완료 되었습니다.
'IT > Infra' 카테고리의 다른 글
[MinIO] MinIO (0) | 2021.01.17 |
---|---|
[Centos7] MinIO 객체 스토리지 설치 (0) | 2021.01.17 |
[Centos7] RabbitMQ Cluster 구성 (0) | 2020.11.29 |
[Centos7] Rabbitmq 설치 (Feat. yum Repo 설치) (0) | 2020.11.29 |
[Vagrant] Multi VM , Memory, Cpus 설정 (0) | 2020.11.29 |