首页 > 解决方案 > 将 Elasticsearch 的 http_port 号改为 80

问题描述

我正在尝试在 Ubuntu 18.04 上设置 ELK,我现在只有端口 80 来测试 Elasticsearch 仪表板,所以我修改了 elasticsearch.yml,如下所示

# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: x.x.x.x
#
# Set a custom port for HTTP:
#
http.port: 80
#
# For more information, consult the network module documentation.
#

但是在logstash日志中它说

[2019-05-10T08:46:01,216][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://x.x.x.x:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://x.x.x.x:9200/][Manticore::SocketException] Connection refused (Connection refused)"}

我认为它试图在 9200 上找到 elasticsearch ..

对此的任何帮助将不胜感激

标签: elasticsearch

解决方案


You need to edit the output port of logstash, you can look it up here.

input { stdin { } }

filter {
  grok {
    match => { "message" => "%{COMBINEDAPACHELOG}" }
  }
  date {
    match => [ "timestamp" , "dd/MMM/yyyy:HH:mm:ss Z" ]
  }
}

output {
  elasticsearch { hosts => ["localhost:9200"] }  <-- change this
  stdout { codec => rubydebug }
}

推荐阅读