From bc4641072a6dab809eb3b197466b527821b4a248 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 29 Sep 2025 13:15:46 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20fluent-bit=20=EB=A9=94=ED=83=80?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0=20=EC=99=84=EB=A3=8C=20=EB=82=B4=EC=9A=A9=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3_fluent_bit_container_metadata_missing.md | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/troubleshooting/250929_51123_fluent_bit_container_metadata_missing.md b/troubleshooting/250929_51123_fluent_bit_container_metadata_missing.md index 91cdd01..7a8d8ba 100644 --- a/troubleshooting/250929_51123_fluent_bit_container_metadata_missing.md +++ b/troubleshooting/250929_51123_fluent_bit_container_metadata_missing.md @@ -68,7 +68,27 @@ curl -s "http://localhost:9200/dataprepper-*/_search" | \ python3 -c "import sys,json; [print(h['_source'].get('container_name','unknown')) for h in json.load(sys.stdin)['hits']['hits']]" ``` +## 해결 완료 (2025-09-29) + +### 수행된 조치 +1. **data-prepper 설정 수정** + - pipelines.yaml: `hosts: ["http://localhost:9200"]` → `hosts: ["http://192.168.219.45:9200"]` + - 51123 서버의 OpenSearch에 정상 연결 + +2. **Actions orphan 문제 해결** + - fluent-bit/.gitea/workflows/cicd.yml: `docker compose down --remove-orphans` 제거 + - opensearch/.gitea/workflows/cicd.yml: `docker compose down` 제거 + - network_mode: host 환경에서 다른 프로젝트 컨테이너 보존 + +### 최종 상태 +- ✅ container_id 메타데이터 정상 추출 +- ✅ fluent-bit → data-prepper(2021) → OpenSearch(9200) 파이프라인 정상 작동 +- ✅ HTTP 200 OK 응답으로 로그 전송 확인 +- ✅ OpenSearch에 container_name 필드 포함된 로그 저장 + ## 교훈 - Docker 이미지 내장 설정은 변경 추적 어려움 - 중요 설정은 외부 파일로 관리 필수 -- Fluent Bit Docker_Mode는 FILTER와 함께 사용해야 함 \ No newline at end of file +- Fluent Bit Docker_Mode는 FILTER와 함께 사용해야 함 +- network_mode: host 사용 시 docker compose down --remove-orphans 주의 +- Actions에서는 docker compose up -d --build만 사용하여 기존 컨테이너 보존 \ No newline at end of file