docs: OpenSearch CI/CD 배포 문제 해결 추가

- Password 파싱 오류 (이스케이프 문제)
- 인증서 볼륨 마운트 누락 문제
- Gitea Secrets 한계점 설명
- 해결 방안 제시

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
happybell80 2025-09-14 23:12:34 +09:00
parent 17a12b62f5
commit e7f7800523

View File

@ -136,6 +136,49 @@ docker compose up -d
curl -X GET "localhost:9200/_cluster/health?pretty" curl -X GET "localhost:9200/_cluster/health?pretty"
``` ```
## CI/CD 배포 문제 해결 (추가: happybell80)
### 발견된 문제들
#### 1. Password 파싱 오류
```
Parsing failed. Reason: Missing argument for option: p
```
**원인**: bash -c 내부에서 변수 이스케이프 문제
```bash
# 문제 코드
bash -c "... hash.sh -p \"${OP_PASS}\" ..."
# 호스트가 ${OP_PASS} 해석 시도 → 빈 값
# 해결
bash -c "... hash.sh -p \"\${OP_PASS}\" ..."
# 백슬래시로 이스케이프 → 컨테이너 내부에서 해석
```
#### 2. 인증서 파일 누락으로 컨테이너 재시작
**원인**: docker-compose.yaml에 볼륨 마운트 없음
```yaml
# 현재 (문제)
volumes:
- /var/lib/opensearch:/usr/share/opensearch/data
# 수정 필요
volumes:
- /var/lib/opensearch:/usr/share/opensearch/data
- ./certs:/usr/share/opensearch/config/certs:ro
- ./internal_users.yml:/usr/share/opensearch/config/opensearch-security/internal_users.yml:ro
```
#### 3. Gitea Secrets 한계
- Secrets는 CI/CD Actions 실행 시에만 사용 가능
- 서버에서 직접 `docker compose up` 시 사용 불가
- Actions가 생성한 파일을 컨테이너에 마운트 필요
### 해결 방안
1. **개발환경**: Security 플러그인 비활성화 (`DISABLE_SECURITY_PLUGIN=true`)
2. **프로덕션**: 볼륨 마운트 추가 + 이스케이프 수정
## 다음 단계 ## 다음 단계
1. 인덱스 라이프사이클 정책 설정 (30일 보관) 1. 인덱스 라이프사이클 정책 설정 (30일 보관)
2. 기존 로그 마이그레이션 스크립트 작성 2. 기존 로그 마이그레이션 스크립트 작성