V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhangmengyu
V2EX  ›  Elasticsearch

求助! es 分片不能挂载到索引上~TAT~

  •  
  •   zhangmengyu · 2019-03-25 10:45:20 +08:00 · 3053 次点击
    这是一个创建于 2068 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前不小心删掉了 es 的 /home/plog/elk/data/elasticsearch-data 下的文件,后来 es 健康状态报红( "status" : "red")。
    重启集群,日志报找不到 /home/plog/elk/data/elasticsearch-data/nodes/0/node.lock。
    然后我单独启动每台服务器的 es,可以自动生成 node.lock。解决了 cannot find file 的问题。
    但是 es 状态依然报红,日志报错 failed to write index state,原因是 node.lock 该文件被外力更改了,请问大佬我该怎么解决这个问题,蓝瘦 QAQ,报错如下:

    [2019-03-25T10:23:32,610][WARN ][o.e.g.MetaStateService   ] [es] [[test_2019.03.10/L3uPPm-vSSW_aG6Qvzih5A]]: failed to write index state
    org.apache.lucene.store.AlreadyClosedException: Underlying file changed by an external force at 2019-03-25T02:03:45.489478Z, (lock=NativeFSLock(path=/home/plog/elk/data/elasticsearch-data/nodes/0/node.lock,impl=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid],creationTime=2019-02-27T08:51:35.409994Z))
    	at org.apache.lucene.store.NativeFSLockFactory$NativeFSLock.ensureValid(NativeFSLockFactory.java:191) ~[lucene-core-7.5.0.jar:7.5.0 b5bf70b7e32d7ddd9742cc821d471c5fabd4e3df - jimczi - 2018-09-18 13:01:13]
    	at org.elasticsearch.env.NodeEnvironment.assertEnvIsLocked(NodeEnvironment.java:999) ~[elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.env.NodeEnvironment.indexPaths(NodeEnvironment.java:798) ~[elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.gateway.MetaStateService.writeIndex(MetaStateService.java:124) ~[elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.gateway.GatewayMetaState.applyClusterState(GatewayMetaState.java:173) ~[elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.cluster.service.ClusterApplierService.lambda$callClusterStateAppliers$6(ClusterApplierService.java:481) ~[elasticsearch-6.5.4.jar:6.5.4]
    	at java.lang.Iterable.forEach(Iterable.java:75) [?:1.8.0_202]
    	at org.elasticsearch.cluster.service.ClusterApplierService.callClusterStateAppliers(ClusterApplierService.java:478) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.cluster.service.ClusterApplierService.applyChanges(ClusterApplierService.java:465) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.cluster.service.ClusterApplierService.runTask(ClusterApplierService.java:416) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.cluster.service.ClusterApplierService$UpdateTask.run(ClusterApplierService.java:160) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:624) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedEsThreadPoolExecutor.java:244) [elasticsearch-6.5.4.jar:6.5.4]
    	at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor.java:207) [elasticsearch-6.5.4.jar:6.5.4]
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_202]
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_202]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_202]
    
    3 条回复    2019-03-25 15:59:04 +08:00
    zhangmengyu
        1
    zhangmengyu  
    OP
       2019-03-25 11:28:24 +08:00
    不要沉,大佬帮看看 QAQ
    shaohan0228
        2
    shaohan0228  
       2019-03-25 13:43:10 +08:00
    不如去官方的论坛上问问原因
    zhangmengyu
        3
    zhangmengyu  
    OP
       2019-03-25 15:59:04 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3772 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 10:28 · PVG 18:28 · LAX 02:28 · JFK 05:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.