报错1

[2019-01-15T12:36:59,779][ERROR][o.e.b.Bootstrap          ] Exception
java.lang.IllegalStateException: failed to obtain node locks, tried [[/mnt/elasticsearch/data/my-application]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?

解决方法:
elasticsearch.yml 配置文件最后添加:
node.max_local_storage_nodes: 2

报错2

[2019-03-14T19:33:31,092][ERROR][logstash.outputs.elasticsearch] Attempted to send a bulk request to elasticsearch, but no there are no living connections in the connection pool. Perhaps Elasticsearch is unreachable or down? {:error_message=>"No Available connections", :class=>"LogStash::Outputs::ElasticSearch::HttpClient::Pool::NoConnectionAvailableError", :will_retry_in_seconds=>64}
[2019-03-14T19:33:34,819][INFO ][logstash.outputs.elasticsearch] Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://logstash_system:xxxxxx@localhost:9200/, :path=>"/"}

解决方法:
1、调用 ES 服务 curl http://192.168.0.166:9200:

{"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication token for REST request [/]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

发现是出现了认证失败。
2、修改 logstash.conf 在 output 段里添加:

user => 'elastic'
password => 'changeme'

3、修改 logstash.yml,添加:

xpack.monitoring.elasticsearch.url: "http://192.168.0.166:9200" 
xpack.monitoring.elasticsearch.username: "logstash_system" 
xpack.monitoring.elasticsearch.password: "changeme"

重启服务后OK。

报错3

Watcher:Error 400 Bad Request:Bad Request

Elasticsearch 错误小结_第1张图片
解决方法:

# vim elasticsearch.yml
xpack.watcher.enabled: true

重启服务后OK。