'분류 전체보기'에 해당되는 글 1582건

  1. 2022.05.11 [Elasticsearch] 8.2.0 Docker Compose 예제.
  2. 2022.05.09 [Elastic] Enterprise Search 8.2 구성 해 보기
  3. 2022.04.22 [Thymeleaf] 간만에 FE 작업 삽질 기록
  4. 2022.04.07 [Springboot+Ajax] 데이터 통신
  5. 2022.03.28 [Elasticsearch] Plugin transport-netty4 MVN Repo Missing!!
  6. 2022.03.24 [Elasticsearch] Terms + Sub Sum Aggs 사례.
  7. 2022.03.24 [Docker] apk not found 또는 certificate verify failed:ssl 발생 시.
  8. 2022.03.23 [Docker] Spring Boot App 도커 적용
  9. 2022.03.23 [Elasticsearch] 8.0 살펴 봤던 거
  10. 2022.03.16 [Logback] JsonLayout, PatternLayout

[Elasticsearch] 8.2.0 Docker Compose 예제.

Elastic/Elasticsearch 2022. 5. 11. 16:42

Elasticsearch 7.x 와 다르게 8.x 에서는 기본 xpack.security.enabled: true 로 실행이 됩니다.

그래서 docker container 구성 시 보안 기능을 사용 하지 않고 예전 처럼 7.x 에서 사용 하듯이 사용 하고자 한다면 아래 예제를 참고해서 사용 하시기 바랍니다.

version: '3.7'
services:
  es-singlenode:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.2.0
    container_name: es-singlenode
    environment:
      - xpack.security.enabled=false
      - node.name=single-node
      - cluster.name=es-singlenode-c
      - discovery.type=single-node
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - es-bridge
networks:
  es-bridge:
    driver: bridge

저 같은 경우 xpack basic 을 사용 하기는 하지만 보안 기능을 사용 하지는 않습니다.

모두 private subnet 에서 구성해서 사용중이기도 하고 별도 ACL 통제를 통해서 접근 제어도 이루어 지고 있어서 인데요.

판단은 각자가 알아서 하셔야 할 것 같습니다.

 

:

[Elastic] Enterprise Search 8.2 구성 해 보기

Elastic 2022. 5. 9. 13:56

Enterprise Search (App Search) 를 사용하기 위해서는 먼저 선행 되어야 하는 것들이 있습니다.

https://www.elastic.co/guide/en/app-search/current/getting-started.html

 

App Search 이외 Workspace Search 도 있습니다.

여기서는 App Search 만 다뤘습니다.

 

1. Elasticsearch 가 설치 되어 있어야 합니다.

Enterprise Search 는 Elasticsearch 를 포함 하고 있지 않습니다.

구성 되어 있는 Elasticsearch Cluster 에 연결 해서 Enterprise Search 를 사용 할 수 있도록 해줍니다.

 

2. Kibana 가 설치 되어 있어야 합니다.

Kibana 가 필요한 이유는 Enterprise Search 의 Web UI 가 Kibana 로 통합 되었기 때문 입니다.

 

3. Enterprise Search 가 설치 되어 있어야 합니다.

Enterprise Search 를 사용하기 위해 필요 하며, Elasticsearch 는 JDK 17 을 요구 하지만, Enterprise Search JDK 11 을 요구 합니다.

사용 하는 JDK 버전을 꼭 확인 하셔야 합니다.

 

 

Elasticsearch 8.2 설치 및 실행)

기본 tar ball 을 다운로드 받고 압축을 해제 한 후 바로 실행 합니다.

전에도 설명 했지만 8.x 부터는 기본 xpack security 기능이 enabled 입니다.

$ bin/elasticsearch
 Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.

ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  0*LbX+orEfOCQx2GPRRy

ℹ️  HTTP CA certificate SHA-256 fingerprint:
  961aea7f1014ee94966ed79be09f3f550236389049d41b41c4dbe196e2bf7a22

ℹ️  Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjIuMCIsImFkciI6WyIxOTIuMTY4LjAuNzo5MjAwIl0sImZnciI6Ijk2MWFlYTdmMTAxNGVlOTQ5NjZlZDc5YmUwOWYzZjU1MDIzNjM4OTA0OWQ0MWI0MWM0ZGJlMTk2ZTJiZjdhMjIiLCJrZXkiOiJpNWRvcG9BQkhoU20tOF9wY1FVYTpwdUZTMFMtM1J4aVZZUmoyaGJzajZnIn0=

ℹ️  Configure other nodes to join this cluster:
• On this node:
  ⁃ Create an enrollment token with `bin/elasticsearch-create-enrollment-token -s node`.
  ⁃ Uncomment the transport.host setting at the end of config/elasticsearch.yml.
  ⁃ Restart Elasticsearch.
• On other nodes:
  ⁃ Start Elasticsearch with `bin/elasticsearch --enrollment-token <token>`, using the enrollment token that you generated.


Kibana 8.2 설치 및 실행)

기본 tar ball 을 다운로드 받고 압축을 해제 한 후 바로 실행 합니다.

Security Enabled 이기 때문에 Kibana 실행 시 Elasticsearch 에서 생성해 준 코드를 입력해서 연결 합니다.

등록 후 ID, PWD 를 입력 하고 로그인 합니다.

$ bin/kibana
i Kibana has not been configured.

Go to http://localhost:5601/?code=917177 to get started.

# elasticsearch 실행 하면서 생성된 코드를 등록 하고 kibana 구성을 완료 합니다.
# id/pwd 를 입력 하고 로그인 합니다. (역시 elasticsearch 실행 시 생성된 코드를 입력 합니다.)

 

Enterprise Search 8.2 설치 및 실행)

기본 tar ball 을 다운로드 받고 압축을 해제 한 후 바로 실행 합니다.

Enterprise Search 의 경우 필요한 정보는 Elasticsearch 와 Kibana 정보 입니다.

Elasticsearch 의 경우 SSL 연동을 위한 정보도 함께 등록 합니다.

$ bin/enterprise-search
# java 11 버전을 요구 하기 때문에 맞춰서 실행 합니다.

--------------------------------------------------------------------------------

Invalid config file (/Users/henry/Workspace/apps/es8.2.0/enterprise-search-8.2.0/config/enterprise-search.yml):
The setting '#/secret_management/encryption_keys' is not valid
No secret management encryption keys were provided.
Your secrets cannot be stored unencrypted.
You can use the following generated encryption key in your config file to store new encrypted secrets:
todd
secret_management.encryption_keys: [37697db0e75459e7c5e55e6c492c36fde2dc31dcc7b9db9fcc44c702d0a3b9f5]


--------------------------------------------------------------------------------

$ vi config/enterprise-search.yml
secret_management.encryption_keys: [37697db0e75459e7c5e55e6c492c36fde2dc31dcc7b9db9fcc44c702d0a3b9f5]
allow_es_settings_modification: true
elasticsearch.username: elastic
elasticsearch.password: 0*LbX+orEfOCQx2GPRRy
elasticsearch.host: https://127.0.0.1:9200
elasticsearch.ssl.enabled: true
elasticsearch.ssl.certificate_authority: /Users/henry/Workspace/apps/es8.2.0/elasticsearch-8.2.0/config/certs/http_ca.crt
kibana.external_url: http://localhost:5601


# enterprise-search 연동을 위해 kibana 설정을 합니다.
$ vi config/kibana.yml
enterpriseSearch.host: http://localhost:3002


$ bin/enterprise-search
#########################################################

Success! Elastic Enterprise Search is starting successfully.

Advanced tooling and management interfaces are available via Kibana. Learn more about configuring and running
Kibana with Enterprise Search at https://www.elastic.co/guide/en/enterprise-search/master/user-interfaces.html.

In a few moments, you'll be able to access Enterprise Search from Kibana at the following address:

  * Kibana URL: http://localhost:5601/app/enterprise_search/overview

If this is your first time starting Enterprise Search, check the console output above for your user authentication credentials.

Visit the documentation: https://www.elastic.co/guide/en/enterprise-search/master/index.html


WARNING: A new secret session key has been generated.

Set the key in your config file to persist user sessions through process restarts:

secret_session_key: 5c6b7e6034c36ab0753033889e977624e362990f210adac99348e0e94aefb9b758ef8799d8d111b7d7c5c11383a254a50ca5322ed916ce185b2141617aa5924e


#########################################################


Kibana 에 접속해서 Enterprise Search 를 사용해 봅니다.)

# kibana 에 접속 해서 enterprise search 에서 app search 를 생성 합니다.
# app search 에서 engine 생성을 한 후 json 파일을 등록 합니다.
# [ {...}, {...} ] 형태의 개별 문서가 등록이 되어 있어야 하며, bulk request json 과 형식이 다릅니다.
# 문서 등록을 했으면 생성한 엔진으로 접근해서 검색을 실행해 봅니다.
# Relevance Tuning 이나 Search UI 에서 실행 합니다. 또는 Postman 에서 실행 하고자 할 때는
https://www.elastic.co/guide/en/app-search/8.2/search-guide.html
각각의 인증키는 Credentials 에 들어 가면, private-key 와 search-key 가 존재 합니다.

# Endpoint rule
http://localhost:3002/api/as/v1/engines/${ENGINE-NAME}/query_suggestion
http://localhost:3002/api/as/v1/engines/${ENGINE-NAME}/search.json

# Suggestion
curl --location --request POST 'http://localhost:3002/api/as/v1/engines/disney-poc/query_suggestion' \
--header 'Authorization: Bearer search-dupjgg5jdgafcj4cqoykq39k' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"서울"}'

# Search
curl --location --request POST 'http://localhost:3002/api/as/v1/engines/disney-poc/search.json' \
--header 'Authorization: Bearer search-dupjgg5jdgafcj4cqoykq39k' \
--header 'Content-Type: application/json' \
--data-raw '{
    "query":"서울"
}'

# enterprise search 에서 제공 하는 query 에는 QueryDSL 을 사용 할 수 없습니다.
https://www.elastic.co/guide/en/app-search/8.2/search.html#search-api-request-body

# enterprise search 에서 제공 하는 synonyms 기능은 질의 시점에 적용 되는 기능입니다.
https://www.elastic.co/guide/en/app-search/8.2/synonyms.html
Kibana UI 에서 등록 시 처음에 등록 하는 동의어가 원본 동의어가 되며, 이후 등록 하는 value 들이 원본 동의어와 같이 처리가 되어야 하는 동의어가 됩니다.

통신 방법에 따라 사용 유형을 정리해 보면,

Case 1)

Elasticsearch Cluster <--> Enterprise Search <--> Kibana

 

Case 2)

Elasticsearch Cluster <--> Enterprise Search <--> External Search API

 

Vertical Search Engine 으로도 사용이 가능 합니다.

Elasticsearch Cluster <--> Enterprise Search (각 서비스 또는 도메인 별 Enigne 생성) <--> External Search API (Engine 별 Endpoint)

 

단일 클러스터 운영을 하고 여러 Collection(Index) 을 사용하고자 할 때 유용하게 사용 가능해 보입니다.

:

[Thymeleaf] 간만에 FE 작업 삽질 기록

ITWeb/개발일반 2022. 4. 22. 14:31

1. bootstrap UI 에서 "dropdown require Popper" 관련 오류가 발생을 하면 아래 내용을 추가 합니다.

 

[webjars + bootstrap 4 사용 시]

build.gradle)
implementation "org.webjars:popper.js:1.6.1-lts"

fragments_jsimport.html)
<!-- jQuery 먼저 선언 합니다. -->
<script type="text/javascript" th:src="@{/webjars/popper.js/umd/popper.min.js}"></script>
<!-- Bootstrap 을 나중에 선언 합니다. -->

여기서는 선언 순서를 지켜 주셔야 합니다.

 

2. spring mvc 에서 thymeleaf 로 값 전달

Controller)
mav.addObject("key", 1);

Thymeleaf)
<a th:href="@{/goto/{id}(id=${key})}">KEY</a>
To
<a href="/goto/1">KEY</a>

 

:

[Springboot+Ajax] 데이터 통신

ITWeb/개발일반 2022. 4. 7. 15:43

Spring Domain, VO, Model

@Setter
@Getter
@ToString
public class SearchRequestModel {

    private PageModel pageModel;
    private long id;
}

@Setter
@Getter
@ToString
public class PagetModel {

    private int page;
    private int size;
    private String sort;
}

 

Spring RestController

@ResponseBody
@RequestMapping(
    value = "/api/search",
    method = RequestMethod.POST,
    produces = { MediaType.APPLICATION_JSON_VALUE }
)
public String search(
	@RequestBody SearchRequestModel m
) {
	return service.search(m)
}

 

Ajax

$.ajax({
    type: "POST",
    url: "/api/search",
    dataType: "json",
    contentType: "application/json",
    data: JSON.stringify({
        "pageModel": {
            "page": 1,
            "size": 20,
            "sort": "asc"
        },
        "id": 1
    }),
    success: function(res) {
    },
    error: function(res, status, e) {
    }
});

 

Ajax 요청 시 dataType, contentType 선언 없이 + @RequestBody 선언 없이 사용할 경우,

일반적인 POJO 스타일의 Data Binding 으로 처리가 됩니다. (Spring 에서는 자동으로 처리가 됩니다.)

또는

@RequestParam 을 이용해서 값을 전달 받을 수 있습니다.

 

오랜만에 화면 작업 하다 보니 이런것도 기억이 가물 가물 합니다.

:

[Elasticsearch] Plugin transport-netty4 MVN Repo Missing!!

Elastic/Elasticsearch 2022. 3. 28. 16:04

elasticsearch 8.x 에서 plugin 개발 시 주의 사항!!

기본적으로 plugin 을 만들기 위한 몇몇 dependency lib 들이 maven repository 에 등록이 안된 것 같습니다.
플로그인 빌드 시 아래와 같은 에러가 발생 하는 경우 꼭 관련 lib 들이 등록 되어 있는지 확인 하고 사용하시기 바랍니다.

 

빌드 시 에러 메시지)

Could not find artifact org.elasticsearch.plugin:transport-netty4:jar:8.0.0 in central
(https://repo.maven.apache.org/maven2)

 

org.elasticsearch.plugin:transport-netty4:jar 는 8.1.1 부터 등록이 되어 있습니다.
그래서 빌드 하실 때 8.0.0 이나 8.1.0 은 빌드 실패를 하게 되는데요.

꼭 확인을 해보셔야 합니다.

 

Maven Repository)
https://mvnrepository.com/artifact/org.elasticsearch.plugin
https://mvnrepository.com/artifact/org.elasticsearch.plugin/transport-netty4

 

:

[Elasticsearch] Terms + Sub Sum Aggs 사례.

Elastic/Elasticsearch 2022. 3. 24. 18:13

문제)

하루 동안 데이터 요청을 가장 많이한 IP Top 5 를 구하시오.

 

해결)

GET /kibana_sample_data_logs/_search
{
  "size":0,
  "aggs": {
    "ip_aggs": {
      "terms": {
        "field": "ip"
      },
      "aggs": {
        "sum_aggs": {
          "sum": {
            "field": "bytes"
          }
        },
        "sum_aggs_sort": {
          "bucket_sort": {
            "sort": [
              { "sum_aggs": { "order": "desc" } } 
            ],
            "size": 5
          }
        }
      }
    }
  }
}

 

관련 문서)

https://www.elastic.co/guide/en/elasticsearch/reference/8.1/search-aggregations-bucket-terms-aggregation.html

https://www.elastic.co/guide/en/elasticsearch/reference/8.1/search-aggregations-pipeline-bucket-sort-aggregation.html

 

Elasticsearch 를 설치 하고 Kibana 를 이용해서 Sample Data 를 이용하였습니다.

그냥 Single node 로 구성 해서 테스트 해보실 수 있습니다.

:

[Docker] apk not found 또는 certificate verify failed:ssl 발생 시.

Cloud&Container/IaC 2022. 3. 24. 11:33

아래와 같은 에러 발생 시

Step 8/13 : RUN apk add tzdata
 ---> Running in 7d1593d1239f
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
140460674784072:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1914:
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/main: Permission denied
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/main: No such file or directory
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
140460674784072:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1914:
ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.14/community: Permission denied
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.14/community: No such file or directory
ERROR: unable to select packages:
  tzdata (no such package):
    required by: world[tzdata]
The command '/bin/sh -c apk add tzdata' returned a non-zero code: 1

제가 사용했던 이미지는 OpenJDK 11 Alpine 입니다.

FROM adoptopenjdk/openjdk11:alpine

Timezone 설정을 위해서 

RUN apk add tzdata

를 Dockerfile 에 추가 했는데 에러가 발생을 했습니다.

 

찾아 보니 SSL 인증서 문제라고 해서 아래와 같이 수정 했습니다.

RUN sed 's/https/http/g' -i /etc/apk/repositories
RUN apk update
RUN apk add --no-cache bash
RUN apk add tzdata

나중에 또 기억 못할 것 같아서 기록 합니다.

:

[Docker] Spring Boot App 도커 적용

ITWeb/개발일반 2022. 3. 23. 10:49

Springboot 로 WAS 생성 후 이를 도커 기반으로 생성, 실행 하기 위해서 관련 내용 기록 합니다.

 

관련 문서)

https://spring.io/guides/gs/spring-boot-docker/
https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/

 

과정)

1. 프로젝트를 빌드 해서 bootJar 를 생성 합니다.

보통 build/libs 에 생성이 됩니다.

 

2. Dockerfile 을 생성 합니다.

여기서 bootJar 를 ADD 해야 하는데 Dockerfile 과 같은 Depth 에 위치 하거나 하위에 위치해야 합니다.

상위에 bootJar 가 있을 경우 permission denied 에러가 발생 합니다.

 

3. Image 생성을 합니다.

$ docker build -t 이미지명:태그 .

태그 정보는 jenkins 에서 build number 를 부여 하거나 운영 규칙을 정해서 관리 합니다.

registry 를 운영하고 있으면 생성된 이미지를 등록 합니다.

 

4. docker-compose.yml 을 생성 합니다.

registry 를 운영하고 있으면 registry 에서 이미지를 받아 옵니다.

 

관련 예제 코드들은 위 문서에 잘 나와 있으니 참고 하면 됩니다.

 

아래는 그냥 참고용으로 올려 봅니다.

build.gradle)
...중략...
bootJar {
  destinationDirectory=file('docker/libs')
  enabled = true
}
...중략...

$ export TAG=1.0.0
$ docker build -t boot-app:$TAG .


Case 1) docker/Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=./libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]

Case 2) docker/Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=./libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT java \
-jar app.jar

Case 3) docker/Dockerfile
ENV heapSize="-Xms2048 -Xmx2048m"
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=./libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","${heapSize}","-jar","/app.jar"]

Case 4) docker/Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=./libs/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT java \
${heapSize} \
-jar app.jar

ENTRYPOINT 추가 옵션)
-Djava.security.egd=file:/dev/./urandom \
-Dspring.profiles.active=local


docker-compose) docker/docker-compose.yml
version: '3.7'

services:
  boot-app:
    container_name: boot-app
    image: boot-app:${TAG}
    environment:
      - TZ=Asia/Seoul
      - env=local
      - "heapSize=-Xms2048m -Xmx2048m"
    ports:
      - "8080:8080"
    volumes:
      - ./logs:/home/appuser/logs
    sysctls:
      - net.core.somaxconn=65000
    restart: on-failure

 

:

[Elasticsearch] 8.0 살펴 봤던 거

Elastic/Elasticsearch 2022. 3. 23. 10:04

시간이 없어서 전체적으로 다 살펴 보지는 못했네요.

우선 확인 한것만 그냥 올려 놓습니다.

 

Elasticsearch 8.0 

- path.data 다중 설정이 deprecated.
7.13.0 부터 deprecated 되었으나 아직까지는 기능을 제공 하고 있음.
디스크를 추가 하기 보다 data node 를 늘리는 것을 추천함.
단일 경로 설정 사용을 권장함.

- system index 에 접근 제어.
allow_restricted_indices: true 로 하면 접근 가능함.

- 8.0 실행 시 jdk 17 을 요구함.
warning: ignoring JAVA_HOME=/Users/henry/.jenv/versions/11.0; using ES_JAVA_HOME
The minimum required Java version is 17; your Java version from [/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home] does not meet this requirement

https://adoptium.net/ 에서 다운로드 받아 설치 합니다. (pkg)

/Library/Java/JavaVirtualMachines/temurin-17.jdk
$ jenv add /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
$ ES_JAVA_HOME='/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home' bin/elasticsearch

- 8.0 부터는 보안이 기본 적용 됩니다.
관련 security 기능을 사용하고 싶지 않을 경우 xpack.security.enable: false 로 설정 하면 됩니다.


✅ Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.

ℹ️  Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
  5mZOrRjTURT=V90LqU5N

ℹ️  HTTP CA certificate SHA-256 fingerprint:
  24d263ef19a4e66de19ab35dbd8a0cbf4ca303598123d3ee6acbb96852e25421

ℹ️  Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
  eyJ2ZXIiOiI4LjAuMCIsImFkciI6WyIxOTIuMTY4LjAuMTA0OjkyMDAiXSwiZmdyIjoiMjRkMjYzZWYxOWE0ZTY2ZGUxOWFiMzVkYmQ4YTBjYmY0Y2EzMDM1OTgxMjNkM2VlNmFjYmI5Njg1MmUyNTQyMSIsImtleSI6Imd0R2g1bjRCc3hnWEYtbV92bU43OnlwVDhOaXNaU2ZXejRhdEhTaExfS0EifQ==

ℹ️  Configure other nodes to join this cluster:
• On this node:
  ⁃ Create an enrollment token with `bin/elasticsearch-create-enrollment-token -s node`.
  ⁃ Uncomment the transport.host setting at the end of config/elasticsearch.yml.
  ⁃ Restart Elasticsearch.
• On other nodes:
  ⁃ Start Elasticsearch with `bin/elasticsearch --enrollment-token <token>`, using the enrollment token that you generated.


- elasticsearch.yml 내부에 환경 변수 설정이 가능 합니다.
node.name:    ${HOSTNAME}
network.host: ${ES_NETWORK_HOST}

export HOSTNAME="host1,host2"

- transient 설정을 더 이상 추천 하지 않습니다.
영구 설정을 사용 하세요.

- data directory 에 대한 어떠한 조작, 수정도 하지 마십시오.


- lucene-analyzers-common 이 lucene 9.0.0 으로 넘어 가면서 lucene-analysis-common 으로 변경 되었습니다.
import org.apache.lucene.analysis.util.TokenizerFactory;
to
import org.apache.lucene.analysis.TokenizerFactory;
로 변경 되었습니다.

import org.apache.lucene.analysis.standard.ClassicFilter;
to
import org.apache.lucene.analysis.classic.ClassicFilter;
로 변경 되었습니다.

- node 단독 실행 시 아래 설정이 꼭 되어야 합니다.
discovery.type: single-node
or
cluster.initial_master_nodes, discovery.seed_hosts, discovery.seed_providers 중 하나는 꼭 설정 되어야 합니다.

- mapping 파라미터 중 boost 파라미터가 삭제 되었습니다.
.The `boost` parameter on field mappings has been deprecated
.The `boost` parameter on field mappings has been removed

- jdk 변경 된 점
Remove support for JAVA_HOME
Require Java 17 for running Elasticsearch

- exist action some removed.
Remove aliases exist action
Remove indices exists action
Remove types exists action

- Enable LZ4 transport compression by default

:

[Logback] JsonLayout, PatternLayout

ITWeb/개발일반 2022. 3. 16. 15:52
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
      <layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
        <timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampFormat>
        <timestampFormatTimezoneId>Asia/Seoul</timestampFormatTimezoneId>
        <appendLineSeparator>true</appendLineSeparator>
        <jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
          <prettyPrint>true</prettyPrint>
        </jsonFormatter>
      </layout>
    </encoder>
  </appender>

  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern>
    </layout>
  </appender>
  
  <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>logs/file.log</file>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>logs/file-%d{yyyy-MM-dd}.log</fileNamePattern>
      <maxHistory>30</maxHistory>
    </rollingPolicy>

    <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
      <layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
        <timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</timestampFormat>
        <timestampFormatTimezoneId>Asia/Seoul</timestampFormatTimezoneId>
        <appendLineSeparator>true</appendLineSeparator>
        <jsonFormatter class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
          <prettyPrint>true</prettyPrint>
        </jsonFormatter>
      </layout>
    </encoder>
  </appender>
  
  ...중략...
  
  </configuration>

필요한 부분에 대해서만 기록해 봅니다. 

appender !!

 

: