Skip to content

Install

kyeonkim edited this page Oct 24, 2024 · 1 revision
  • 프로젝트 clone 진행
git clone https://github.com/sasaping/sasaping-system.git
  • .env file 생성 및 내용
# .env 파일 생성
touch .env

# 필요한 환경변수 값
JWT_SECRET_KEY=
TOSS_SECRET_KEY=
SLACK_TOKEN=

ELASTIC_PASSWORD=
KIBANA_PASSWORD=
ELASTIC_FINGERPRINT=

STACK_VERSION=8.6.0
CLUSTER_NAME=docker-cluster
LICENSE=basic
ES_PORT=9200
KIBANA_PORT=5601
MEM_LIMIT=1073741824

AWS_S3_REGION=
AWS_S3_ACCESS_KEY=
AWS_S3_SECRET_KEY=
  • 외부 서비스 설치 및 실행 (Kafka, Elasticsearch, Redis 등)
docker compose -f docker-compose-dep.yml up -d
  • Kibana 패스워드 변경
# Elasticsearch 컨테이너 접속
docker exec -it {Elasticsearch 아이디} /bin/bash

# 변경
curl -X POST -u elastic:{현재 Elasticsearch 패스워드} -k "https://localhost:9200/_security/user/kibana_system/_password" -H "Content-Type: application/json" -d '{"password": {변경할 kibana 패스워드} }'
  • Elasticsearch 환경설정 진행
# get crt file of es01 node
docker cp 도커 프로세스ID:/usr/share/elasticsearch/config/certs/es01/es01.crt .

# install openssl 
# create fingerprint
openssl x509 -fingerprint -sha256 -noout -in ./es01.crt

# set fingerprint in application.yml in product server

# health check
curl --cacert es01.crt -u elastic -X GET "https://localhost:9200/_cluster/health?pretty"
(enter password in .env)
  • Cassandra DB 환경설정
# Cassandra 컨테이너 접속
docker exec -it {Elasticsearch 아이디} sh

# Cassandra db 접속
cqlsh

# product database 생성
CREATE KEYSPACE product WITH REPLICATION = { 'class': 'SimpleStrategy', 'replication_factor': 3 };

# product database 사용
USE product;

# 테이블 수정
CREATE INDEX ON "P_PRODUCT" (isDeleted);
  • 서비스 실행
docker compose up -d
  • postman과 같은 API 테스트기를 통해 테스트

기본 주소: http://localhost:19091

Clone this wiki locally