首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >启动elasticsearch-2.0时遇到困难

启动elasticsearch-2.0时遇到困难
EN

Stack Overflow用户
提问于 2022-03-21 15:00:38
回答 1查看 95关注 0票数 0

我最近遇到了一个问题,我无法启动elasticsearch。

2.0版操作系统: Linux

显示了一个错误消息。

代码语言:javascript
复制
    [ERROR][gateway                  ] [Node] failed to read local state, exiting...
    ElasticsearchException[must specify numberOfShards for index [version]]; nested: IllegalArgumentException[must specify numberOfShards for index [version]];
at org.elasticsearch.ExceptionsHelper.maybeThrowRuntimeAndSuppress(ExceptionsHelper.java:163)
        at org.elasticsearch.gateway.MetaDataStateFormat.loadLatestState(MetaDataStateFormat.java:309)
        at org.elasticsearch.gateway.MetaStateService.loadIndexState(MetaStateService.java:112)
        at org.elasticsearch.gateway.MetaStateService.loadFullState(MetaStateService.java:97)
        at org.elasticsearch.gateway.GatewayMetaState.loadMetaState(GatewayMetaState.java:97)
        at org.elasticsearch.gateway.GatewayMetaState.pre20Upgrade(GatewayMetaState.java:223)
        at org.elasticsearch.gateway.GatewayMetaState.<init>(GatewayMetaState.java:85)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:56)

如何启动弹性搜索?

编辑01:

我已经将碎片和副本放在elasticsearch.yml文件中,但仍然无法启动elasticsearch。获取上述错误消息。

编辑02:

我已将碎片添加到yml文件中。

代码语言:javascript
复制
#################################### Index ####################################

# You can set a number of options (such as shard/replica options, mapping
# or analyzer definitions, translog settings, ...) for indices globally,
# in this file.
#
# Note, that it makes more sense to configure index settings specifically for
# a certain index, either when creating it or by using the index templates API.
#
# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
# for more information.

# Set the number of shards (splits) of an index (5 by default):
#
index.number_of_shards: 2

# Set the number of replicas (additional copies) of an index (1 by default):
#
index.number_of_replicas: 1
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-30 07:23:15

我们继续将服务器恢复到elasticsearch工作的前一天,问题就解决了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71559690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档