解决Elasticsearch索引只读

今天添加索引时发现kibana添加索引不生效,页面也没有报错,没有创建成功只是一闪而过。

另外发现各项目日志与当前时间差异很大,filebeat一直报错io timeout

具体报错如下:

filebeat无法给logstash传输数。

ip使用x代替

logstash/async.go:235   Failed to publish events caused by: read tcp 172.17.x.x:39092->172.17.x.x:5044: i/o timeout

logstash报错如下,logstash无法给es传输数据,es一直在拒绝所有的请求

[INFO ][logstash.outputs.elasticsearch] Retrying individual bulk actions that failed or were rejected by the previous bulk request. {:count=>1}
[INFO ][logstash.outputs.elasticsearch] retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"})

报错索引只读

index read-only / allow delete (api)];"}

es报错,es报错也是索引只读错误

[2018-08-23T17:30:35,546][WARN ][o.e.x.m.e.l.LocalExporter] unexpected error while indexing monitoring document
org.elasticsearch.xpack.monitoring.exporter.ExportException: ClusterBlockException[blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];]
	at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.lambda$throwExportException$2(LocalBulk.java:134) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_144]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_144]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[?:1.8.0_144]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_144]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_144]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_144]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_144]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_144]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_144]
	at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.throwExportException(LocalBulk.java:135) ~[?:?]
	at org.elasticsearch.xpack.monitoring.exporter.local.LocalBulk.lambda$doFlush$0(LocalBulk.java:118) ~[?:?]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:59) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.ContextPreservingActionListener.onResponse(ContextPreservingActionListener.java:43) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:85) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction$1.onResponse(TransportAction.java:81) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction$BulkRequestModifier.lambda$wrapActionListenerIfNeeded$0(TransportBulkAction.java:571) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.ActionListener$1.onResponse(ActionListener.java:59) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction$BulkOperation$1.finishHim(TransportBulkAction.java:380) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction$BulkOperation$1.onFailure(TransportBulkAction.java:375) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction$1.onFailure(TransportAction.java:91) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.finishAsFailed(TransportReplicationAction.java:908) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.handleBlockException(TransportReplicationAction.java:826) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.handleBlockExceptions(TransportReplicationAction.java:814) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.doRun(TransportReplicationAction.java:712) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction.doExecute(TransportReplicationAction.java:169) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction.doExecute(TransportReplicationAction.java:97) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:167) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.xpack.security.action.filter.SecurityActionFilter.apply(SecurityActionFilter.java:125) ~[?:?]
	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:165) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:139) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:81) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction$BulkOperation.doRun(TransportBulkAction.java:350) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction.executeBulk(TransportBulkAction.java:462) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction.doExecute(TransportBulkAction.java:175) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.bulk.TransportBulkAction.lambda$processBulkIndexIngestRequest$4(TransportBulkAction.java:514) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.ingest.PipelineExecutionService$2.doRun(PipelineExecutionService.java:98) [elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) [elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-6.0.0.jar:6.0.0]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
Caused by: org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];
	at org.elasticsearch.cluster.block.ClusterBlocks.indexBlockedException(ClusterBlocks.java:182) ~[elasticsearch-6.0.0.jar:6.0.0]
	at org.elasticsearch.action.support.replication.TransportReplicationAction$ReroutePhase.handleBlockExceptions(TransportReplicationAction.java:812) ~[elasticsearch-6.0.0.jar:6.0.0]
	... 20 more

解决办法1
在kibana开发控制台执行下面语句即可

PUT _settings
    {
    "index": {
    "blocks": {
    "read_only_allow_delete": "false"
    }
    }
    }

解决方法2

如果kibana无法执行命令,可以使用下面命令解决

curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'

一旦在存储超过95%的磁盘中的节点上分配了一个或多个分片的任何索引,该索引将被强制进入只读模式

如图所示

再次查看日志信息,问题成功解决!

380 thoughts on “解决Elasticsearch索引只读”

  1. Pingback: kertvbs.webgarden.com
  2. Pingback: buy generic cialis
  3. Pingback: buy tadalafil online
  4. Pingback: canadian medications
  5. Pingback: online pharmacies
  6. Pingback: trust pharmacy canada
  7. Pingback: canada pharmacy
  8. Pingback: canada drug pharmacy
  9. Pingback: site102906154.fo.team
  10. Pingback: hekluy.ucraft.site
  11. Pingback: site592154748.fo.team
  12. Pingback: aonubs.website2.me
  13. Pingback: dkyubn.bizwebs.com
  14. Pingback: drugstore online
  15. Pingback: pharmacy.prodact.site
  16. Pingback: canada drug
  17. Pingback: site955305180.fo.team
  18. Pingback: site841934642.fo.team
  19. Pingback: viagra canada
  20. Pingback: cialis.iwopop.com
  21. Pingback: buy viagra 25mg
  22. Pingback: drugstore online
  23. Pingback: hkwerf.micro.blog
  24. Pingback: canadadrugs
  25. Pingback: canadian pharmacy
  26. Pingback: kawers.micro.blog
  27. Pingback: buy cialis delhi
  28. Pingback: buy generic cialis
  29. Pingback: laswert.wordpress.com
  30. Pingback: buy cialis cheap
  31. Pingback: kalwer.micro.blog
  32. Pingback: buy cialis usa
  33. Pingback: drugs for sale
  34. Pingback: canada medication
  35. Pingback: buy viagra online
  36. Pingback: buy viagra usa
  37. Pingback: canada drug pharmacy
  38. Pingback: drugs for sale
  39. Pingback: stromectol usa
  40. Pingback: ivermectina
  41. Pingback: canadian viagra
  42. Pingback: what is stromectol
  43. Pingback: stromectol france
  44. Pingback: dose for stromectol
  45. Pingback: canadian pharmacys
  46. Pingback: buy viagra online usa
  47. Pingback: challonge.comesapenti
  48. Pingback: buy viagra cheap
  49. Pingback: dsdgbvda.zombeek.cz
  50. Pingback: online drug store
  51. Pingback: canadian pharmacy
  52. Pingback: drugstore online
  53. Pingback: online pharmacies
  54. Pingback: buy viagra now
  55. Pingback: canadian drugs
  56. Pingback: stromectol nz
  57. Pingback: discount stromectol
  58. Pingback: buy stromectol
  59. Pingback: canadian viagra
  60. Pingback: stromectol biam
  61. Pingback: generic stromectol
  62. Pingback: canadian drug
  63. Pingback: stromectol biam
  64. Pingback: stromectol generic
  65. Pingback: stromectol india
  66. Pingback: canada pharmacy
  67. Pingback: canada drugs
  68. Pingback: buy viagra usa
  69. Pingback: online drug store
  70. Pingback: challonge.comebocivid
  71. Pingback: obsusilli.zombeek.cz
  72. Pingback: Canadian Pharmacy USA
  73. Pingback: canada pharmacies
  74. Pingback: canada drugs online

发表回复