golang 使用 es 遇到的问题

golang 使用 es 遇到的问题

1.使用Golang客户端连接docker中es报错:

no active connection found: no Elasticsearch node available
使用的第三方库:"github.com/olivere/elastic"

节点的 es ip 必须使用 本机ip,不能使用 127.0.0.1 或者 localhost

 ,其他地方可以不用指定,否则必须显性的指示操作的type

es7 type 只能为 _doc 可以省略 

3. docker 启动 es 报找不到如下文件(.DS_Store) usr/share/elasticsearch/plugins/.DS_Store/plugin-descriptor.properties

https://blog.csdn.net/jiangxiulilinux/article/details/102895795

2. es6 mapping 如果指定了type ,其他地方可以不用指定,否则必须显性的指示操作的type
3. docker 启动 es 报找不到如下文件(.DS_Store) usr/share/elasticsearch/plugins/.DS_Store/plugin-descriptor.properties

解决方法
https://blog.csdn.net/jiangxiulilinux/article/details/102895795

先 cd /data/apps/elasticsearch/plugins,然后执行如下命令

find . -name '*.DS_Store' -type f -delete
4. 逗号分词器,使用时必须要在 setting 中声明
"settings": {
        "index": {
            "number_of_shards": "5",
            "number_of_replicas": 1
        },
        "analysis": {
            "analyzer": {
                "comma": {
                    "type": "pattern",
                    "pattern": ","
                }
            }
        }
    }
5. KIBANA连接ES显示CANNOT CONNECT TO THE ELASTICSEARCH CLUSTERSEE THE KIBANA LOGS FOR DETAILS AND TRY RELOA

解决方案

6. 查询报错
  • 报错信息
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"[parent] Data too large, data for [<http_request>] would be [124843524/119mb], which is larger than the limit of [123273216/117.5mb], real usage: [124841776/119mb], new bytes reserved: [1748/1.7kb], usages [request=0/0b, fielddata=1582/1.5kb, in_flight_requests=1748/1.7kb, accounting=25189/24.5kb]","bytes_wanted":124843524,"bytes_limit":123273216,"durability":"PERMANENT"}],"type":"circuit_breaking_exception","reason":"[parent] Data too large, data for [<http_request>] would be [124843524/119mb], which is larger than the limit of [123273216/117.5mb], real usage: [124841776/119mb], new bytes reserved: [1748/1.7kb], usages [request=0/0b, fielddata=1582/1.5kb, in_flight_requests=1748/1.7kb, accounting=25189/24.5kb]","bytes_wanted":124843524,"bytes_limit":123273216,"durability":"PERMANENT"},"status":429}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值