Difference between revisions of "Curl https://localhost:9200/ nodes/status"

From wikieduonline
Jump to navigation Jump to search
Line 47: Line 47:
  
 
  Solution, add username and password to your request: <code>curl --insecure https://localhost:9200/_nodes/status -u "your_usename:your_password"</code>
 
  Solution, add username and password to your request: <code>curl --insecure https://localhost:9200/_nodes/status -u "your_usename:your_password"</code>
 +
 +
== unable to authenticate user ==
 +
 +
{
 +
  "error": {
 +
    "root_cause": [
 +
      {
 +
        "type": "security_exception",
 +
        "reason": "unable to authenticate user [admin] for REST request [/_nodes/status]",
 +
        "header": {
 +
          "WWW-Authenticate": [
 +
            "Bearer realm=\"security\"",
 +
            "ApiKey",
 +
            "Basic realm=\"security\" charset=\"UTF-8\""
 +
          ]
 +
        }
 +
      }
 +
    ],
 +
    "type": "security_exception",
 +
    "reason": "unable to authenticate user [admin] for REST request [/_nodes/status]",
 +
    "header": {
 +
      "WWW-Authenticate": [
 +
        "Bearer realm=\"security\"",
 +
        "ApiKey",
 +
        "Basic realm=\"security\" charset=\"UTF-8\""
 +
      ]
 +
    }
 +
  },
 +
  "status": 401
 +
}
  
 
== See also ==
 
== See also ==

Revision as of 11:59, 7 September 2022

curl https://localhost:9200/_nodes/status
{"_nodes":{"total":0,"successful":0,"failed":0},"cluster_name":"docker-cluster","nodes":{}}
curl https://localhost:9200/_nodes/status | jq .
{
  "_nodes": {
    "total": 0,
    "successful": 0,
    "failed": 0
  },
  "cluster_name": "elasticsearch",
  "nodes": {}
}

Missing authentication credentials

kubectl -n your_namespace exec -ti your_elastic_pod1 -- /bin/sh -c "curl -k https://localhost:9200/_nodes/status" | jq .
{
  "error": {
    "root_cause": [
      {
        "type": "security_exception",
        "reason": "missing authentication credentials for REST request [/_nodes/status]",
        "header": {
          "WWW-Authenticate": [
            "Bearer realm=\"security\"",
            "ApiKey",
            "Basic realm=\"security\" charset=\"UTF-8\""
          ]
        }
      }
    ],
    "type": "security_exception",
    "reason": "missing authentication credentials for REST request [/_nodes/status]",
    "header": {
      "WWW-Authenticate": [
        "Bearer realm=\"security\"",
        "ApiKey",
        "Basic realm=\"security\" charset=\"UTF-8\""
      ]
    }
  },
  "status": 401
}
Solution, add username and password to your request: curl --insecure https://localhost:9200/_nodes/status -u "your_usename:your_password"

unable to authenticate user

{

 "error": {
   "root_cause": [
     {
       "type": "security_exception",
       "reason": "unable to authenticate user [admin] for REST request [/_nodes/status]",
       "header": {
         "WWW-Authenticate": [
           "Bearer realm=\"security\"",
           "ApiKey",
           "Basic realm=\"security\" charset=\"UTF-8\""
         ]
       }
     }
   ],
   "type": "security_exception",
   "reason": "unable to authenticate user [admin] for REST request [/_nodes/status]",
   "header": {
     "WWW-Authenticate": [
       "Bearer realm=\"security\"",
       "ApiKey",
       "Basic realm=\"security\" charset=\"UTF-8\""
     ]
   }
 },
 "status": 401

}

See also

Advertising: