전체 글
-
Docker와 Jenkins를 사용하여 CI/CD 구축 <1>인프라/젠킨스 2024. 1. 8. 18:36
학습 내용 젠킨스 사용을 위해서 이런 저런 책과 유뷰브 영상을 찾아보고 직접 적용을 해보겠습니다. 깃에 push가 발생하면 젠킨스가 작동해서 도커 hub에 새로운 이미지를 업로드합니다. 또 작업내용을 slack에서 메세지로 받아봅니다. step1: 웹서버 및 젠킨스 서버 배포 step2: 깃 코드 변경 > 새로운 이미지 빌드 > 도커 허브 갱신 > 신규 이미지로 서버 재배포 1. git Repo 생성 실제로 작업을 하는 컴퓨터에서 스프링 부트 서버를 생성합니다. $ spring init --dependencies=web myserver static 폴더에 index.html을 추가해서 서버가 잘 작동하는지 확인해줍니다. 앞으로 이 인덱스를 수정하면서 젠킨스를 학습할 예정입니다. 생성한 프로젝트를 깃에 r..
-
우분투에 자바 설치 후 환경변수 설정하기인프라/vmware 2024. 1. 5. 20:06
가상머신에 ubuntu를 설치해 놓은 상황입니다. 가상머신을 새로 만들 때 마다 반복해야되서 자바 설치하는 과정을 적어봅니다. 1. jre 설치하기 $ sudo apt-get upate $ sudo apt-get install default-jre 2. 자바 설치 경로 확인하기 $ update-java-alternatives -l // /usr/lib/jvm/java-1.11.0-openjdk-arm64 3. 환경변수 파일에 JAVA_HOME을 등록하기 $ sudo nano /etc/environment JAVA_HOME= 를 추가합니다.
-
[이슈]REMOTE HOST IDENTIFICATION HAS CHANGED!인프라/linux 2024. 1. 5. 19:56
가상 머신을 다시 생성하고 호스트에서 ssh로 접속하려고 했을 때 발생한 이슈 입니다. 자주 만날 것 같아서 메모를 해두겠습니다. known_hosts 라는 파일에 이전 key가 남아있는 것이 문제입니다. $ nano ~/.ssh/known_hosts 파일을 열어보면 현재 접근하려고하는 ip 이전에 생성된 fingerprint key 들이 있습니다. 모두 제거하고 다시 연결하면 문제가 없이 작동합니다. [참고] 한 줄 모두 삭제는 Ctrl + K
-
ssh를 사용한 호스트와 가상환경 통신인프라/vmware 2024. 1. 5. 13:30
aws에서 ec2를 사용할 때 주로 터미널에서 ssh 통신을 통해 제어를 하게됩니다. 이번에 만든 가상머신을 ec2라고 생각하고 ssh 통신을 사용해서 제어할 수 있게 만들어 보는 과정입니다. 우선 양쪽 환경에 ssh가 설치되어있는지 확인해보겠습니다. $ ssh -V ssh 통신은 port 와 username과 ip 주소를 사용한다. $ ssh -p @ 가상 머신의 ip 주소를 확인한다. $ ip addr show 혹시 방화벽이 작동 중이라면 22번 포트를 열어준다. ssh는 22번을 사용한다. # active or inactive 상태확인 $ sudo ufw status # 22번 포트 허용 $ sudo ufw allow 22 # 삭제를 위한 번호 확인 $ sudo ufw status numbered ..
-
가상 환경 구축인프라/vmware 2024. 1. 5. 12:39
가상환경에 리눅스를 설치해서 가상환경을 구축해보겠습니다. 맥 m1을 사용하고 있기 때문에 Vmware Fusion을 사용하고 리눅스는 우분투 22.04.3 버전을 설치하겠습니다. VMware Fusion 다운로드 Ubuntu 다운로드 먼저 VMware를 다운 받아보겠습니다. 기업용은 유료이고 개인 사용자에게는 무료로 제공합니다. 회원 가입을 하면 개인용 licence-key를 받을 수 있습니다. 가상머신에 설치할 os도 다운로드 해야합니다. 저는 ubuntu-22.04.3버전을 사용했습니다. 모두 다운로드가 완료되었다면 설치를 진행해보겠습니다. 미리 다운 받은 iso가 있기 때문에 위에 install from disc or image를 클릭합니다. 이번에 설치할 ubuntu를 선택해줍니다. (저는 또 ..
-
가상화와 컨테이너화 기술의 비교CS/운영체제 2024. 1. 5. 12:17
가상화는 크게 3가지로 나누어서 생각해 볼 수 있습니다. Virtualization으로 불리는 type1, type2와 containerization으로 나뉘는 컨테이너화 기술이 있습니다. 3가지의 차이를 간단히 알아보겠습니다. Virtualization 제가 가상화를 아주 간단하게 표현하면, 한 컴퓨터에서 마치 여러 대의 컴퓨터를 사용하는 것처럼 공간을 나누는 기술이라고 할 것 같습니다. 실제 컴퓨터의 하드웨어 리소스를 여러 대의 가상 컴퓨터가 나눠쓰는 형태로 구현됩니다. 이 때 리소스 분배를 관리하는 컴포넌트를 hypervisor라고 하고, hypervisor의 위치에 따라서 bare-metal과 hosted로 구분 짓습니다. 1. Bare-metal hypervisor (type1) 'barefoo..
-
컨테이너와 컨테이너 사이의 통신인프라/도커 2024. 1. 3. 21:47
지난 글에 이어서 서버와 DB를 함께 다양한 환경에서 사용해보겠습니다. 아래 순서로 글을 진행해보겠습니다. - 호스트와 컨테이너 사이의 통신 1. DB (호스트) & 서버 (호스트) 실행시키기 2. DB (호스트) & 서버 (도커) 실행시키기 3. DB (도커) & 서버 (호스트) 실행시키기 - 컨테이너 사이의 통신 4. 한 개의 컨테이너에서 DB & 서버 실행시키기 5. 각각 다른 컨테이너에서 DB & 서버 실행시키기 6. 도커 컴포즈로 DB & 서버 관리하기 4. 한 개의 컨테이너에서 DB & 서버 실행시키기 로컬 환경에서 DB와 서버를 한 곳에서 실행시키 듯이 컨테이너에서도 가능은 합니다. 스프링 서버와 mysql을 실행시킬 수 있는 환경을 컨테이너에 구현합니다. # Ubuntu 베이스 이미지 사용..
-
호스트와 컨테이너 사이의 통신인프라/도커 2024. 1. 3. 17:13
지난 글에 이어서 서버와 DB를 함께 다양한 환경에서 사용해보겠습니다. 아래 순서로 글을 진행해보겠습니다. - 호스트와 컨테이너 사이의 통신 1. DB (호스트) & 서버 (호스트) 실행시키기 2. DB (호스트) & 서버 (도커) 실행시키기 3. DB (도커) & 서버 (호스트) 실행시키기 - 컨테이너 사이의 통신 4. 한 개의 컨테이너에서 DB & 서버 실행시키기 5. 각각 다른 컨테이너에서 DB & 서버 실행시키기 6. DB & 서버 도커 컴포즈로 관리하기 1. DB (호스트) & 서버 (호스트) 실행시키기 기본적으로 프로젝트 생성시 사용하는 세팅입니다. localhost의 8080 포트와 3306 포트에서 서버와 db를 각각 실행합니다. 스프링 cli를 이용해서 프로젝트를 생성하고 8080에 접속..