After add xpack.security.enabled,my kibana does not work

my elasticsearch.yml as follows:

http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
network.host: 172.17.0.9
discovery.type: single-node
http.port: 9200
action.auto_create_index: true
http.cors.allow-headers: Authorization
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true

then kiabna.yml:

server.name: kibana
server.port: 5601
server.host: 0.0.0.0
elasticsearch.hosts: [ "http://localhost:9200" ]
xpack.monitoring.ui.container.elasticsearch.enabled: true
i18n.locale: "zh-CN"
elasticsearch.username: "elastic"
elasticsearch.password: "123456"

and logs show

{"type":"log","@timestamp":"2023-05-12T03:54:30+00:00","tags":["error","elasticsearch-service"],"pid":7,"message":"Unable to retrieve version information from Elasticsearch nodes. security_exception: [security_exception] Reason: missing authentication credentials for REST request [/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip]"}

I have tried many soultions(change elasticsearch.username and elasticsearch.passwpord),but still show this error.
elasticsearch and kibana version both are 7.16.3.

Hi @Dadaguai welcome to the community!

What version are you on?

elasticsearch and kibana verison both are 7.16.3.

And what do you get when running this

curl -u elastic:password http://localhost:9200

Ohh typo?

localhost

here

{
  "name" : "698bec6b7cff",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "rYh01KZLQ9KTlcbt_pZdCw",
  "version" : {
    "number" : "7.16.3",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "4e6e4eab2297e949ec994e688dad46290d018022",
    "build_date" : "2022-01-06T23:43:02.825887787Z",
    "build_snapshot" : false,
    "lucene_version" : "8.10.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Thanks,Corrected now.

So,next what should i do? :sob:

Did you fix that in the kibana.yml and then restart and look at the logs?
If some can you provide more of the logs lines?

Also, it sometimes helps us to see more than just one single line from the log... Often those errors are actually connectivity errors

Also please always show the command you ran plus the output... otherwise we are guessing.

The more complete you are the better we can help

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.