인프라

1. AMI(Amazon Machine Image) 란? AWS EC2 인스턴스를 시작하는 데 필요한 소프트웨어 구성(운영 체제, 애플리케이션, 설정 등)을 포함한 템플릿.AMI는 EC2 인스턴스를 생성할 때 기본적으로 사용되며, 동이랗ㄴ 구성을 가진 여러 인스턴스를 빠르고 일관되게 배포할 수 있도록 도와준다. EC2 인스턴스를 시작할 때 이름도 넣고, VPC도 선택하고, 키 페어도 선택하고, 여러 가지를 선택하는데,그 중에서도 AMI를 선택하게 되어 있다.  Quick Start 라는 항목을 보면,Amazon Linux, macOS 등등을 선택할 수 있다.일반적으로 EC2를 배포할 때 Amazon Linux를 많이 선택한다. 2. 사용자 정의 AMI Quick Start 옆에 내 AMI 라는 항목이 눈..
1. Kompose란? docker-compose.yml 파일을 쿠버네티스를 실행하기 위한 yaml 파일로 변환하는 툴이다.https://kompose.io/ Kompose - Convert your Docker Compose file to Kubernetes or OpenShiftWhy do cats (and developers) like Kompose? Developers love to simplify their development environment with Docker Compose. With Kompose, you can now push the same file to a production container orchestrator! Getting Startedkompose.io https:/..
1. Todo 애플리케이션 간단한 Todo 애플리케이션을 만든다. JSON을 반환하는 REST API application.아주 간단해서 생략....https://github.com/in28minutes/kubernetes-crash-course/tree/master/03-todo-web-application-mysql kubernetes-crash-course/03-todo-web-application-mysql at master · in28minutes/kubernetes-crash-courseLearn Kubernetes and Docker with Google Kubernetes Engine deploying Spring Boot Microservices - in28minutes/kubernete..
1. LokiLoki 는 Grafana Labs 에서 개발한 수평 확장 가능한 로그 집계 시스템이다. Grafana와 쉽게 연동 되고, Prometheus, K8s와 궁합이 잘 맞는다.Elasticsearch과 비교하면, 성능과 제공하는 기능 측면에서 부족하긴 하지만, 시스템 상황을 확인하는 데는 가성비 있는 도구이다. 2. Spring 프로젝트 설정 build.gradledependencies { implementation 'com.github.loki4j:loki-logback-appender:1.5.1' //추가 implementation 'org.springframework.boot:spring-boot-starter-data-jpa' runtimeOnly 'com.h2database:h2' im..
1. 대표적인 장애 상황 CPU 사용량이 과도하게 많아질 때JVM 메모리가 과도하게 많아질 때데이터베이스 연결(Database Connection)이 과도하게 많아질 때에러 로그가 갑자기 치솟을 때 2. CPU 사용량 시뮬레이션package com.monitor.sample;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;import javax.sql.DataSource;i..
1. 대시보드 템플릿 지난 블로그 글에서는 직접 대시보드를 만들어봤다.직접 대시보드를 만들어서 모니터링해도 되지만,누군가가 미리 만들어 놓은 대시보드를 사용하는 게 훨씬 효율적이다. 아래 사이트에 접속하면 이미 만들어져 있는 대시보드를 확인할 수 있다.  https://grafana.com/grafana/dashboards Grafana dashboards | Grafana LabsNo results found. Please clear one or more filters.grafana.com  2. 대시보드 템플릿 import 하기 사용하고자 하는 템플릿의 ID를 copy 하거나 기억해둔 다음 import하면 끝이다.  ID를 넣고 Load를 클릭한 다음, 데이터 소스를 프로메테우스 로 지정해주면 된다...
1. Grafana Your observability stack, faster and easier 2. Grafana는 무엇인가?  그라파나는 프로메테우스를 통해 수집한 메트릭을 보여주는 도구이다.spring actuator가 측정한 메트릭을 프로메테우스가 저장하고 그것을 그라파나가 시각화하는 것이다. 3. Grafana 설치설치는 1. 로컬에 직접 설치, 2. 도커로 설치가 있는데,나는 도커로 설치했다. docker run -d --name=grafana -p 3000:3000 grafana/grafana 기본 포트가 3000번이다. 4. Grafana Web UI localhost:3000 번으로 접근하면 로그인 창이 뜬다. username: adminpassword: admin로그인 해준다.pass..
1. PrometheusFrom metrics to insightPower your metrics and alerting with the leadingopen-source monitoring solution. 메트릭으로부터 인사이트를 얻으라.Prometheus는 오픈소스다.https://prometheus.io/ Prometheus - Monitoring system & time series databaseAn open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.prometheus.io 2. 메트릭..