Elasticsearch 报错及解决
报错:
Fielddata is disabled on text fields by default. Set `fielddata=true` on
[`your_field_name`] in order to load fielddata in memory by uninverting the
inverted index. Note that this can however use significant memory.
报错:
[2022-09-28T11:22:13,306][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [master] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to load metadata]; nested: LockObtainFailedException[Lock held by another program: /app/elasticsearch-7.10.2/data/nodes/0/_state/write.lock];
解决:
cd /app/elasticsearch-7.10.2/data/nodes/0/_state
rm -rf write.lock
报错:
[2022-09-28T11:28:58,503][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [master] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: BindHttpException[Failed to bind to 0.0.0.0:9200]; nested: BindException[地址已在使用];
解决:
ps -ef | grep 9200
kill -9 【9220占用的进程号】
报错【版本:7.10.2】
访问kibana页面: http://49.232.142.28:5601/ 时,报错:Kibana server is not ready yet
此时,elasticsearch报错:{"type":"log","@timestamp":"2022-10-17T08:19:55Z","tags":["error","elasticsearch","data"],"pid":21103,"message":"[master_not_discovered_exception]: master_not_discovered_exception"}
解决:
配置 elasticsearch-7.10.2/config/elasticsearch.yml,修改行:cluster.initial_master_nodes: ["master"]
报错:Elasticsearch使用问题—TOO_MANY_REQUESTS/12/disk usage exceeded flood-stage watermark
启动报错:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:以root用户身份修改 /etc/sysctl.conf 文件,添加一行:vm.max_map_count = 262144,然后生效:sysctl -p