You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Elasticsearch 8.5.3登录失败:HTTP流量进入HTTPS通道告警

问题解决步骤

一、修复Elasticsearch访问问题

Elasticsearch 8.x版本默认强制启用HTTPS加密通信,用HTTP协议访问会触发明文流量告警,导致连接被关闭。

  • 改用HTTPS访问:在浏览器地址栏输入 https://localhost:9200
  • 浏览器提示「连接不安全」时,选择「高级」->「继续访问」跳过验证,然后输入elastic用户名和启动时生成的临时密码即可完成登录。
  • 若用命令行工具(如curl)测试,执行:
    curl --insecure --user elastic:你的临时密码 https://localhost:9200
    

二、调整Logstash配置适配Elasticsearch安全机制

原配置未加入HTTPS和身份验证信息,无法正常连接ES,需修改simple-config.conf:

input {
  file {
    type=>"users-ws-log"
    path=>"/path/to/users-ws.log"
  }
  file {
    type=>"albums-ws-log"
    path=>"/path/to/albums-ws.log"
  }
}

output {
  if [type] == "users-ws-log" {
    elasticsearch {
      hosts => ["https://localhost:9200"]
      index => "users-ws-%{+YYYY.MM.dd}"
      user => "elastic"
      password => "你的elastic临时密码"
      ssl => true
      ssl_certificate_verification => false # 测试环境跳过证书验证,生产建议配置信任证书
    }
  } else if [type] == "albums-ws-log" {
    elasticsearch {
      hosts => ["https://localhost:9200"]
      index => "albums-ws-%{+YYYY.MM.dd}"
      user => "elastic"
      password => "你的elastic临时密码"
      ssl => true
      ssl_certificate_verification => false
    }
  }
  stdout { codec => rubydebug }
}

修改完成后启动Logstash,即可正常向Elasticsearch写入数据。

内容的提问来源于stack exchange,提问作者pixel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 16:25:33