Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to define index's alias at the same time by curator when the index will be created #1629

Open
tmljob opened this issue Nov 22, 2021 · 0 comments

Comments

@tmljob
Copy link

tmljob commented Nov 22, 2021

I want to define index's alias when the index will be created.
the create_index action config as fllows:

actions:
  1:
    action: create_index
    description: "Create index as named"
    options:
      name: vehicle-control-platform
      extra_settings:
        aliases:
        gps_data: {}
        settings:
          number_of_shards: 1
          number_of_replicas: 0
          analysis:
            analyzer:
               ngram_analyzer:
                  tokenizer: ngram_tokenizer
            tokenizer:
                ngram_tokenizer:
                  type: ngram
                  min_gram: 2
                  max_gram: 3
                  token_chars: ["letter", "digit"]                  
        mappings:
            properties:
              addressDate:
                type: date
                format: "yyyy-MM-dd HH:mm:ss"
              altitude:
                type: long
              direction:
                type: long
              latitudeWGS84:
                type: text
              latitudeWebMercator:
                type:  text
              location:
                type: geo_point
              longitudeWGS84:
                type: text
              longitudeWebMercator:
                type: text
              mileage:
                type: long
              platformId:
                type: long
              speed:
                type: long
              vehicleNo:
                type: text
                fields: 
                  keyword:
                    type: keyword
                    ignore_above: 256
                analyzer: ngram_analyzer

After curator run over, the error log as fllows:

2021-11-22 18:12:54,348 INFO      curator.actions.create_index              do_action:573  Creating index "vehicle-control-platform" with settings: {'aliases': None, 'gps_data': {}, 'settings': {'number_of_shards': 1, 'number_of_replicas': 0, 'analysis': {'analyzer': {'ngram_analyzer': {'tokenizer': 'ngram_tokenizer'}}, 'tokenizer': {'ngram_tokenizer': {'type': 'ngram', 'min_gram': 2, 'max_gram': 3, 'token_chars': ['letter', 'digit']}}}}, 'mappings': {'properties': {'addressDate': {'type': 'date', 'format': 'yyyy-MM-dd HH:mm:ss'}, 'altitude': {'type': 'long'}, 'direction': {'type': 'long'}, 'latitudeWGS84': {'type': 'text'}, 'latitudeWebMercator': {'type': 'text'}, 'location': {'type': 'geo_point'}, 'longitudeWGS84': {'type': 'text'}, 'longitudeWebMercator': {'type': 'text'}, 'mileage': {'type': 'long'}, 'platformId': {'type': 'long'}, 'speed': {'type': 'long'}, 'vehicleNo': {'type': 'text', 'fields': {'keyword': {'type': 'keyword', 'ignore_above': 256}}, 'analyzer': 'ngram_analyzer'}}}}
2021-11-22 18:12:54,358 DEBUG     urllib3.connectionpool          _make_request:452  http://127.0.0.1:9200 "PUT /vehicle-control-platform HTTP/1.1" 500 313
2021-11-22 18:12:54,358 WARNING            elasticsearch       log_request_fail:285  PUT http://127.0.0.1:9200/vehicle-control-platform [status:500 request:0.010s]
2021-11-22 18:12:54,358 DEBUG              elasticsearch       log_request_fail:302  > {"aliases":null,"gps_data":{},"settings":{"number_of_shards":1,"number_of_replicas":0,"analysis":{"analyzer":{"ngram_analyzer":{"tokenizer":"ngram_tokenizer"}},"tokenizer":{"ngram_tokenizer":{"type":"ngram","min_gram":2,"max_gram":3,"token_chars":["letter","digit"]}}}},"mappings":{"properties":{"addressDate":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"},"altitude":{"type":"long"},"direction":{"type":"long"},"latitudeWGS84":{"type":"text"},"latitudeWebMercator":{"type":"text"},"location":{"type":"geo_point"},"longitudeWGS84":{"type":"text"},"longitudeWebMercator":{"type":"text"},"mileage":{"type":"long"},"platformId":{"type":"long"},"speed":{"type":"long"},"vehicleNo":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}},"analyzer":"ngram_analyzer"}}}}
2021-11-22 18:12:54,358 DEBUG              elasticsearch       log_request_fail:307  < {"error":{"root_cause":[{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}],"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"},"status":500}
2021-11-22 18:12:54,359 ERROR                curator.cli                    run:213  Failed to complete action: create_index.  <class 'curator.exceptions.FailedExecution'>: Exception encountered.  Rerun with loglevel DEBUG and/or check Elasticsearch logs for more information. Exception: TransportError(500, 'not_x_content_exception', 'Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes')

please show me how to config aliases in the create_index action. Thanks a lot

@tmljob tmljob changed the title how to define index's alias in the same time by curator when the index will be created how to define index's alias at the same time by curator when the index will be created Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant