Elasticsearch 7.x 错误集锦

1. 借鉴

Elasticsearch断电后启动异常(这篇文章不适合我们的7.x,但是仍有借鉴意义)
官方网站 elasticsearch-shard
码农人生

2. 开始

- 错误:Cannot apply [*] operation to types [java.lang.Double] and [org.elasticsearch.index.fielddata.ScriptDocValues.Longs].

比如以下脚本:

GET hot_city/_search
{
  "script_fields": {
    "formative": {
      "script": {
        "source": "params._source.city + ( params.markup * doc['hot'] )",
        "params": {
          "markup": 0.2
        }
      }
    }
  }
}

解决方法:

doc['hot'] 变为 doc['hot'].value

- 错误:failed to recover from translog

future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/src/jdk/jdk1.8.0_191.jdk/jre] does not meet this requirement
[2020-04-04T19:59:05,323][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/home (/dev/disk1s5)]], net usable_space [31.6gb], net total_space [186.2gb], types [apfs]
[2020-04-04T19:59:05,325][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [989.8mb], compressed ordinary object pointers [true]
[2020-04-04T19:59:05,573][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [7VYDXI3wSdSZLz6AIPQXEw], cluster name [dianping-app]
[2020-04-04T19:59:05,574][INFO ][o.e.n.Node               ] [node-1] version[7.3.0], pid[1895], build[default/tar/de777fa/2019-07-24T18:30:11.767338Z], OS[Mac OS X/10.14.6/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_191/25.191-b12]
[2020-04-04T19:59:05,574][INFO ][o.e.n.Node               ] [node-1] JVM home [/usr/local/src/jdk/jdk1.8.0_191.jdk/jre]
[2020-04-04T19:59:05,574][INFO ][o.e.n.Node               ] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/var/folders/j9/lppxvpcj5xv2b22nq98ny21h0000gn/T/elasticsearch-8742906994448868745, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Dio.netty.allocator.type=unpooled, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/home/elasticsearch/7.3.0/elasticsearch-node1, -Des.path.conf=/home/elasticsearch/7.3.0/elasticsearch-node1/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2020-04-04T19:59:07,201][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [aggs-matrix-stats]
[2020-04-04T19:59:07,202][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [analysis-common]
[2020-04-04T19:59:07,202][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [data-frame]
[2020-04-04T19:59:07,202][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [flattened]
[2020-04-04T19:59:07,203][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-common]
[2020-04-04T19:59:07,203][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-geoip]
[2020-04-04T19:59:07,203][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-user-agent]
[2020-04-04T19:59:07,203][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-expression]
[2020-04-04T19:59:07,203][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-mustache]
[2020-04-04T19:59:07,204][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-painless]
[2020-04-04T19:59:07,204][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [mapper-extras]
[2020-04-04T19:59:07,204][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [parent-join]
[2020-04-04T19:59:07,205][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [percolator]
[2020-04-04T19:59:07,205][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [rank-eval]
[2020-04-04T19:59:07,205][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [reindex]
[2020-04-04T19:59:07,205][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [repository-url]
[2020-04-04T19:59:07,206][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty4]
[2020-04-04T19:59:07,206][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [vectors]
[2020-04-04T19:59:07,206][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ccr]
[2020-04-04T19:59:07,207][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-core]
[2020-04-04T19:59:07,207][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-deprecation]
[2020-04-04T19:59:07,207][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-graph]
[2020-04-04T19:59:07,208][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ilm]
[2020-04-04T19:59:07,208][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-logstash]
[2020-04-04T19:59:07,208][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ml]
[2020-04-04T19:59:07,208][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-monitoring]
[2020-04-04T19:59:07,209][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-rollup]
[2020-04-04T19:59:07,209][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-security]
[2020-04-04T19:59:07,209][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-sql]
[2020-04-04T19:59:07,209][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-voting-only-node]
[2020-04-04T19:59:07,209][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-watcher]
[2020-04-04T19:59:07,210][INFO ][o.e.p.PluginsService     ] [node-1] loaded plugin [analysis-hanlp]
[2020-04-04T19:59:07,210][INFO ][o.e.p.PluginsService     ] [node-1] loaded plugin [analysis-ik]
[2020-04-04T19:59:07,210][INFO ][o.e.p.PluginsService     ] [node-1] loaded plugin [analysis-pinyin]


[2020-04-04T19:59:10,111][INFO ][o.e.x.s.a.s.FileRolesStore] [node-1] parsed [0] roles from file [/home/elasticsearch/7.3.0/elasticsearch-node1/config/roles.yml]



[2020-04-04T19:59:10,571][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/1911] [Main.cc@110] controller (64 bit): Version 7.3.0 (Build ff2f774f78ce63) Copyright (c) 2019 Elasticsearch BV

[2020-04-04T19:59:10,886][DEBUG][o.e.a.ActionModule       ] [node-1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2020-04-04T19:59:11,389][INFO ][o.e.d.DiscoveryModule    ] [node-1] using discovery type [zen] and seed hosts providers [settings]
[2020-04-04T19:59:12,008][INFO ][o.e.n.Node               ] [node-1] initialized
[2020-04-04T19:59:12,008][INFO ][o.e.n.Node               ] [node-1] starting ...
[2020-04-04T19:59:12,135][INFO ][o.e.t.TransportService   ] [node-1] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2020-04-04T19:59:12,170][WARN ][o.e.b.BootstrapChecks    ] [node-1] the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[2020-04-04T19:59:12,176][INFO ][o.e.c.c.Coordinator      ] [node-1] cluster UUID [wC6QP5IoQZG0zjFCtPGgWA]
[2020-04-04T19:59:12,187][INFO ][o.e.c.c.ClusterBootstrapService] [node-1] no discovery configuration found, will perform best-effort cluster bootstrapping after [3s] unless existing master is discovered
[2020-04-04T19:59:12,307][INFO ][o.e.c.s.MasterService    ] [node-1] elected-as-master ([1] nodes joined)[{node-1}{7VYDXI3wSdSZLz6AIPQXEw}{zM_oCqjxSj6xIVTEDxPVTA}{127.0.0.1}{127.0.0.1:9300}{dim}{ml.machine_memory=17179869184, xpack.installed=true, ml.max_open_jobs=20} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 30, version: 1788, reason: master node changed {previous [], current [{node-1}{7VYDXI3wSdSZLz6AIPQXEw}{zM_oCqjxSj6xIVTEDxPVTA}{127.0.0.1}{127.0.0.1:9300}{dim}{ml.machine_memory=17179869184, xpack.installed=true, ml.max_open_jobs=20}]}
[2020-04-04T19:59:12,593][INFO ][o.e.c.s.ClusterApplierService] [node-1] master node changed {previous [], current [{node-1}{7VYDXI3wSdSZLz6AIPQXEw}{zM_oCqjxSj6xIVTEDxPVTA}{127.0.0.1}{127.0.0.1:9300}{dim}{ml.machine_memory=17179869184, xpack.installed=true, ml.max_open_jobs=20}]}, term: 30, version: 1788, reason: Publication{term=30, version=1788}
[2020-04-04T19:59:12,623][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2020-04-04T19:59:12,624][INFO ][o.e.n.Node               ] [node-1] started
[2020-04-04T19:59:12,758][INFO ][o.e.c.s.ClusterSettings  ] [node-1] updating [xpack.monitoring.collection.enabled] from [false] to [true]
[2020-04-04T19:59:12,759][INFO ][o.e.c.s.ClusterSettings  ] [node-1] updating [action.auto_create_index] from [true] to [.app-search-*-logs-*,-.app-search-*,+*]
[2020-04-04T19:59:12,934][INFO ][o.e.l.LicenseService     ] [node-1] license [e787b989-4b2a-4742-99cc-c59926df2487] mode [basic] - valid
[2020-04-04T19:59:12,934][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [node-1] Active license is now [BASIC]; Security is disabled
[2020-04-04T19:59:12,941][INFO ][o.e.g.GatewayService     ] [node-1] recovered [117] indices into cluster_state
[2020-04-04T19:59:13,031][INFO ][c.h.d.c.RemoteDictConfig ] [node-1] try load remote hanlp config from /home/elasticsearch/7.3.0/elasticsearch-node1/config/analysis-hanlp/hanlp-remote.xml
[2020-04-04T19:59:13,079][INFO ][o.w.a.d.Monitor          ] [node-1] try load config from /home/elasticsearch/7.3.0/elasticsearch-node1/config/analysis-ik/IKAnalyzer.cfg.xml
[2020-04-04T19:59:13,230][INFO ][o.w.a.d.Monitor          ] [node-1] [Dict Loading] /home/elasticsearch/7.3.0/elasticsearch-node1/config/analysis-ik/new_word.dic
[2020-04-04T19:59:17,946][WARN ][o.e.i.e.Engine           ] [node-1] [.monitoring-es-7-2020.04.04][0] failed engine [failed to recover from translog]
org.elasticsearch.index.engine.EngineException: failed to recover from translog
    at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslogInternal(InternalEngine.java:468) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslog(InternalEngine.java:438) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslog(InternalEngine.java:125) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.openEngineAndRecoverFromTranslog(IndexShard.java:1480) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.StoreRecovery.internalRecoverFromStore(StoreRecovery.java:433) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.StoreRecovery.lambda$recoverFromStore$0(StoreRecovery.java:95) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.StoreRecovery.executeRecovery(StoreRecovery.java:308) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.StoreRecovery.recoverFromStore(StoreRecovery.java:93) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.recoverFromStore(IndexShard.java:1752) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.lambda$startRecovery$10(IndexShard.java:2406) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:688) [elasticsearch-7.3.0.jar:7.3.0]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_191]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_191]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_191]
Caused by: org.elasticsearch.index.translog.TranslogCorruptedException: translog from source [/home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog/translog-2.tlog] is corrupted, translog truncated
    at org.elasticsearch.index.translog.TranslogSnapshot.readBytes(TranslogSnapshot.java:107) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.BaseTranslogReader.readSize(BaseTranslogReader.java:79) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.TranslogSnapshot.readOperation(TranslogSnapshot.java:80) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.TranslogSnapshot.next(TranslogSnapshot.java:70) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.MultiSnapshot.next(MultiSnapshot.java:69) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.runTranslogRecovery(IndexShard.java:1438) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.lambda$openEngineAndRecoverFromTranslog$6(IndexShard.java:1476) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslogInternal(InternalEngine.java:466) ~[elasticsearch-7.3.0.jar:7.3.0]
    ... 13 more
Caused by: java.io.EOFException: read past EOF. pos [44544181] length: [4] end: [44544181]
    at org.elasticsearch.common.io.Channels.readFromFileChannelWithEofException(Channels.java:103) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.TranslogSnapshot.readBytes(TranslogSnapshot.java:105) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.BaseTranslogReader.readSize(BaseTranslogReader.java:79) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.TranslogSnapshot.readOperation(TranslogSnapshot.java:80) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.TranslogSnapshot.next(TranslogSnapshot.java:70) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.translog.MultiSnapshot.next(MultiSnapshot.java:69) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.runTranslogRecovery(IndexShard.java:1438) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.shard.IndexShard.lambda$openEngineAndRecoverFromTranslog$6(IndexShard.java:1476) ~[elasticsearch-7.3.0.jar:7.3.0]
    at org.elasticsearch.index.engine.InternalEngine.recoverFromTranslogInternal(InternalEngine.java:466) ~[elasticsearch-7.3.0.jar:7.3.0]
    ... 13 more
  • 好吧,生产上遇到介种事情的概率还是比较大的吧,挖掘机铲掉了电缆拉之类的。。你掉电就掉电,好吧translog也损坏了,咋整,启动起来就报错。
  • 看了一下官方文档,先把node停了,再执行以下语句,然后启动起来重入数据可以了-_-

./elasticsearch-shard remove-corrupted-data --index .monitoring-es-7-2020.04.04 --shard-id 0

  • 下面这些是执行上面命令的输出,中间有一步需要你确认
future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/src/jdk/jdk1.8.0_191.jdk/jre] does not meet this requirement
ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization logging. See https://logging.apache.org/log4j/2.x/manual/configuration.html for instructions on how to configure Log4j 2
-----------------------------------------------------------------------

    WARNING: Elasticsearch MUST be stopped before running this tool.

  Please make a complete backup of your index before using this tool.

-----------------------------------------------------------------------

Opening Lucene index at /home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/index

NaN% total deletions; 0 documents; 0 deleteions
Segments file=segments_2 numSegments=0  id=amu3q8ipkzm8ztems2z3fswia userData={history_uuid=jJ6NkhAdRvi8vZHDB4O2yQ, local_checkpoint=-1, max_seq_no=-1, max_unsafe_auto_id_timestamp=-1, translog_generation=1, translog_uuid=HLqn4Q0iSNGyEF8w16RWyw}
No problems were detected with this index.

Took 0.027 sec total.

 >> Lucene index is clean at /home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/index


Opening translog at /home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog


 >> Translog is corrupted at /home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog

-----------------------------------------------------------------------

  Documents inside of translog files will be lost.
  The following files will be DELETED at /home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog

  --> translog-1.ckp
  --> translog-1.tlog
  --> translog-10.ckp
  --> translog-10.tlog
  --> translog-11.ckp
  --> translog-11.tlog
  --> translog-12.ckp
  --> translog-12.tlog
  --> translog-13.ckp
  --> translog-13.tlog
  --> translog-14.ckp
  --> translog-14.tlog
  --> translog-15.ckp
  --> translog-15.tlog
  --> translog-16.ckp
  --> translog-16.tlog
  --> translog-17.ckp
  --> translog-17.tlog
  --> translog-18.ckp
  --> translog-18.tlog
  --> translog-19.ckp
  --> translog-19.tlog
  --> translog-2.ckp
  --> translog-2.tlog
  --> translog-20.ckp
  --> translog-20.tlog
  --> translog-21.ckp
  --> translog-21.tlog
  --> translog-22.ckp
  --> translog-22.tlog
  --> translog-23.ckp
  --> translog-23.tlog
  --> translog-24.ckp
  --> translog-24.tlog
  --> translog-25.ckp
  --> translog-25.tlog
  --> translog-26.ckp
  --> translog-26.tlog
  --> translog-27.ckp
  --> translog-27.tlog
  --> translog-28.ckp
  --> translog-28.tlog
  --> translog-29.ckp
  --> translog-29.tlog
  --> translog-3.ckp
  --> translog-3.tlog
  --> translog-30.ckp
  --> translog-30.tlog
  --> translog-31.ckp
  --> translog-31.tlog
  --> translog-32.ckp
  --> translog-32.tlog
  --> translog-33.ckp
  --> translog-33.tlog
  --> translog-34.ckp
  --> translog-34.tlog
  --> translog-35.ckp
  --> translog-35.tlog
  --> translog-36.ckp
  --> translog-36.tlog
  --> translog-37.ckp
  --> translog-37.tlog
  --> translog-38.ckp
  --> translog-38.tlog
  --> translog-39.ckp
  --> translog-39.tlog
  --> translog-4.ckp
  --> translog-4.tlog
  --> translog-40.ckp
  --> translog-40.tlog
  --> translog-41.ckp
  --> translog-41.tlog
  --> translog-42.tlog
  --> translog-5.ckp
  --> translog-5.tlog
  --> translog-6.ckp
  --> translog-6.tlog
  --> translog-7.ckp
  --> translog-7.tlog
  --> translog-8.ckp
  --> translog-8.tlog
  --> translog-9.ckp
  --> translog-9.tlog
  --> translog.ckp

            WARNING:              YOU MAY LOSE DATA.
-----------------------------------------------------------------------
Continue and remove corrupted data from the shard ?
Confirm [y/N] y
Checking existing translog files
Reading translog UUID information from Lucene commit from shard at [/home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/index]
Translog Generation: 1
Translog UUID      : HLqn4Q0iSNGyEF8w16RWyw
History UUID       : -wCtd60NQhSx1VRLRbvkBw
Removing existing translog files
Creating new empty checkpoint at [/home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog/translog.ckp]
Creating new empty translog at [/home/elasticsearch/7.3.0/elasticsearch-node1/data/nodes/0/indices/bmfWYSwISO-bP-bsAHZY5g/0/translog/translog-1.tlog]
Marking index with the new history uuid : OnC1hG9eTbK0OmwN_SrgfA
Changing allocation id UaQJUlYlRGiUArrEML6HHg to AO9RcULNR26Xx7H4qYtvpw

You should run the following command to allocate this shard:

POST /_cluster/reroute'
{
  "commands" : [
    {
      "allocate_stale_primary" : {
        "index" : ".monitoring-es-7-2020.04.04",
        "shard" : 0,
        "node" : "7VYDXI3wSdSZLz6AIPQXEw",
        "accept_data_loss" : false
      }
    }
  ]
}'

You must accept the possibility of data loss by changing parameter `accept_data_loss` to `true`.

--index和--shard-id从[.monitoring-es-7-2020.04.04][0] failed engine [failed to recover from translog]这句话里面找

3. 大功告成

持续更新

你可能感兴趣的:(Elasticsearch 7.x 错误集锦)