1 minute read

플러그인을 설치하고 재시작을 해주었는데 tokenizer를 찾지 못한다. 이게 머선일??

노리를 설치후 _analyze 를 통해 문서를 분석해보면 정상적으로 nori가 설치 된것처럼 보인다.

GET _analyze
{
  "tokenizer": "nori_tokenizer",
  "text" : [
      "개발자 한승우입니다"
    ]
}
{
  "tokens" : [
    {
      "token" : "개발",
      "start_offset" : 0,
      "end_offset" : 2,
      "type" : "word",
      "position" : 0
    },
    {
      "token" : "자",
      "start_offset" : 2,
      "end_offset" : 3,
      "type" : "word",
      "position" : 1
    },
    {
      "token" : "한승우",
      "start_offset" : 4,
      "end_offset" : 7,
      "type" : "word",
      "position" : 2
    },
    {
      "token" : "이",
      "start_offset" : 7,
      "end_offset" : 10,
      "type" : "word",
      "position" : 3
    },
    {
      "token" : "ᄇ니다",
      "start_offset" : 7,
      "end_offset" : 10,
      "type" : "word",
      "position" : 4
    }
  ]
}

그런데,,

PUT my_nori
{
  "settings": {
    "analysis": {
      "tokenizer": {
        "my_nori_tokenizer": {
          "type": "nori_tokenizer",
          "user_dictionary_rules": [
            "해물"
          ]
        }
      }
    }
  }
}

를 실행하려 하면 아래같은 Bad Request 를 뱉어 낸다. 뭘까??

{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Unknown tokenizer type [nori_tokenizer] for [my_nori_tokenizer]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Unknown tokenizer type [nori_tokenizer] for [my_nori_tokenizer]"
  },
  "status" : 400
}
GET /_cat/plugins?v

로 확인해봐도 nori_analysis가 존재한다 … 으아아ㅏㅏ악?? 뭐지

원인

아직 설치한 플러그인이 백그라운드에서 진행되고 있는 elasticsearch 에 반영이 되지 않았기 때문이라고 한다.

해결방법

만약 재시작하고도 정상반영이 안된다면, 프로세스를 직접 찾아 킬 해주어야 한다.

아 또 만약 도커 컴포즈로 ES를 여러개를 띄워서 사용한다면, 각노드에 모두 설치를 해야 한다. 이건 설정에 따라 다름,