【问题标题】:Logstash Elastic Cloud 401 Unauthorized errorLogstash Elastic Cloud 401 未经授权的错误
【发布时间】:2018-08-29 07:36:15
【问题描述】:

Official logstash elastic cloud module

Official doc for starting with

我的logstash.yml 看起来像:

  cloud.id: "Test:testkey"
  cloud.auth: "elastic:password"

""内,前面有2个空格,最后没有空格

这就是我在logstash.yml 中的全部内容,仅此而已,
我得到了:

[2018-08-29T12:33:52,112][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://myserverurl:12345/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'https://myserverurl:12345/'"}

my_config_file_name.conf 看起来像:

input{jdbc{...jdbc here... This works, as I see data in windows console}}
output {
    stdout { codec => json_lines }
    elasticsearch {
    hosts => ["myserverurl:12345"]
    index => "my_index"
    # document_id => "%{brand}"
    }

我正在做的是在 Windows cmd 上点击 bin/logstash
它从我在 conf 文件输入中配置的数据库中加载数据,然后显示错误,我想在 Cloud 上将我的数据从 MySQL 索引到 elasticsearch,我进行了 14 天的试用并创建了一个测试索引,以供学习目的,因为我以后必须部署它。 我的管道看起来像:

  - pipeline.id: my_id
    path.config: "./config/conf_file_name.conf"
    pipeline.workers: 1

如果日志不包含敏感数据,我也可以提供。
基本上我不想在云上同步(计划检查)我的MYSQL 数据与ElasticSearch,即AWS

【问题讨论】:

    标签: elasticsearch logstash elastic-cloud


    【解决方案1】:

    输出应为:

    elasticsearch {
        hosts => ["https://yourhost:yourport/"]
        user => "elastic"
        password => "password"
        # protocol => https
        # port => "yourport"
        index => "test_index"
        # document_id => "%{table_id}"
    

    # - 代表 cmets

    如所述:Configuring logstash with elastic cloud docs

    部署应用程序时提供的文档不提供jdbc的配置,jdbc即使在设置文件中定义,也需要用户和密码,即logstash.yml

    【讨论】:

      【解决方案2】:

      我在我的开发环境中添加了相同的问题。在谷歌上搜索了几个小时后,我默认理解为,当你安装 Logstash 时,会安装 X-Pack。在文档https://www.elastic.co/guide/en/logstash/current/setup-xpack.html 中声明

      块引用

      X-Pack 是一个 Elastic Stack 扩展,提供安全、警报、监控、机器学习、管道管理和许多其他功能

      块引用

      由于我在流式传输 Elasticsearch 时不需要 x-pack 在我的开发中运行,因此我必须通过在我的索引文件配置的输出中将 ilm_enabled 设置为 false 来禁用它。

          output {
           elasticsearch { 
              hosts =>  [.. ]
              ilm_enabled => false
            }
          }
      

      下面的链接可能会有所帮助 https://discuss.opendistrocommunity.dev/t/logstash-oss-with-non-removable-x-pack/655/3

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-04-19
        • 1970-01-01
        • 1970-01-01
        • 2017-12-20
        • 1970-01-01
        • 2015-10-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多