운영 가이드¶
컨테이너 관리¶
상태 확인¶
로그 확인¶
# 실시간 로그
docker logs -f trend-collector
# 최근 100줄
docker logs --tail 100 trend-collector
# 특정 시간 이후
docker logs --since 2026-04-07T00:00:00 trend-collector
시작 / 정지 / 재시작¶
cd ~/trend-collector
docker compose up -d # 시작
docker compose stop # 정지
docker compose restart # 재시작
docker compose down # 완전 제거
Health Check¶
수집 상태 확인 (MySQL)¶
최근 수집 내역¶
USE trend_collector;
-- 최근 10개 스냅샷
SELECT id, collected_at, status, raw_path
FROM trend_snapshots
ORDER BY collected_at DESC
LIMIT 10;
최신 트렌드 키워드¶
SELECT s.collected_at, k.rank_position, k.keyword, k.status
FROM trend_keywords k
JOIN trend_snapshots s ON s.id = k.snapshot_id
WHERE s.id = (SELECT MAX(id) FROM trend_snapshots WHERE status = 'SUCCESS')
ORDER BY k.rank_position;
실패 내역 조회¶
SELECT id, collected_at, status, error_message
FROM trend_snapshots
WHERE status = 'FAILED'
ORDER BY collected_at DESC
LIMIT 10;
설정 변경¶
수집 주기 변경¶
docker-compose.yml에서 COLLECT_INTERVAL_MINUTES 값을 수정 후 재시작: