好的想法是十分钱一打,真正无价的是能够实现这些想法的人。

Content-Type header [application/x-ldjson] is not supported

回复

maschzh 发起了问题 • 1 人关注 • 0 个回复 • 3908 次浏览 • 2017-12-26 21:40 • 来自相关话题

ES官方有出认证的计划吗?类似hortonworks 的HDPCD 这种认证

medcl 回复了问题 • 2 人关注 • 1 个回复 • 2661 次浏览 • 2017-12-28 23:04 • 来自相关话题

哪位大神安装过elasticsearch-hanlp这个分词插件,遇到点问题,求指教

kepmoving 回复了问题 • 2 人关注 • 1 个回复 • 2971 次浏览 • 2017-12-26 17:49 • 来自相关话题

RestHighLevelClient 连接es6集群在在RestClient builder里面加入多个host吗?

回复

longveeshaw 发起了问题 • 1 人关注 • 0 个回复 • 3537 次浏览 • 2017-12-26 16:39 • 来自相关话题

父子文档 可以两个类型同时是一个类型的孩子吗?

回复

wangshuoqiong 发起了问题 • 1 人关注 • 0 个回复 • 2355 次浏览 • 2017-12-26 15:34 • 来自相关话题

elasticsearch 6.1.1使用ik分词远程拓展字典报错

vearne 回复了问题 • 3 人关注 • 2 个回复 • 2933 次浏览 • 2018-06-11 11:29 • 来自相关话题

es 将默认的日期匹配设置为seconds-since-the-epoch

回复

shwtz 回复了问题 • 1 人关注 • 1 个回复 • 9643 次浏览 • 2018-01-05 11:19 • 来自相关话题

请教下创建字段的一个疑问

回复

diji99 发起了问题 • 1 人关注 • 0 个回复 • 2897 次浏览 • 2017-12-25 18:27 • 来自相关话题

elasticsearch 如何实现如下sql语句

huigy 回复了问题 • 3 人关注 • 2 个回复 • 2754 次浏览 • 2017-12-26 08:02 • 来自相关话题

Elasticsearch集群不稳定,node_disconnected_exception

fangw 回复了问题 • 4 人关注 • 2 个回复 • 5790 次浏览 • 2019-10-22 09:37 • 来自相关话题

将txt文本数据导入elasticsearch

laoyang360 回复了问题 • 2 人关注 • 1 个回复 • 4739 次浏览 • 2017-12-25 20:16 • 来自相关话题

elasticsearch5.2.2连接集群 报错 Unknown NamedWriteable

shwtz 回复了问题 • 2 人关注 • 2 个回复 • 6783 次浏览 • 2017-12-25 17:22 • 来自相关话题

elasticsearch集群状态的疑问

medcl 回复了问题 • 4 人关注 • 2 个回复 • 2483 次浏览 • 2018-01-16 11:01 • 来自相关话题

如何计算某个字段满足一定条件的值的个数占总个数的比例

回复

hellowWorld 发起了问题 • 1 人关注 • 0 个回复 • 2961 次浏览 • 2017-12-24 14:41 • 来自相关话题

Elasticsearch关于unassigned shards修复

arterforyou 发表了文章 • 2 个评论 • 6601 次浏览 • 2017-12-23 12:23 • 来自相关话题

ES 版本: 5.2.1


步骤:

  • curl localhost:9200/_cat/shards > shards
  • 跑脚本:nohup python recovery.py &

    注意:跑脚本过程会返回大量json,时间较长,请注意放入后台

  • 查看修复shard进度:curl 127.0.0.1:9200/_cat/recovery/你修复shard对应的索引
  • 结果: 找到索引对应的shard,看到existing_store done说明已经从本地修复
    shell<br /> index 19 268ms existing_store done n/a n/a 10.0.58.67 node_name<br />

    ```python

    !/usr/bin/env python

    name: recovery.py


    import requests
    import json
    host = "<a href="http://localhost:9200/_cluster/allocation/explain"" rel="nofollow" target="_blank">http://localhost:9200/_cluster ... ot%3B
    s= requests.Session()
    def reroute_shard(index,shard,node):
    data = {
    "commands" : [
    {
    "allocate_stale_primary" : {
    "index" : index, "shard" : shard, "node" : node, "accept_data_loss": True
    }
    }
    ]
    }
    print data
    url = "<a href="http://localhost:9200/_cluster/reroute"" rel="nofollow" target="_blank">http://localhost:9200/_cluster/reroute"
    res = s.post(url,json=data)
    print res

    def get_node(line):
    if "UNASSIGNED" in line:
    line = line.split()
    index = line[0]
    shard = line[1]
    if line[2] != "p":
    return
    body = {
    "index": index,
    "shard": shard,
    "primary": True
    }
    res = s.get(host, json = body)
    for store in res.json().get("node_allocation_decisions"):
    if store.get("store").get("allocation_id"):
    node_name = store.get("node_name")
    reroute_shard(index,shard,node_name)
    else:
    return

    with open("shards", 'rb') as f:
    map(get_node,f)
    ```

    相关文档: