Missing authentication credentials for REST request [/_cluster/health?pretty] In minimal security set up

Hi!
I'm trying to set up basic security on elastic cluster.
my elasticsearch.yml:

cluster.name: ELK-CLUSTER
node.name:  $HOSTNAME
node.master: true
node.data: false
node.ingest: false
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["172.29.39.111", "172.29.39.112", "172.29.39.113", "172.29.39.114"]
cluster.initial_master_nodes: ["172.29.39.111", "172.29.39.112"]
action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

I'm doing by this guide Set up minimal security for Elasticsearch | Elasticsearch Guide [7.13] | Elastic
But command
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto
gets me

Failed to determine the health of the cluster running at http://172.29.39.111:9200
Unexpected response code [503] from calling GET http://172.29.39.111:9200/_cluster/health?pretty
Cause: master_not_discovered_exception
curl GET http://172.29.39.111:9200/_cluster/health?pretty
curl: (6) Could not resolve host: GET
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "missing authentication credentials for REST request [/_cluster/health?pretty]",
        "header" : {
          "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "missing authentication credentials for REST request [/_cluster/health?pretty]",
    "header" : {
      "WWW-Authenticate" : "Basic realm=\"security\" charset=\"UTF-8\""
    }
  },
  "status" : 401
}

So, if I correct understand, to install security, I need installed security?
How to resolve this problem?
Thank you.

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