Redis 예매 테이블 적용
인덱싱 색인, ElasticSearch, Redis Cache 전략
- 100만명… 500만명… 1000만명 몰릴 때 확장 할 수 있는지?, 어떻게 확장 할건지?
Spring boot에서 jedis를 사용 할려고 했지만 빈 충돌이나고, jedis 1개로 사용해도 기존에 구현된 refreshToken을 다시 구현 야해서 ElasticSearch로 확인
ElasticSearch 적용
ElasticSearch:8.12.1
Spring Boot 3.2.2
Spring ElasticSearch 3.2.2
- build.gradle에 추가
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
- Configuration 추가
@Configuration
@EnableElasticsearchRepositories
public class ElasticSearchConfig extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder()
.connectedTo("localhost:9200")
.build();
}
}
-
로컬환경에서는 http를 사용하기에 Docker에서 Security 비활성화
config 파일 간 후에 밑의 echo로 덮어씌움 -
config 폴더로 이동
cd config
- echo로 설정 업데이트
echo "cluster.name: docker-cluster
network.host: 0.0.0.0
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically
# generated to configure Elasticsearch security features on 22-02-2024 16:34:26
#
# --------------------------------------------------------------------------------
# Enable security features
xpack.security.enabled: false
xpack.security.enrollment.enabled: false
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: false
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: [df28bbdeb86f]
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------" >> elasticsearch.yml
'항해99' 카테고리의 다른 글
항해99 실전 프로젝트 (23일차) (0) | 2024.02.26 |
---|---|
항해99 실전 프로젝트 (22일차) (0) | 2024.02.23 |
항해99 실전 프로젝트 (20일차) (0) | 2024.02.21 |
항해99 실전 프로젝트 (19일차) (0) | 2024.02.21 |
항해99 실전 프로젝트 (18일차) (0) | 2024.02.19 |
Redis 예매 테이블 적용
인덱싱 색인, ElasticSearch, Redis Cache 전략
- 100만명… 500만명… 1000만명 몰릴 때 확장 할 수 있는지?, 어떻게 확장 할건지?
Spring boot에서 jedis를 사용 할려고 했지만 빈 충돌이나고, jedis 1개로 사용해도 기존에 구현된 refreshToken을 다시 구현 야해서 ElasticSearch로 확인
ElasticSearch 적용
ElasticSearch:8.12.1
Spring Boot 3.2.2
Spring ElasticSearch 3.2.2
- build.gradle에 추가
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
- Configuration 추가
@Configuration
@EnableElasticsearchRepositories
public class ElasticSearchConfig extends ElasticsearchConfiguration {
@Override
public ClientConfiguration clientConfiguration() {
return ClientConfiguration.builder()
.connectedTo("localhost:9200")
.build();
}
}
-
로컬환경에서는 http를 사용하기에 Docker에서 Security 비활성화
config 파일 간 후에 밑의 echo로 덮어씌움 -
config 폴더로 이동
cd config
- echo로 설정 업데이트
echo "cluster.name: docker-cluster
network.host: 0.0.0.0
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically
# generated to configure Elasticsearch security features on 22-02-2024 16:34:26
#
# --------------------------------------------------------------------------------
# Enable security features
xpack.security.enabled: false
xpack.security.enrollment.enabled: false
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: false
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: [df28bbdeb86f]
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------" >> elasticsearch.yml
'항해99' 카테고리의 다른 글
항해99 실전 프로젝트 (23일차) (0) | 2024.02.26 |
---|---|
항해99 실전 프로젝트 (22일차) (0) | 2024.02.23 |
항해99 실전 프로젝트 (20일차) (0) | 2024.02.21 |
항해99 실전 프로젝트 (19일차) (0) | 2024.02.21 |
항해99 실전 프로젝트 (18일차) (0) | 2024.02.19 |