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}
- 解决方案
链接