Elasticsearch 不会自动创建索引

问题描述 投票:0回答:1

ES 已启动并运行,但未自动创建索引,也未连接到微服务。

ps -ef | grep 弹性搜索

imail 3767 1 0 06:22 点/0 00:00:11 /usr/lib/jvm/java-1.8.0-amazon-corretto/bin/java -Xms2g -Xmx2g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction= 75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty。 noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -XX:+HeapDumpOnOutOfMemoryError -Des.path .home=/work/imail/elasticsearch-5.6.16 -cp /work/imail/elasticsearch-5.6.16/lib/* org.elasticsearch.bootstrap.Elasticsearch -d

ES日志:

[2024-05-06T07:06:59,672][INFO ][o.e.n.Node               ] [mirs0001] starting ... [2024-05-06T07:06:59,825][INFO ][o.e.t.TransportService   ] [mirs0001] publish_address {[::1]:9300}, bound_addresses {[::1]:9300} [2024-05-06T07:07:02,899][INFO ][o.e.c.s.ClusterService   ] [mirs0001] new_master {mirs0001}{d8OPQqqNTE-7Bt6CBo7i9w}{xsI4G2KwR5iZSVP7RXI-oA}{localhost}{[::1]:9300}, reason: zen-disco-elected-as-master ([0] nodes joined) [2024-05-06T07:07:02,926][INFO ][o.e.h.n.Netty4HttpServerTransport] [mirs0001] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200} [2024-05-06T07:07:02,938][INFO ][o.e.n.Node               ] [mirs0001] started [2024-05-06T07:07:02,944][INFO ][o.e.g.GatewayService     ] [mirs0001] recovered [0] indices into cluster_state

如何自动创建索引?

elasticsearch microservices backend elasticsearch-5
1个回答
0
投票

您可以检查您的集群设置吗

action.auto_create_index
?如果设置为
false
,您将无法自动创建索引。

您可以运行以下命令使其再次启用。

PUT _cluster/settings
{
  "persistent": {
    "action.auto_create_index": "true" 
  }
}

注意:默认启用

(true)

https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation

© www.soinside.com 2019 - 2024. All rights reserved.