How can i disable the automatic index creation in elasticsearch?

前端 未结 3 869
情书的邮戳
情书的邮戳 2021-02-20 06:28

I need to disable automatic index creation for an index but need to permit for another one. How can I disable the automatic index creation by elasticsearch for a particular inde

相关标签:
3条回答
  • 2021-02-20 06:47

    I received an error on elastic search node startup saying it couldn't create a ".monitoring" index. Elastic search has some bookkeeping indices it uses that rely on auto-creation, so I needed to enable all indices that start with . If you define the environment variable on first start up then the following setting will allow any internal . indices to be created but will disable auto-creating any others:

     action.auto_create_index: "+.*"
    

    Here the ".*" is not treated as a dotall regex so it will only match allowing creating indices that start with a literal "."

    0 讨论(0)
  • 2021-02-20 07:06

    You can provide an index name pattern to specify whitelist/blacklist. See this for more information.

    Automatic index creation can include a pattern based white/black list, for example, set action.auto_create_index to +aaa*,-bbb*,+ccc*,-* (+ meaning allowed, and - meaning disallowed).

    0 讨论(0)
  • 2021-02-20 07:12

    "action.auto_create_index" is a bit complex beyond the true/false values. We can use patterns occuring in the index names to be identified and can specify whether it can be created automatically if it is not already existing.

    An example would be

    action.auto_create_index: -b*,+a*,-*
    

    Here the index starting with "a" will be created automatically,but others starting with "b" are not allowed. -* indicates that other indices are not allowed and if you want you need to create them manually.

    Also the order of the values also matters. For details,you can visit their documentation here

    0 讨论(0)
提交回复
热议问题