From bf4f9ad53e65e1996b48efb812f4d06f1d4cafa5 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Fri, 14 Jun 2024 15:35:15 +0900 Subject: [PATCH 01/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index abb0d618..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 7fdf6a6975cb2e17f704072c238120fb7952faad Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 13:43:15 +0900 Subject: [PATCH 02/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..abb0d618 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 5f39ebef9d69379ccd4d32801f844885a6543afd Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 13:47:47 +0900 Subject: [PATCH 03/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index abb0d618..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 17a44f35ff43f7626cfbb8b9b0b0ffeeca237c97 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:09:32 +0900 Subject: [PATCH 04/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- nginx.conf | 8 ++++++++ prometheus.yml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nginx.conf b/nginx.conf index 2b86cee7..f7db9476 100644 --- a/nginx.conf +++ b/nginx.conf @@ -50,6 +50,14 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } + + location /actuator/prometheus { + proxy_pass http://app/actuator/prometheus; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } location = /favicon.ico { return 204; access_log off; diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..abb0d618 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 49277146dc4724ede21e4958456f51204b8bd47e Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:12:26 +0900 Subject: [PATCH 05/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index abb0d618..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From e6245980af85a6537a0bd2ef4014c4c2dc58269f Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:17:42 +0900 Subject: [PATCH 06/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- docker-compose.yml | 2 ++ prometheus.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b02717a1..aa75e4d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,6 +85,8 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" + command: + - '--config.file=/etc/prometheus/prometheus.yml' networks: - server-network diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..abb0d618 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 78d2fc6263078421f2968204b18c17d2d58e0b54 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:25:18 +0900 Subject: [PATCH 07/59] =?UTF-8?q?[ci]=20request=20schema=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit request schema 변경 --- prometheus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index abb0d618..54228434 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,8 +8,9 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' + scheme: 'https' - job_name: 'mysql' static_configs: From b5618a6f73123a26ee139e1e230f9d8599b08f77 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:30:21 +0900 Subject: [PATCH 08/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index 54228434..067ef4a2 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' scheme: 'https' From 0836bd8ad0ee3ef8832c0ec2e3f0ed86abdfdb40 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:37:49 +0900 Subject: [PATCH 09/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- docker-compose.yml | 2 -- nginx.conf | 8 -------- prometheus.yml | 3 +-- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index aa75e4d0..b02717a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,8 +85,6 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" - command: - - '--config.file=/etc/prometheus/prometheus.yml' networks: - server-network diff --git a/nginx.conf b/nginx.conf index f7db9476..2b86cee7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -50,14 +50,6 @@ http { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } - - location /actuator/prometheus { - proxy_pass http://app/actuator/prometheus; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } location = /favicon.ico { return 204; access_log off; diff --git a/prometheus.yml b/prometheus.yml index 067ef4a2..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,9 +8,8 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - scheme: 'https' - job_name: 'mysql' static_configs: From 0102ad0a193c6c13590a028ce85fb92bdecb25cc Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 16:44:30 +0900 Subject: [PATCH 10/59] =?UTF-8?q?[ci]=20=EC=9D=98=EC=A1=B4=EA=B4=80?= =?UTF-8?q?=EA=B3=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 의존관계 변경 --- docker-compose.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index b02717a1..996593f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,7 +87,10 @@ services: - "host.docker.internal:host-gateway" networks: - server-network - + depends_on: + - app1 + - app2 + - app3 grafana: image: grafana/grafana container_name: grafana From a9d314e8fa03a2be89a78b8e036eb44c5c98e3ae Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 17:00:09 +0900 Subject: [PATCH 11/59] =?UTF-8?q?[ci]=20=EA=B8=B0=EC=A1=B4=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존으로 변경 --- docker-compose.yml | 5 +---- prometheus.yml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 996593f7..b02717a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,10 +87,7 @@ services: - "host.docker.internal:host-gateway" networks: - server-network - depends_on: - - app1 - - app2 - - app3 + grafana: image: grafana/grafana container_name: grafana diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..74a4cb68 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -14,3 +14,4 @@ scrape_configs: - job_name: 'mysql' static_configs: - targets: ['mysqld-exporter:9104'] +ㅋ \ No newline at end of file From 8706697e5bcc1a2674c7938ee24ef2c6a56015a1 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 17:00:17 +0900 Subject: [PATCH 12/59] =?UTF-8?q?[ci]=20=EA=B8=B0=EC=A1=B4=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기존으로 변경 --- prometheus.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index 74a4cb68..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -14,4 +14,3 @@ scrape_configs: - job_name: 'mysql' static_configs: - targets: ['mysqld-exporter:9104'] -ㅋ \ No newline at end of file From 4a430f7926fde314ae27cc5531e221aa11040a43 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 17:19:54 +0900 Subject: [PATCH 13/59] =?UTF-8?q?[ci]=20targets=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 변경 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..abb0d618 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 2723c22baea4e75af4b7160535d3614729161f6c Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 17 Jun 2024 17:26:02 +0900 Subject: [PATCH 14/59] =?UTF-8?q?[ci]=20docker=20network=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker network 변경 --- docker-compose.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b02717a1..742e67e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,8 +21,6 @@ services: - app3 - prometheus - grafana - networks: - - server-network app1: image: "yeachan05/application:latest" @@ -34,8 +32,6 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network app2: image: "yeachan05/application:latest" @@ -47,8 +43,6 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network app3: image: "yeachan05/application:latest" @@ -60,8 +54,6 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network redis: container_name: redis @@ -71,8 +63,6 @@ services: - "6379:6379" volumes: - redis-data:/data - networks: - - server-network prometheus: image: prom/prometheus @@ -85,8 +75,6 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" - networks: - - server-network grafana: image: grafana/grafana @@ -98,8 +86,6 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - grafana-storage:/var/lib/grafana - networks: - - server-network mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -111,14 +97,8 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - networks: - - server-network volumes: grafana-storage: prometheus-data: redis-data: - -networks: - server-network: - driver: bridge From e3789c4fb37bdee7fe9ba5c0f5a44fb50bc7f540 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 16:20:12 +0900 Subject: [PATCH 15/59] =?UTF-8?q?[ci]=20application=20timezone=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit application timezone 수정 --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 742e67e5..5bbc72d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -32,6 +32,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml + environment: + TZ: "Asia/Seoul" app2: image: "yeachan05/application:latest" @@ -43,6 +45,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml + environment: + TZ: "Asia/Seoul" app3: image: "yeachan05/application:latest" @@ -54,6 +58,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml + environment: + TZ: "Asia/Seoul" redis: container_name: redis From 3475b421d4733ab581d2bab7a5274299eb31317d Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 18:54:53 +0900 Subject: [PATCH 16/59] =?UTF-8?q?[ci]=20targets=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 수정 --- docker-compose.yml | 9 ++++++--- prometheus.yml | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5bbc72d5..bfc1df64 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,8 @@ services: volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml environment: - TZ: "Asia/Seoul" + - TZ=Asia/Seoul + - spring.application.name=app1 app2: image: "yeachan05/application:latest" @@ -46,7 +47,8 @@ services: volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml environment: - TZ: "Asia/Seoul" + - TZ=Asia/Seoul + - spring.application.name=app2 app3: image: "yeachan05/application:latest" @@ -59,7 +61,8 @@ services: volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml environment: - TZ: "Asia/Seoul" + - TZ=Asia/Seoul + - spring.application.name=app3 redis: container_name: redis diff --git a/prometheus.yml b/prometheus.yml index abb0d618..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From de010f2e73dd55b13c651f7310b01ccd34d3bd19 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 19:24:37 +0900 Subject: [PATCH 17/59] =?UTF-8?q?[ci]=20=EB=AF=B8=EB=B0=98=EC=98=81?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 미반영파일 지정 --- appspec.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appspec.yml b/appspec.yml index 0d70f3c0..af62f150 100644 --- a/appspec.yml +++ b/appspec.yml @@ -5,6 +5,8 @@ files: - source: / destination: /home/ec2-user/cicd overwrite: yes + ignore: + - /home/ec2-user/cicd/src/main/resources/application-prod.yml file_exists_behavior: OVERWRITE From 29bf775b84f1e1f81f6bc000c7ff0411d9242044 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 19:29:31 +0900 Subject: [PATCH 18/59] =?UTF-8?q?[ci]=20=EB=AF=B8=EB=B0=98=EC=98=81?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 미반영파일 지정 --- appspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appspec.yml b/appspec.yml index af62f150..735fba6e 100644 --- a/appspec.yml +++ b/appspec.yml @@ -5,7 +5,7 @@ files: - source: / destination: /home/ec2-user/cicd overwrite: yes - ignore: + exclude: - /home/ec2-user/cicd/src/main/resources/application-prod.yml file_exists_behavior: OVERWRITE From f39390b732aa2632d7c3282a054135ccb0e95310 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 19:42:56 +0900 Subject: [PATCH 19/59] =?UTF-8?q?[ci]=20=EB=AF=B8=EB=B0=98=EC=98=81?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 미반영파일 지정 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index bfc1df64..425ad8f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -110,4 +110,4 @@ services: volumes: grafana-storage: prometheus-data: - redis-data: + redis-data: \ No newline at end of file From bf32201d4d9fa1f9b99a9eb21e4ac4f1a45c9c60 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 20:02:16 +0900 Subject: [PATCH 20/59] =?UTF-8?q?[ci]=20=EC=84=A4=EC=A0=95=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EB=B0=B1=EC=97=85=20=EB=A1=9C=EC=A7=81=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 설정파일 백업 로직 작성 --- appspec.yml | 10 ++++++++++ scripts/backup.sh | 4 ++++ scripts/restore.sh | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 scripts/backup.sh create mode 100644 scripts/restore.sh diff --git a/appspec.yml b/appspec.yml index 735fba6e..37c70a45 100644 --- a/appspec.yml +++ b/appspec.yml @@ -33,6 +33,11 @@ permissions: - file hooks: + BeforeInstall: + - location: scripts/backup.sh + timeout: 60 + runas: ec2-user + ApplicationStop: - location: scripts/stop.sh timeout: 60 @@ -42,3 +47,8 @@ hooks: - location: scripts/deploy.sh timeout: 600 runas: ec2-user + + AfterInstall: + - location: scripts/restore.sh + timeout: 60 + runas: ec2-user diff --git a/scripts/backup.sh b/scripts/backup.sh new file mode 100644 index 00000000..143a569e --- /dev/null +++ b/scripts/backup.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +mkdir -p /home/ec2-user/cicd/backup +cp /home/ec2-user/cicd/src/main/resources/application-prod.yml /home/ec2-user/cicd/backup/ diff --git a/scripts/restore.sh b/scripts/restore.sh new file mode 100644 index 00000000..3e6652a8 --- /dev/null +++ b/scripts/restore.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +if [ -f /home/ec2-user/cicd/backup/application-prod.yml ]; then + cp /home/ec2-user/cicd/backup/application-prod.yml /home/ec2-user/cicd/src/main/resources/application-prod.yml +fi From 66504746a844be1ce266968dc8b091ee6a4a0c3c Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 23:36:09 +0900 Subject: [PATCH 21/59] =?UTF-8?q?[ci]=20targets=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 수정 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index 5a067c96..abb0d618 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] + - targets: ['app1:8080', 'app2:8080', 'app3:8080'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 9782df8f6f9de50730644238a432f21621f4f3d3 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 19 Jun 2024 23:40:46 +0900 Subject: [PATCH 22/59] =?UTF-8?q?[ci]=20targets=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit targets 수정 --- prometheus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus.yml b/prometheus.yml index abb0d618..5a067c96 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -8,7 +8,7 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + - targets: ['host.docker.internal:8081', 'host.docker.internal:8082', 'host.docker.internal:8083'] metrics_path: '/actuator/prometheus' - job_name: 'mysql' From 055023e7f38df5492e892549a5c6cd3591545588 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Thu, 20 Jun 2024 19:06:13 +0900 Subject: [PATCH 23/59] =?UTF-8?q?[ci]=20loki=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 세팅 --- docker-compose.yml | 18 ++++++++++++++++ loki-config.yml | 51 +++++++++++++++++++++++++++++++++++++++++++++ promtail-config.yml | 18 ++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 loki-config.yml create mode 100644 promtail-config.yml diff --git a/docker-compose.yml b/docker-compose.yml index 425ad8f8..8a219b46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,6 +107,24 @@ services: volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf + loki: + image: grafana/loki:latest + container_name: loki + restart: always + ports: + - "3100:3100" + volumes: + - ./loki-config.yml:/etc/loki/local-config.yaml + + promtail: + image: grafana/promtail:latest + container_name: promtail + restart: always + volumes: + - /var/log:/var/log + - ./promtail-config.yml:/etc/promtail/config.yml + command: -config.file=/etc/promtail/config.yml + volumes: grafana-storage: prometheus-data: diff --git a/loki-config.yml b/loki-config.yml new file mode 100644 index 00000000..fe966212 --- /dev/null +++ b/loki-config.yml @@ -0,0 +1,51 @@ +auth_enabled: false + +server: + http_listen_port: 3100 + grpc_listen_port: 9095 + +common: + instance_addr: 127.0.0.1 + path_prefix: /tmp/loki + storage: + filesystem: + chunks_directory: /tmp/loki/chunks + rules_directory: /tmp/loki/rules + replication_factor: 1 + ring: + kvstore: + store: inmemory + +schema_config: + configs: + - from: 2020-10-24 + store: boltdb-shipper + object_store: filesystem + schema: v11 + index: + prefix: index_ + period: 24h + +storage_config: + boltdb_shipper: + active_index_directory: /tmp/loki/index + cache_location: /tmp/loki/boltdb-cache + shared_store: filesystem + filesystem: + directory: /tmp/loki/chunks + +compactor: + working_directory: /tmp/loki/compactor + shared_store: filesystem + +limits_config: + enforce_metric_name: false + reject_old_samples: true + reject_old_samples_max_age: 168h + +chunk_store_config: + max_look_back_period: 0s + +table_manager: + retention_deletes_enabled: true + retention_period: 168h diff --git a/promtail-config.yml b/promtail-config.yml new file mode 100644 index 00000000..0fceee85 --- /dev/null +++ b/promtail-config.yml @@ -0,0 +1,18 @@ +server: + http_listen_port: 9080 + grpc_listen_port: 0 + +positions: + filename: /tmp/positions.yaml + +clients: + - url: http://loki:3100/loki/api/v1/push + +scrape_configs: + - job_name: system + static_configs: + - targets: + - localhost + labels: + job: varlogs + __path__: /var/log/*log \ No newline at end of file From 3e3d5b225d019ce95ca5b4b2bb0f61392f9ebab9 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Thu, 20 Jun 2024 19:29:27 +0900 Subject: [PATCH 24/59] =?UTF-8?q?[ci]=20loki=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 세팅 --- loki-config.yml | 37 ++++++++++++++++--------------------- promtail-config.yml | 9 ++++++++- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/loki-config.yml b/loki-config.yml index fe966212..e1ff4290 100644 --- a/loki-config.yml +++ b/loki-config.yml @@ -2,19 +2,18 @@ auth_enabled: false server: http_listen_port: 3100 - grpc_listen_port: 9095 -common: - instance_addr: 127.0.0.1 - path_prefix: /tmp/loki - storage: - filesystem: - chunks_directory: /tmp/loki/chunks - rules_directory: /tmp/loki/rules - replication_factor: 1 - ring: - kvstore: - store: inmemory +ingester: + lifecycler: + address: 127.0.0.1 + ring: + kvstore: + store: inmemory + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 5m + chunk_retain_period: 30s + max_transfer_retries: 0 schema_config: configs: @@ -28,15 +27,11 @@ schema_config: storage_config: boltdb_shipper: - active_index_directory: /tmp/loki/index - cache_location: /tmp/loki/boltdb-cache + active_index_directory: /loki/index + cache_location: /loki/boltdb-cache shared_store: filesystem filesystem: - directory: /tmp/loki/chunks - -compactor: - working_directory: /tmp/loki/compactor - shared_store: filesystem + directory: /loki/chunks limits_config: enforce_metric_name: false @@ -47,5 +42,5 @@ chunk_store_config: max_look_back_period: 0s table_manager: - retention_deletes_enabled: true - retention_period: 168h + retention_deletes_enabled: false + retention_period: 0s diff --git a/promtail-config.yml b/promtail-config.yml index 0fceee85..fe50e91f 100644 --- a/promtail-config.yml +++ b/promtail-config.yml @@ -15,4 +15,11 @@ scrape_configs: - localhost labels: job: varlogs - __path__: /var/log/*log \ No newline at end of file + __path__: /var/log/*log + - job_name: applications + static_configs: + - targets: + - localhost + labels: + job: applications + __path__: /path/to/your/application/logs/*.log From ea3110d891229cad764f86cb3192ff8b34ad4654 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Thu, 20 Jun 2024 19:57:40 +0900 Subject: [PATCH 25/59] =?UTF-8?q?[ci]=20loki=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 세팅 --- loki-config.yml | 36 +++++++++++++++--------------------- promtail-config.yml | 6 +++--- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/loki-config.yml b/loki-config.yml index e1ff4290..065a7898 100644 --- a/loki-config.yml +++ b/loki-config.yml @@ -2,22 +2,19 @@ auth_enabled: false server: http_listen_port: 3100 + log_level: info -ingester: - lifecycler: - address: 127.0.0.1 - ring: - kvstore: - store: inmemory - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 5m - chunk_retain_period: 30s - max_transfer_retries: 0 +common: + path_prefix: /loki + storage: + filesystem: + chunks_directory: /loki/chunks + rules_directory: /loki/rules + replication_factor: 1 schema_config: configs: - - from: 2020-10-24 + - from: 2022-01-01 store: boltdb-shipper object_store: filesystem schema: v11 @@ -28,19 +25,16 @@ schema_config: storage_config: boltdb_shipper: active_index_directory: /loki/index - cache_location: /loki/boltdb-cache shared_store: filesystem + cache_location: /loki/cache filesystem: directory: /loki/chunks +compactor: + working_directory: /loki/compactor + shared_store: filesystem + limits_config: enforce_metric_name: false reject_old_samples: true - reject_old_samples_max_age: 168h - -chunk_store_config: - max_look_back_period: 0s - -table_manager: - retention_deletes_enabled: false - retention_period: 0s + reject_old_samples_max_age: 168h \ No newline at end of file diff --git a/promtail-config.yml b/promtail-config.yml index fe50e91f..3025bbc1 100644 --- a/promtail-config.yml +++ b/promtail-config.yml @@ -1,6 +1,5 @@ server: http_listen_port: 9080 - grpc_listen_port: 0 positions: filename: /tmp/positions.yaml @@ -16,10 +15,11 @@ scrape_configs: labels: job: varlogs __path__: /var/log/*log + - job_name: applications static_configs: - targets: - localhost labels: - job: applications - __path__: /path/to/your/application/logs/*.log + job: applogs + __path__: /path/to/your/application/logs/*.log \ No newline at end of file From b3f71c2d07179cd8706c0de094eb1a9afb42b696 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Thu, 20 Jun 2024 23:43:05 +0900 Subject: [PATCH 26/59] =?UTF-8?q?[ci]=20loki=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 세팅 --- loki-config.yml | 27 ++++++++++++++++++++------- promtail-config.yml | 4 +++- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/loki-config.yml b/loki-config.yml index 065a7898..04ce72c5 100644 --- a/loki-config.yml +++ b/loki-config.yml @@ -27,14 +27,27 @@ storage_config: active_index_directory: /loki/index shared_store: filesystem cache_location: /loki/cache - filesystem: - directory: /loki/chunks - -compactor: - working_directory: /loki/compactor - shared_store: filesystem limits_config: enforce_metric_name: false reject_old_samples: true - reject_old_samples_max_age: 168h \ No newline at end of file + reject_old_samples_max_age: 168h + +chunk_store_config: + max_look_back_period: 0s + +table_manager: + retention_deletes_enabled: true + retention_period: 168h + +ingester: + lifecycler: + ring: + kvstore: + store: inmemory + replication_factor: 1 + final_sleep: 0s + chunk_idle_period: 15m + chunk_block_size: 262144 + chunk_retain_period: 1m + max_transfer_retries: 0 diff --git a/promtail-config.yml b/promtail-config.yml index 3025bbc1..90420faa 100644 --- a/promtail-config.yml +++ b/promtail-config.yml @@ -14,6 +14,7 @@ scrape_configs: - localhost labels: job: varlogs + host: ${HOSTNAME} __path__: /var/log/*log - job_name: applications @@ -22,4 +23,5 @@ scrape_configs: - localhost labels: job: applogs - __path__: /path/to/your/application/logs/*.log \ No newline at end of file + host: ${HOSTNAME} + __path__: /path/to/your/application/logs/*.log From 2c03621844a9575119dacc0a6cebeaf68cdbfff8 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Fri, 21 Jun 2024 00:36:43 +0900 Subject: [PATCH 27/59] =?UTF-8?q?[ci]=20loki=20=EC=84=B8=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 세팅 --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8a219b46..55123fc8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -124,7 +124,8 @@ services: - /var/log:/var/log - ./promtail-config.yml:/etc/promtail/config.yml command: -config.file=/etc/promtail/config.yml - + environment: + - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: From 3ffebbb30cd83aa1ce5185af1a28e6a0c9a86113 Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Fri, 28 Jun 2024 10:48:33 +0900 Subject: [PATCH 28/59] =?UTF-8?q?[HOTFIX]=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=91=EB=8B=B5=20Body=EC=97=90=20=EB=A6=AC?= =?UTF-8?q?=ED=94=84=EB=A0=88=EC=8B=9C=20=ED=86=A0=ED=81=B0=EC=9D=84=20?= =?UTF-8?q?=EB=8B=B4=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/member/controller/OAuthController.java | 7 ++++--- .../{OAuthLoginResponse.java => OAuthLoginResult.java} | 6 +++--- .../domain/member/service/oauth/OAuthService.java | 6 +++--- .../domain/member/service/OAuthServiceTest.java | 10 +++++----- 4 files changed, 15 insertions(+), 14 deletions(-) rename src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/{OAuthLoginResponse.java => OAuthLoginResult.java} (60%) diff --git a/src/main/java/org/kakaoshare/backend/domain/member/controller/OAuthController.java b/src/main/java/org/kakaoshare/backend/domain/member/controller/OAuthController.java index f38b0138..7f6a6b21 100644 --- a/src/main/java/org/kakaoshare/backend/domain/member/controller/OAuthController.java +++ b/src/main/java/org/kakaoshare/backend/domain/member/controller/OAuthController.java @@ -4,6 +4,7 @@ import lombok.RequiredArgsConstructor; import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginRequest; import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResponse; +import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResult; import org.kakaoshare.backend.domain.member.dto.oauth.issue.OAuthReissueRequest; import org.kakaoshare.backend.domain.member.dto.oauth.issue.ReissueResponse; import org.kakaoshare.backend.domain.member.dto.oauth.issue.ReissueResult; @@ -29,11 +30,11 @@ public class OAuthController { @PostMapping("/login") public ResponseEntity login(@RequestBody @Valid final OAuthLoginRequest oAuthLoginRequest) { - final OAuthLoginResponse loginResponse = oAuthService.login(oAuthLoginRequest); - final ResponseCookie cookie = refreshTokenCookieProvider.createCookie(loginResponse.refreshToken()); + final OAuthLoginResult oAuthLoginResult = oAuthService.login(oAuthLoginRequest); + final ResponseCookie cookie = refreshTokenCookieProvider.createCookie(oAuthLoginResult.refreshToken()); return ResponseEntity.ok() .header(HttpHeaders.SET_COOKIE, cookie.toString()) - .body(loginResponse); + .body(OAuthLoginResponse.from(oAuthLoginResult)); } @PostMapping("/logout") diff --git a/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResult.java similarity index 60% rename from src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java rename to src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResult.java index 8a5e1052..360b3c15 100644 --- a/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java +++ b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResult.java @@ -6,10 +6,10 @@ import org.kakaoshare.backend.domain.member.entity.token.RefreshToken; @Builder -public record OAuthLoginResponse(String accessToken, RefreshTokenDto refreshToken, OAuthLoginMemberResponse member) { - public static OAuthLoginResponse of(final String accessToken, +public record OAuthLoginResult(String accessToken, RefreshTokenDto refreshToken, OAuthLoginMemberResponse member) { + public static OAuthLoginResult of(final String accessToken, final RefreshToken refreshToken, final OAuthProfile oAuthProfile) { - return new OAuthLoginResponse(accessToken, RefreshTokenDto.from(refreshToken), OAuthLoginMemberResponse.from(oAuthProfile)); + return new OAuthLoginResult(accessToken, RefreshTokenDto.from(refreshToken), OAuthLoginMemberResponse.from(oAuthProfile)); } } \ No newline at end of file diff --git a/src/main/java/org/kakaoshare/backend/domain/member/service/oauth/OAuthService.java b/src/main/java/org/kakaoshare/backend/domain/member/service/oauth/OAuthService.java index 924ddbd6..83810836 100644 --- a/src/main/java/org/kakaoshare/backend/domain/member/service/oauth/OAuthService.java +++ b/src/main/java/org/kakaoshare/backend/domain/member/service/oauth/OAuthService.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginRequest; -import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResponse; +import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResult; import org.kakaoshare.backend.domain.member.dto.oauth.issue.OAuthReissueRequest; import org.kakaoshare.backend.domain.member.dto.oauth.issue.OAuthReissueResponse; import org.kakaoshare.backend.domain.member.dto.oauth.issue.ReissueResult; @@ -42,7 +42,7 @@ public class OAuthService { private final OAuthWebClientService webClientService; @Transactional - public OAuthLoginResponse login(final OAuthLoginRequest oAuthLoginRequest) { + public OAuthLoginResult login(final OAuthLoginRequest oAuthLoginRequest) { final ClientRegistration registration = clientRegistrationRepository.findByRegistrationId(oAuthLoginRequest.provider()); final OAuthProfile oAuthProfile = getProfile(oAuthLoginRequest, registration); final UserDetails userDetails = addOrFindByProfile(oAuthProfile); @@ -50,7 +50,7 @@ public OAuthLoginResponse login(final OAuthLoginRequest oAuthLoginRequest) { final RefreshToken refreshToken = refreshTokenProvider.createToken(userDetails.getUsername()); refreshTokenRepository.save(refreshToken); - return OAuthLoginResponse.of(accessToken, refreshToken, oAuthProfile); + return OAuthLoginResult.of(accessToken, refreshToken, oAuthProfile); } @Transactional diff --git a/src/test/java/org/kakaoshare/backend/domain/member/service/OAuthServiceTest.java b/src/test/java/org/kakaoshare/backend/domain/member/service/OAuthServiceTest.java index b2f37869..2cb0ed66 100644 --- a/src/test/java/org/kakaoshare/backend/domain/member/service/OAuthServiceTest.java +++ b/src/test/java/org/kakaoshare/backend/domain/member/service/OAuthServiceTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginRequest; -import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResponse; +import org.kakaoshare.backend.domain.member.dto.oauth.authenticate.OAuthLoginResult; import org.kakaoshare.backend.domain.member.dto.oauth.issue.OAuthReissueRequest; import org.kakaoshare.backend.domain.member.dto.oauth.issue.OAuthReissueResponse; import org.kakaoshare.backend.domain.member.dto.oauth.issue.ReissueResult; @@ -101,8 +101,8 @@ public void authenticateWhenNewMember() throws Exception { doReturn(refreshToken).when(refreshTokenProvider).createToken(userDetails.getUsername()); doReturn(refreshToken).when(refreshTokenRepository).save(any()); - final OAuthLoginResponse expect = OAuthLoginResponse.of(accessToken, refreshToken, oAuthProfile); - final OAuthLoginResponse actual = oAuthService.login(request); + final OAuthLoginResult expect = OAuthLoginResult.of(accessToken, refreshToken, oAuthProfile); + final OAuthLoginResult actual = oAuthService.login(request); assertThat(expect).isEqualTo(actual); } @@ -122,8 +122,8 @@ public void authenticateWhenExistingMember() throws Exception { doReturn(refreshToken).when(refreshTokenProvider).createToken(userDetails.getUsername()); doReturn(refreshToken).when(refreshTokenRepository).save(any()); - final OAuthLoginResponse expect = OAuthLoginResponse.of(accessToken, refreshToken, oAuthProfile); - final OAuthLoginResponse actual = oAuthService.login(request); + final OAuthLoginResult expect = OAuthLoginResult.of(accessToken, refreshToken, oAuthProfile); + final OAuthLoginResult actual = oAuthService.login(request); assertThat(expect).isEqualTo(actual); } From 64953a40c9bf9338d0e6b1e4f6d32f6cb595ccdb Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Fri, 28 Jun 2024 10:54:25 +0900 Subject: [PATCH 29/59] =?UTF-8?q?[HOTFIX]=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EC=8B=9C=20=EC=9D=91=EB=8B=B5=20Body=EC=97=90=20=EB=A6=AC?= =?UTF-8?q?=ED=94=84=EB=A0=88=EC=8B=9C=20=ED=86=A0=ED=81=B0=EC=9D=84=20?= =?UTF-8?q?=EB=8B=B4=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/dto/oauth/authenticate/OAuthLoginResponse.java | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java diff --git a/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java new file mode 100644 index 00000000..b7744f8d --- /dev/null +++ b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginResponse.java @@ -0,0 +1,7 @@ +package org.kakaoshare.backend.domain.member.dto.oauth.authenticate; + +public record OAuthLoginResponse(String accessToken, OAuthLoginMemberResponse member) { + public static OAuthLoginResponse from(final OAuthLoginResult oAuthLoginResult) { + return new OAuthLoginResponse(oAuthLoginResult.accessToken(), oAuthLoginResult.member()); + } +} From ea83b35ad0addf0b07202084598870c3b37d0af1 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Fri, 28 Jun 2024 16:18:04 +0900 Subject: [PATCH 30/59] =?UTF-8?q?[ci]=20loki=20=EC=A3=BC=EC=84=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit loki 주석 --- docker-compose.yml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 55123fc8..c927b627 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,25 +107,25 @@ services: volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - loki: - image: grafana/loki:latest - container_name: loki - restart: always - ports: - - "3100:3100" - volumes: - - ./loki-config.yml:/etc/loki/local-config.yaml - - promtail: - image: grafana/promtail:latest - container_name: promtail - restart: always - volumes: - - /var/log:/var/log - - ./promtail-config.yml:/etc/promtail/config.yml - command: -config.file=/etc/promtail/config.yml - environment: - - HOSTNAME=promtail +# loki: +# image: grafana/loki:latest +# container_name: loki +# restart: always +# ports: +# - "3100:3100" +# volumes: +# - ./loki-config.yml:/etc/loki/local-config.yaml +# +# promtail: +# image: grafana/promtail:latest +# container_name: promtail +# restart: always +# volumes: +# - /var/log:/var/log +# - ./promtail-config.yml:/etc/promtail/config.yml +# command: -config.file=/etc/promtail/config.yml +# environment: +# - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: From 289a66e9402a4a49a419c7b9060826dad10d4f45 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Fri, 28 Jun 2024 19:03:10 +0900 Subject: [PATCH 31/59] =?UTF-8?q?[ci]=20=EC=A3=BC=EC=84=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 주석 수정 --- .github/workflows/build-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 6817cd44..5d1edbf8 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -3,7 +3,7 @@ run-name: Running on: push: branches: - - deploy # deploy 브런치로 푸쉬했을 때 실행 + - deploy pull_request: branches: - deploy From 6c90f4b44d1647f9f58675fd5191ce39383a8f06 Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Sat, 29 Jun 2024 23:28:43 +0900 Subject: [PATCH 32/59] =?UTF-8?q?[refactor]=EB=93=A4=EC=97=AC=EC=93=B0?= =?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member/dto/oauth/authenticate/OAuthLoginRequest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginRequest.java b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginRequest.java index f8858d59..dac5dcec 100644 --- a/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginRequest.java +++ b/src/main/java/org/kakaoshare/backend/domain/member/dto/oauth/authenticate/OAuthLoginRequest.java @@ -5,4 +5,5 @@ public record OAuthLoginRequest( @NotNull(message = "소셜 이름은 필수입니다.") String provider, @NotNull(message = "소셜 리프레시 토큰은 필수입니다.") String socialAccessToken -) {} \ No newline at end of file +) { +} \ No newline at end of file From d29ae20ed9dda6a72b128cdecf9c577b32fa6017 Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Sat, 29 Jun 2024 23:52:15 +0900 Subject: [PATCH 33/59] =?UTF-8?q?[cicd]nginx=20=ED=94=84=EB=A1=9D=EC=8B=9C?= =?UTF-8?q?=20=EB=B2=84=ED=8D=BC=20=ED=99=95=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nginx.conf b/nginx.conf index 2b86cee7..b8f9c3cb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -49,6 +49,11 @@ http { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + + # 프록시 버퍼 확장 + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; } location = /favicon.ico { return 204; From 5279e2c8a1e2cc5d5701f90f94bdd26c4026dbe0 Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Sun, 30 Jun 2024 00:54:08 +0900 Subject: [PATCH 34/59] =?UTF-8?q?[refactor]=EC=97=91=EC=84=B8=EC=8A=A4=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20=EB=A7=8C=EB=A3=8C=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=9D=84=2010=EC=B4=88=EB=A1=9C=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 73575b75..39cd0750 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -65,7 +65,7 @@ spring: security: token: access: - expire-time: 3600000 + expire-time: 10000 refresh: expire-time: 86400000 friend: From 1b842e845c82a6e52278e8bdf034f35b705473de Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Sun, 30 Jun 2024 01:45:21 +0900 Subject: [PATCH 35/59] =?UTF-8?q?[refactor]=EC=97=91=EC=84=B8=EC=8A=A4=20?= =?UTF-8?q?=ED=86=A0=ED=81=B0=20=EB=A7=8C=EB=A3=8C=EC=8B=9C=EA=B0=84?= =?UTF-8?q?=EC=9D=84=201=EC=8B=9C=EA=B0=84=EC=9C=BC=EB=A1=9C=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 39cd0750..73575b75 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -65,7 +65,7 @@ spring: security: token: access: - expire-time: 10000 + expire-time: 3600000 refresh: expire-time: 86400000 friend: From 13b878e97a85b270160730ab2c199af59d19add7 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 1 Jul 2024 17:21:03 +0900 Subject: [PATCH 36/59] =?UTF-8?q?[ci]=20prometheus=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=9C=A0=EC=A7=80=20=EA=B8=B0=EA=B0=84=201?= =?UTF-8?q?=EC=A3=BC=EC=9D=BC=EB=A1=9C=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus 데이터 유지 기간 1주일로 지정 --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index c927b627..3a72da2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,6 +84,8 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" + command: + - '--storage.tsdb.retention.time=168h' grafana: image: grafana/grafana From 2c1f915d73ee3addbe81936d88861c96eb7f7e81 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Mon, 1 Jul 2024 19:17:04 +0900 Subject: [PATCH 37/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 3a72da2b..f4c32751 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -85,7 +85,9 @@ services: extra_hosts: - "host.docker.internal:host-gateway" command: + - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.retention.time=168h' + - '--storage.tsdb.path=/prometheus' grafana: image: grafana/grafana From bf36da752aeab5c21cdc8c4c502677836b903236 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 14:30:09 +0900 Subject: [PATCH 38/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f4c32751..4d34fe2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: - /home/ec2-user/application-prod.yml:/config/application-prod.yml environment: - TZ=Asia/Seoul - - spring.application.name=app3 + - spring.application.name=app1 redis: container_name: redis @@ -85,10 +85,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.retention.time=168h' - - '--storage.tsdb.path=/prometheus' - + - --storage.tsdb.retention.time=14d grafana: image: grafana/grafana container_name: grafana @@ -111,26 +108,7 @@ services: volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf -# loki: -# image: grafana/loki:latest -# container_name: loki -# restart: always -# ports: -# - "3100:3100" -# volumes: -# - ./loki-config.yml:/etc/loki/local-config.yaml -# -# promtail: -# image: grafana/promtail:latest -# container_name: promtail -# restart: always -# volumes: -# - /var/log:/var/log -# - ./promtail-config.yml:/etc/promtail/config.yml -# command: -config.file=/etc/promtail/config.yml -# environment: -# - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: - redis-data: \ No newline at end of file + redis-data: From 26a45ed5fab9253683a83d3e9d2da0f5a7340701 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 14:42:25 +0900 Subject: [PATCH 39/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 4d34fe2e..869af4a3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -82,6 +82,8 @@ services: - prometheus-data:/prometheus ports: - "9090:9090" + networks: + - monitoring extra_hosts: - "host.docker.internal:host-gateway" command: @@ -92,6 +94,8 @@ services: restart: always ports: - "3009:3000" + networks: + - monitoring environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: @@ -105,6 +109,8 @@ services: - "--config.my-cnf=/etc/mysql/my.cnf" ports: - "9104:9104" + networks: + - monitoring volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf From 9df070d98c8d405d87bcbd45b39e5037bd5e1b39 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 14:53:18 +0900 Subject: [PATCH 40/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 869af4a3..83f847c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,7 +62,7 @@ services: - /home/ec2-user/application-prod.yml:/config/application-prod.yml environment: - TZ=Asia/Seoul - - spring.application.name=app1 + - spring.application.name=app3 redis: container_name: redis @@ -82,20 +82,18 @@ services: - prometheus-data:/prometheus ports: - "9090:9090" - networks: - - monitoring extra_hosts: - "host.docker.internal:host-gateway" command: - - --storage.tsdb.retention.time=14d + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.retention.time=168h' + grafana: image: grafana/grafana container_name: grafana restart: always ports: - "3009:3000" - networks: - - monitoring environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: @@ -109,12 +107,29 @@ services: - "--config.my-cnf=/etc/mysql/my.cnf" ports: - "9104:9104" - networks: - - monitoring volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf +# loki: +# image: grafana/loki:latest +# container_name: loki +# restart: always +# ports: +# - "3100:3100" +# volumes: +# - ./loki-config.yml:/etc/loki/local-config.yaml +# +# promtail: +# image: grafana/promtail:latest +# container_name: promtail +# restart: always +# volumes: +# - /var/log:/var/log +# - ./promtail-config.yml:/etc/promtail/config.yml +# command: -config.file=/etc/promtail/config.yml +# environment: +# - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: - redis-data: + redis-data: \ No newline at end of file From 22202b1df383573c1b3f9162e6eae4cb1c727ed2 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 15:02:32 +0900 Subject: [PATCH 41/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 83f847c2..292c0eff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,9 +84,6 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.retention.time=168h' grafana: image: grafana/grafana @@ -111,24 +108,22 @@ services: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf # loki: -# image: grafana/loki:latest +# image: grafana/loki:2.3.0 # container_name: loki -# restart: always # ports: # - "3100:3100" # volumes: # - ./loki-config.yml:/etc/loki/local-config.yaml +# command: -config.file=/etc/loki/local-config.yaml # # promtail: -# image: grafana/promtail:latest +# image: grafana/promtail:2.3.0 # container_name: promtail -# restart: always # volumes: # - /var/log:/var/log -# - ./promtail-config.yml:/etc/promtail/config.yml -# command: -config.file=/etc/promtail/config.yml -# environment: -# - HOSTNAME=promtail +# - ./promtail-config.yml:/etc/promtail/promtail-config.yml +# command: -config.file=/etc/promtail/promtail-config.yml + volumes: grafana-storage: prometheus-data: From 88293ab345d77e08daf76460b35b5a0fa5817854 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 15:21:10 +0900 Subject: [PATCH 42/59] =?UTF-8?q?[ci]=20prometheus=20config=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prometheus config 수정 --- docker-compose.yml | 48 ++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 292c0eff..b02717a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,8 @@ services: - app3 - prometheus - grafana + networks: + - server-network app1: image: "yeachan05/application:latest" @@ -32,9 +34,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - environment: - - TZ=Asia/Seoul - - spring.application.name=app1 + networks: + - server-network app2: image: "yeachan05/application:latest" @@ -46,9 +47,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - environment: - - TZ=Asia/Seoul - - spring.application.name=app2 + networks: + - server-network app3: image: "yeachan05/application:latest" @@ -60,9 +60,8 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - environment: - - TZ=Asia/Seoul - - spring.application.name=app3 + networks: + - server-network redis: container_name: redis @@ -72,6 +71,8 @@ services: - "6379:6379" volumes: - redis-data:/data + networks: + - server-network prometheus: image: prom/prometheus @@ -84,6 +85,8 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" + networks: + - server-network grafana: image: grafana/grafana @@ -95,6 +98,8 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - grafana-storage:/var/lib/grafana + networks: + - server-network mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -106,25 +111,14 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - -# loki: -# image: grafana/loki:2.3.0 -# container_name: loki -# ports: -# - "3100:3100" -# volumes: -# - ./loki-config.yml:/etc/loki/local-config.yaml -# command: -config.file=/etc/loki/local-config.yaml -# -# promtail: -# image: grafana/promtail:2.3.0 -# container_name: promtail -# volumes: -# - /var/log:/var/log -# - ./promtail-config.yml:/etc/promtail/promtail-config.yml -# command: -config.file=/etc/promtail/promtail-config.yml + networks: + - server-network volumes: grafana-storage: prometheus-data: - redis-data: \ No newline at end of file + redis-data: + +networks: + server-network: + driver: bridge From 741ff59f79f93cfb3a38364ce568e6eb622b3904 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 15:28:19 +0900 Subject: [PATCH 43/59] =?UTF-8?q?[ci]=20docker=20network=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker network 수정 --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index b02717a1..0e9d0fe8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -122,3 +122,4 @@ volumes: networks: server-network: driver: bridge + external: true \ No newline at end of file From 6cf77d4a41961cfac6246a947aff1063c8570bb5 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 17:10:45 +0900 Subject: [PATCH 44/59] =?UTF-8?q?[ci]=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 스크립트 수정 --- scripts/deploy.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 2f3142e8..acadc9d3 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -11,13 +11,23 @@ touch $START_LOG echo "[$(date +%c)] Docker Compose 실행 시작 - 이미지: $IMAGE_NAME:$IMAGE_TAG" >> $START_LOG -docker-compose -f $DOCKER_COMPOSE_PATH pull -docker-compose -f $DOCKER_COMPOSE_PATH up -d +# docker-compose pull 로그 기록 +echo "[$(date +%c)] docker-compose pull 시작" >> $START_LOG +docker-compose -f $DOCKER_COMPOSE_PATH pull >> $START_LOG 2>&1 + +# docker-compose up 로그 기록 +echo "[$(date +%c)] docker-compose up 시작" >> $START_LOG +docker-compose -f $DOCKER_COMPOSE_PATH up -d >> $START_LOG 2>&1 if [ $? -eq 0 ]; then echo "[$(date +%c)] Docker Compose로 애플리케이션 시작 성공" >> $START_LOG else + # shellcheck disable=SC2129 echo "[$(date +%c)] Docker Compose로 애플리케이션 시작 실패" >> $START_LOG echo "[$(date +%c)] Docker Compose 오류 로그:" >> $START_LOG docker-compose -f $DOCKER_COMPOSE_PATH logs >> $START_LOG 2>&1 fi + +# 전체 로그를 기록 +echo "[$(date +%c)] 전체 Docker Compose 로그:" >> $START_LOG +docker-compose -f $DOCKER_COMPOSE_PATH logs >> $START_LOG 2>&1 From 6237bf645f59b14c2c08890c0e8826c9a7059e2c Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 17:44:32 +0900 Subject: [PATCH 45/59] =?UTF-8?q?[ci]=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 스크립트 수정 --- docker-compose.yml | 55 +++++++++++++++++++++++++++------------------- scripts/deploy.sh | 14 ++---------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0e9d0fe8..f4c32751 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,8 +21,6 @@ services: - app3 - prometheus - grafana - networks: - - server-network app1: image: "yeachan05/application:latest" @@ -34,8 +32,9 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network + environment: + - TZ=Asia/Seoul + - spring.application.name=app1 app2: image: "yeachan05/application:latest" @@ -47,8 +46,9 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network + environment: + - TZ=Asia/Seoul + - spring.application.name=app2 app3: image: "yeachan05/application:latest" @@ -60,8 +60,9 @@ services: - redis volumes: - /home/ec2-user/application-prod.yml:/config/application-prod.yml - networks: - - server-network + environment: + - TZ=Asia/Seoul + - spring.application.name=app3 redis: container_name: redis @@ -71,8 +72,6 @@ services: - "6379:6379" volumes: - redis-data:/data - networks: - - server-network prometheus: image: prom/prometheus @@ -85,8 +84,10 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" - networks: - - server-network + command: + - '--config.file=/etc/prometheus/prometheus.yml' + - '--storage.tsdb.retention.time=168h' + - '--storage.tsdb.path=/prometheus' grafana: image: grafana/grafana @@ -98,8 +99,6 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - grafana-storage:/var/lib/grafana - networks: - - server-network mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -111,15 +110,27 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - networks: - - server-network +# loki: +# image: grafana/loki:latest +# container_name: loki +# restart: always +# ports: +# - "3100:3100" +# volumes: +# - ./loki-config.yml:/etc/loki/local-config.yaml +# +# promtail: +# image: grafana/promtail:latest +# container_name: promtail +# restart: always +# volumes: +# - /var/log:/var/log +# - ./promtail-config.yml:/etc/promtail/config.yml +# command: -config.file=/etc/promtail/config.yml +# environment: +# - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: - redis-data: - -networks: - server-network: - driver: bridge - external: true \ No newline at end of file + redis-data: \ No newline at end of file diff --git a/scripts/deploy.sh b/scripts/deploy.sh index acadc9d3..2f3142e8 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -11,23 +11,13 @@ touch $START_LOG echo "[$(date +%c)] Docker Compose 실행 시작 - 이미지: $IMAGE_NAME:$IMAGE_TAG" >> $START_LOG -# docker-compose pull 로그 기록 -echo "[$(date +%c)] docker-compose pull 시작" >> $START_LOG -docker-compose -f $DOCKER_COMPOSE_PATH pull >> $START_LOG 2>&1 - -# docker-compose up 로그 기록 -echo "[$(date +%c)] docker-compose up 시작" >> $START_LOG -docker-compose -f $DOCKER_COMPOSE_PATH up -d >> $START_LOG 2>&1 +docker-compose -f $DOCKER_COMPOSE_PATH pull +docker-compose -f $DOCKER_COMPOSE_PATH up -d if [ $? -eq 0 ]; then echo "[$(date +%c)] Docker Compose로 애플리케이션 시작 성공" >> $START_LOG else - # shellcheck disable=SC2129 echo "[$(date +%c)] Docker Compose로 애플리케이션 시작 실패" >> $START_LOG echo "[$(date +%c)] Docker Compose 오류 로그:" >> $START_LOG docker-compose -f $DOCKER_COMPOSE_PATH logs >> $START_LOG 2>&1 fi - -# 전체 로그를 기록 -echo "[$(date +%c)] 전체 Docker Compose 로그:" >> $START_LOG -docker-compose -f $DOCKER_COMPOSE_PATH logs >> $START_LOG 2>&1 From 6e69bfa2068ee6af9cae3de301e2191052b0d469 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 18:17:28 +0900 Subject: [PATCH 46/59] =?UTF-8?q?[ci]=20docker=20network=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker network 수정 --- docker-compose.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f4c32751..fc5b4a6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -88,7 +88,8 @@ services: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.retention.time=168h' - '--storage.tsdb.path=/prometheus' - + networks: + - monitoring grafana: image: grafana/grafana container_name: grafana @@ -99,7 +100,8 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - grafana-storage:/var/lib/grafana - + networks: + - monitoring mysqld_exporter: image: quay.io/prometheus/mysqld-exporter container_name: mysqld-exporter @@ -110,7 +112,8 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - + networks: + - monitoring # loki: # image: grafana/loki:latest # container_name: loki @@ -133,4 +136,8 @@ services: volumes: grafana-storage: prometheus-data: - redis-data: \ No newline at end of file + redis-data: + +networks: + monitoring: + driver: bridge \ No newline at end of file From d0c803dba3d4810a112901da86053ec7c9ccee1a Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 18:45:10 +0900 Subject: [PATCH 47/59] =?UTF-8?q?[ci]=20nginx.conf=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nginx.conf 수정 --- nginx.conf | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/nginx.conf b/nginx.conf index b8f9c3cb..0139107b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -74,29 +74,29 @@ http { ssl_dhparam /etc/ssl/certs/ssl-dhparams.pem; } - server { - listen 9090; - - location / { - proxy_pass http://prometheus:9090; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } - - server { - listen 3009; - - location / { - proxy_pass http://grafana:3000; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } - } +# server { +# listen 9090; +# +# location / { +# proxy_pass http://prometheus:9090; +# proxy_set_header Host $host; +# proxy_set_header X-Real-IP $remote_addr; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# proxy_set_header X-Forwarded-Proto $scheme; +# } +# } +# +# server { +# listen 3009; +# +# location / { +# proxy_pass http://grafana:3000; +# proxy_set_header Host $host; +# proxy_set_header X-Real-IP $remote_addr; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# proxy_set_header X-Forwarded-Proto $scheme; +# } +# } server { if ($host = www.fundina.shop) { From e2662100d5aea7b17bb3b430a736db82718cd65f Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 18:51:19 +0900 Subject: [PATCH 48/59] =?UTF-8?q?[ci]=20nginx.conf=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nginx.conf 수정 --- docker-compose.yml | 3 ++- nginx.conf | 46 +++++++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fc5b4a6a..72312d4f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,9 +87,9 @@ services: command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.retention.time=168h' - - '--storage.tsdb.path=/prometheus' networks: - monitoring + grafana: image: grafana/grafana container_name: grafana @@ -102,6 +102,7 @@ services: - grafana-storage:/var/lib/grafana networks: - monitoring + mysqld_exporter: image: quay.io/prometheus/mysqld-exporter container_name: mysqld-exporter diff --git a/nginx.conf b/nginx.conf index 0139107b..b8f9c3cb 100644 --- a/nginx.conf +++ b/nginx.conf @@ -74,29 +74,29 @@ http { ssl_dhparam /etc/ssl/certs/ssl-dhparams.pem; } -# server { -# listen 9090; -# -# location / { -# proxy_pass http://prometheus:9090; -# proxy_set_header Host $host; -# proxy_set_header X-Real-IP $remote_addr; -# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -# proxy_set_header X-Forwarded-Proto $scheme; -# } -# } -# -# server { -# listen 3009; -# -# location / { -# proxy_pass http://grafana:3000; -# proxy_set_header Host $host; -# proxy_set_header X-Real-IP $remote_addr; -# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; -# proxy_set_header X-Forwarded-Proto $scheme; -# } -# } + server { + listen 9090; + + location / { + proxy_pass http://prometheus:9090; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } + + server { + listen 3009; + + location / { + proxy_pass http://grafana:3000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + } server { if ($host = www.fundina.shop) { From f675a4e040216c056a8ef77d30aa288da6fdfabd Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Tue, 2 Jul 2024 19:06:14 +0900 Subject: [PATCH 49/59] =?UTF-8?q?[ci]=20nginx.conf=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nginx.conf 수정 --- docker-compose.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 72312d4f..c927b627 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,11 +84,6 @@ services: - "9090:9090" extra_hosts: - "host.docker.internal:host-gateway" - command: - - '--config.file=/etc/prometheus/prometheus.yml' - - '--storage.tsdb.retention.time=168h' - networks: - - monitoring grafana: image: grafana/grafana @@ -100,8 +95,6 @@ services: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - grafana-storage:/var/lib/grafana - networks: - - monitoring mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -113,8 +106,7 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - networks: - - monitoring + # loki: # image: grafana/loki:latest # container_name: loki @@ -137,8 +129,4 @@ services: volumes: grafana-storage: prometheus-data: - redis-data: - -networks: - monitoring: - driver: bridge \ No newline at end of file + redis-data: \ No newline at end of file From fb812df7074d35f3dcc8e6fb290c36716c8e283a Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 15:41:28 +0900 Subject: [PATCH 50/59] =?UTF-8?q?[ci]=20grafana=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafana 설정 수정 --- docker-compose.yml | 23 ++------------------ loki-config.yml | 53 --------------------------------------------- promtail-config.yml | 27 ----------------------- 3 files changed, 2 insertions(+), 101 deletions(-) delete mode 100644 loki-config.yml delete mode 100644 promtail-config.yml diff --git a/docker-compose.yml b/docker-compose.yml index c927b627..e72adfd7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,12 +89,13 @@ services: image: grafana/grafana container_name: grafana restart: always + user: "$UID:$GID" ports: - "3009:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - - grafana-storage:/var/lib/grafana + - ./grafana-data:/var/lib/grafana mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -106,26 +107,6 @@ services: - "9104:9104" volumes: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf - -# loki: -# image: grafana/loki:latest -# container_name: loki -# restart: always -# ports: -# - "3100:3100" -# volumes: -# - ./loki-config.yml:/etc/loki/local-config.yaml -# -# promtail: -# image: grafana/promtail:latest -# container_name: promtail -# restart: always -# volumes: -# - /var/log:/var/log -# - ./promtail-config.yml:/etc/promtail/config.yml -# command: -config.file=/etc/promtail/config.yml -# environment: -# - HOSTNAME=promtail volumes: grafana-storage: prometheus-data: diff --git a/loki-config.yml b/loki-config.yml deleted file mode 100644 index 04ce72c5..00000000 --- a/loki-config.yml +++ /dev/null @@ -1,53 +0,0 @@ -auth_enabled: false - -server: - http_listen_port: 3100 - log_level: info - -common: - path_prefix: /loki - storage: - filesystem: - chunks_directory: /loki/chunks - rules_directory: /loki/rules - replication_factor: 1 - -schema_config: - configs: - - from: 2022-01-01 - store: boltdb-shipper - object_store: filesystem - schema: v11 - index: - prefix: index_ - period: 24h - -storage_config: - boltdb_shipper: - active_index_directory: /loki/index - shared_store: filesystem - cache_location: /loki/cache - -limits_config: - enforce_metric_name: false - reject_old_samples: true - reject_old_samples_max_age: 168h - -chunk_store_config: - max_look_back_period: 0s - -table_manager: - retention_deletes_enabled: true - retention_period: 168h - -ingester: - lifecycler: - ring: - kvstore: - store: inmemory - replication_factor: 1 - final_sleep: 0s - chunk_idle_period: 15m - chunk_block_size: 262144 - chunk_retain_period: 1m - max_transfer_retries: 0 diff --git a/promtail-config.yml b/promtail-config.yml deleted file mode 100644 index 90420faa..00000000 --- a/promtail-config.yml +++ /dev/null @@ -1,27 +0,0 @@ -server: - http_listen_port: 9080 - -positions: - filename: /tmp/positions.yaml - -clients: - - url: http://loki:3100/loki/api/v1/push - -scrape_configs: - - job_name: system - static_configs: - - targets: - - localhost - labels: - job: varlogs - host: ${HOSTNAME} - __path__: /var/log/*log - - - job_name: applications - static_configs: - - targets: - - localhost - labels: - job: applogs - host: ${HOSTNAME} - __path__: /path/to/your/application/logs/*.log From 238247428b2a7a8c86669b622bc455f0430c4fc1 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 15:50:34 +0900 Subject: [PATCH 51/59] =?UTF-8?q?[ci]=20grafana=20=EC=84=A4=EC=A0=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafana 설정 수정 --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e72adfd7..87022289 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,7 +89,6 @@ services: image: grafana/grafana container_name: grafana restart: always - user: "$UID:$GID" ports: - "3009:3000" environment: From 5beabc412adebd2fee7afdf03a5df3d7f2721fed Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 15:59:53 +0900 Subject: [PATCH 52/59] =?UTF-8?q?[ci]=20grafana=20user=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafana user 수정 --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 87022289..9e10f278 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,6 +89,7 @@ services: image: grafana/grafana container_name: grafana restart: always + user: ec2-user ports: - "3009:3000" environment: From f4e9b0a2069473fd9c0c25385ac7ad8fbb9105df Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 16:14:56 +0900 Subject: [PATCH 53/59] =?UTF-8?q?[ci]=20grafana=20user=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafana user 수정 --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 9e10f278..8753e3fe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,13 +89,13 @@ services: image: grafana/grafana container_name: grafana restart: always - user: ec2-user + user: "1000" ports: - "3009:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - - ./grafana-data:/var/lib/grafana + - grafana_data:/var/lib/grafana mysqld_exporter: image: quay.io/prometheus/mysqld-exporter From 77927cafd76b4f63eeea5154367b9abdf2bbd035 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 16:30:53 +0900 Subject: [PATCH 54/59] =?UTF-8?q?[ci]=20docker=20network=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker network 수정 --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 8753e3fe..3c218d21 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -109,5 +109,6 @@ services: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf volumes: grafana-storage: + external: true prometheus-data: redis-data: \ No newline at end of file From eddd386287d16cef85ee5a9aa77a557a86feb4b3 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Wed, 3 Jul 2024 16:37:55 +0900 Subject: [PATCH 55/59] =?UTF-8?q?[ci]=20grafana=20volume=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit grafana volume 수정 --- docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3c218d21..82182959 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -89,13 +89,13 @@ services: image: grafana/grafana container_name: grafana restart: always - user: "1000" + user: "472" ports: - "3009:3000" environment: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} volumes: - - grafana_data:/var/lib/grafana + - grafana-storage:/var/lib/grafana mysqld_exporter: image: quay.io/prometheus/mysqld-exporter @@ -109,6 +109,5 @@ services: - /home/ec2-user/my.cnf:/etc/mysql/my.cnf volumes: grafana-storage: - external: true prometheus-data: redis-data: \ No newline at end of file From 7391a901df965cbebf7efe6b7f3828afc3d1260b Mon Sep 17 00:00:00 2001 From: Kim Min-Woo <107420002+kmw2378@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:43:02 +0900 Subject: [PATCH 56/59] =?UTF-8?q?[refactor]=20=EB=A9=94=ED=8A=B8=EB=A6=AD?= =?UTF-8?q?=20=EB=A1=9C=EA=B9=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kakaoshare/backend/logging/filter/LoggingFilter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java b/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java index 51469302..a1786d63 100644 --- a/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java +++ b/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java @@ -50,10 +50,10 @@ protected void doFilterInternal(final HttpServletRequest request, final FilterChain filterChain) throws ServletException, IOException { final ContentCachingRequestWrapper cachingRequest = new ContentCachingRequestWrapper(request); final ContentCachingResponseWrapper cachingResponse = new ContentCachingResponseWrapper(response); - final String requestURI = cachingRequest.getRequestURI(); - if (requestURI.contains(METRIC_URL_PREFIX) || requestURI.contains(FAVICON_URL)) { - return; - } + // final String requestURI = cachingRequest.getRequestURI(); + // if (requestURI.contains(METRIC_URL_PREFIX) || requestURI.contains(FAVICON_URL)) { + // return; + // } apiTimer.start(); filterChain.doFilter(cachingRequest, cachingResponse); From 827d328303f6b9abab91a0620a1ab9292333292a Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Sat, 6 Jul 2024 20:04:36 +0900 Subject: [PATCH 57/59] =?UTF-8?q?[refactor]=EB=A9=94=ED=8A=B8=EB=A6=AD?= =?UTF-8?q?=EC=9D=80=20=EB=A1=9C=EA=B9=85=20=EC=95=88=EB=90=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/kakaoshare/backend/logging/filter/LoggingFilter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java b/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java index 51469302..1916275e 100644 --- a/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java +++ b/src/main/java/org/kakaoshare/backend/logging/filter/LoggingFilter.java @@ -52,6 +52,7 @@ protected void doFilterInternal(final HttpServletRequest request, final ContentCachingResponseWrapper cachingResponse = new ContentCachingResponseWrapper(response); final String requestURI = cachingRequest.getRequestURI(); if (requestURI.contains(METRIC_URL_PREFIX) || requestURI.contains(FAVICON_URL)) { + doFilter(request, response, filterChain); return; } From 896d5fb7d41f5986680b1d35987a9c3eb58afa42 Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Mon, 22 Jul 2024 11:22:22 +0900 Subject: [PATCH 58/59] =?UTF-8?q?[feat]MemberRepository=20@Param=20?= =?UTF-8?q?=EB=AA=85=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kmw2378 --- .../backend/domain/member/repository/MemberRepository.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/kakaoshare/backend/domain/member/repository/MemberRepository.java b/src/main/java/org/kakaoshare/backend/domain/member/repository/MemberRepository.java index 4ce2683a..63180519 100644 --- a/src/main/java/org/kakaoshare/backend/domain/member/repository/MemberRepository.java +++ b/src/main/java/org/kakaoshare/backend/domain/member/repository/MemberRepository.java @@ -1,15 +1,16 @@ package org.kakaoshare.backend.domain.member.repository; -import java.util.List; import org.kakaoshare.backend.domain.member.entity.Member; import org.kakaoshare.backend.domain.member.repository.query.MemberRepositoryCustom; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import java.util.List; import java.util.Optional; -import org.springframework.data.jpa.repository.Query; public interface MemberRepository extends JpaRepository, MemberRepositoryCustom { Optional findMemberByProviderId(String providerId); @Query("SELECT m FROM Member m WHERE m.providerId IN :providerIds") - List findByProviderIds(List providerIds); + List findByProviderIds(@Param("providerIds") List providerIds); } From 4528d32ed83cf2799564157c4d15dacf1fd1c08f Mon Sep 17 00:00:00 2001 From: kmw2378 Date: Thu, 25 Jul 2024 12:28:11 +0900 Subject: [PATCH 59/59] =?UTF-8?q?[feat]V1=5F=5Fadd=5Freceipt=5Foption=5Fda?= =?UTF-8?q?te=5Fcolumn.sql=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: kmw2378 --- .../db/migration/V11__add_receipt_option_date_column.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/main/resources/db/migration/V11__add_receipt_option_date_column.sql diff --git a/src/main/resources/db/migration/V11__add_receipt_option_date_column.sql b/src/main/resources/db/migration/V11__add_receipt_option_date_column.sql new file mode 100644 index 00000000..280a3e49 --- /dev/null +++ b/src/main/resources/db/migration/V11__add_receipt_option_date_column.sql @@ -0,0 +1,3 @@ +ALTER TABLE receipt_option + ADD COLUMN created_at datetime(6) null, + ADD COLUMN updated_at datetime(6) null; \ No newline at end of file