记录一次es的"不清楚"报错
场景:本地安装es版本7.8.1,安装kibana7.8.1,首先启动es,接着启动kibana,创建一个索引,创建语句如下:
PUT index_ship_track_2022-08-01
{
"settings": {
"index":{
"number_of_shards": 2,
"number_of_replicas": 1
}
},
"mappings": {
"properties": {
"cog": {
"type": "keyword"
},
"dsource": {
"type": "keyword"
},
"latitude": {
"type": "keyword"
},
"location": {
"type": "geo_point"
}
}
}
}
准备插入一条数据:
PUT index_ship_track_2022-08-01
{
"receive_time" : "2022-08-01 06:12:53",
"messageid" : "wwxF8XF69HmWaLUe5uDT",
"sog" : "44",
"cog" : "44",
"location" : "45.945457,-144.5444666"
}
一直百度插入语句的问题,创建索引的问题,都没有找到真正的原因,这个时候看到es的后台打印日志如下:
报错如下:[C:\soft\elasticsearch-7.8.1-windows-x86_64\elasticsearch-7.8.1\data\nodes\0] free: 15.2gb[6.4%], shards will be relocated away from this node; currently relocating away shards totalling [0] bytes; the node is expected to continue to exceed the high disk watermark when ....
真正原因是:机器剩余磁盘空间不足,然后删除本地无用文件
并百度到可修改es的elasticserach.yml加入一句话
cluster.routing.allocation.disk.threshold_enabled: false
重启es和kibana后查询数据可以,但是插入数据还是报同样得错误,此时es不再报错磁盘空间不足,原因是插入语句写错,应改为一下语句:
POST index_ship_track_2022-08-01/_doc/wwxF8XF69HmWaLUe5uDT
{
"receive_time" : "2022-08-26 06:12:53",
"messageid" : "wwxF8XF69HmWaLUe5uDT",
"sog" : "44",
"cog" : "44",
"location" : "66.6,-143.44"
}
以上插入完成