使用 shuf 来打乱一个文件中的行或是选择文件中一个随机的行。

error=>"Got response code '401' contacting Elasticsearch at URL 'http://localhost:9200/'"}

Logstash | 作者 taowenrui | 发布于2017年09月11日 | 阅读数:18492

在同一台服务器上,安装了filebeat,logstash,elasticsearch,kibana,x-pack插件,elasticsearch只安装了一个,在elasticsearch还没有安装x-pack插件的时候当导入tomcat的日志,在elasticsearch是可以查询到的,logstash也没有报错,当elasticsearch安装x-pack后,logstash就出现链接elasticsearch 报401错误,求大神帮忙?
已邀请:

taowenrui

赞同来自: shitangjiejie lightyarn

谢谢,问题已经解决了,在配置文件添加了用户认证,就可以连接上了。

xinfanwang

赞同来自:

安装X-PACK后,需要配置auth。kibana.yml里配置。默认user:elastic, password: changeme。
`
elasticsearch.username: "elastic"
elasticsearch.password: "changeme"
 
`

taowenrui

赞同来自:

真的不好意思,手误了,logstash链接elasticsearch 报401错误,

Running health check to see if an Elasticsearch connection is working {:healthcheck_url=>http://localhost:9200/, :path=>"/"}
[2017-09-11T11:49:46,780][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://localhost:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'http://localhost:9200/'"}

 

xinfanwang

赞同来自:

logstash,es output有auth的配置。

taowenrui

赞同来自:

9I)EK[G9`Z3)M[CHM(UQZ2.png

这个是logstash输出配置,我也是初次搭建es,是不是logstash也需要安装x-pack?我在x-pack中看到logstash的文件,不过现在只再elasticsearch,kibana中安装了x-pack,请问有没有可靠的es安装文档呢?非常感谢

xinfanwang

赞同来自:

自己还是看看文档吧。这种问题很容易解决,不需要提问的。

要回复问题请先登录注册