inflearn logo
강의

講義

知識共有

ELKスタック(ElasticSearch、Logstash、Kibana)によるデータ分析

エラスティックサーチマッピング(マッピング)

elasticsearch 에러 관련입니다.

5292

Shin Chul Bang

投稿した質問数 1

20

elasticsearch 7.x 버젼부터는 curl 리퀘스트에서 헤더를 명확히 설정해주어야하고 또 mappign을 생성할 때에는 include_type_name을 true로 설정해주어야한다고 합니다.

이에 대한 에러문구는 아래와 같습니다.

 

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
  },
  "status" : 400
}

 

그래서 저는 mapping을 생성할 때 아래와 같이 커맨드라인을 날렸습니다.

 

curl -H 'Content-Type:application/json' -XPUT 'http://localhost:9200/classes/class/_mapping?include_type_name=true&pretty' -d @classesRating_mapping.json

 

그런데 아래와 같은 에러가 다시 발생했습니다.

 

{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "No handler for type [string] declared on field [professor]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "No handler for type [string] declared on field [professor]"
  },
  "status" : 400
}

 

이에 대해서 원인을 찾아보니 elasticsearch가 mapping 타입 중 string을 삭제하고 text로 변경하여 사용하고있다고 합니다.

관련 정보 링크 : https://stackoverflow.com/questions/47452770/no-handler-for-type-string-declared-on-field-name

그래서 classesRating_mapping.json에서 type이 string으로 되어있는 부분들을 모두 text로 변경한 후 위 커맨드라인을 다시 실행해보니 정상적으로 실행되었습니다.

혹시 이 강의를 보시는 분들 중 elasticsearch 6.x 이상의 버젼을 사용하여 수강하시는 분들은 이 부분들을 참고해보시면 좋을 것 같습니다.

elasticsearch Kibana logstash 데이터 엔지니어링

回答 6

1

danma50534812

오 정말 좋은 Tip 공유 감사드립니다, 위 방법으로도 안된다면 include_type_name=true 옵션을 추가하면 됩니다.

curl -XPUT localhost:9200/classes/class/_mapping?include_type_name=true -d @classesRating_mapping.json -H 'Content-Type: application/json'

관련 정보 : https://www.elastic.co/kr/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0

 ^^*

0

iambyunghyun

감사합니다!

0

Kyungho Jung

고맙습니다! 헤메지 않고 빠르게 해결했습니다.

0

jieunychoi

고맙습니다~ 헤맬뻔했네요!

정작 영상에는 text로 되어있네요;;

0

June

고맙습니다 : )

0

ahndc120711

감사합니다. :)

우분투 16.04를 vm으로 돌리고 있는데 저장을 어떻게 하나요?

0

625

1

에러 확인 부탁드립니다

0

863

2

Elasticsearch 버전 8 | mappsing, data file

1

613

1

우분투 16.04 에 엘라스틱 서치 설치시 에러

0

777

2

illegal_argument_exception 오류

2

436

0

bul_basketball.json 벌크할때 오류나시는 분들보세요

4

343

0

logstash 스타트 불가

0

299

0

json 파일 XPOST로 데이터를 입력하는데 왜 이상하게 들어가질까요..??

0

417

0

Elasticsearch 6.0 부터는 Content-Type을 명시해야한다고 합니다!

7

442

1

다중쿼리는 어떻게하나요

0

217

0

--header 옵션

0

255

1

13과 에서 날짜 선택

1

408

1

키바나가 제대로 설치되지 않습니다.

0

342

1

깃헙 파일 logstash.conf 괄호 안 닫혀 있어서 에러가 났었어요. 필터랑 아웃풋 } 하나씩 더 추가해 주어야 할듯합니다.

0

267

0

현재 7버전 이용중인데 -XPOST 시 에러가 발생합니다.

10

743

3

or 조건 쿼리

0

239

0

index 생성은 왜 XPOST가 아니라 XPUT인가요?

1

370

0

logstash 및 filebeat 실행시 오류

0

648

0

아주 기본적인 질문이 있습니다.

0

361

0

질문입니다

0

356

1

BULK 예제 실행하는데 있어 에러가 납니다.

0

557

2

name과 team의 string이 분리되는 문제는 json 파일을 다음과 같이 변경하여 해결했습니다.

6

286

1

강사님 github 주소

3

336

0

마지막 스크립트 부분

0

206

0