Elastic 6.x http status code on IP:9200

Hi

With 1.7.2, IP:9200 gives me:

{
"status" : 200,
"name" : "node_name",
"cluster_name" : "cluster_name",
"version" : {
"number" : "1.7.2",
"build_hash" : "e43676b1385b8125d647f593f7202acbd816e8ec",
"build_timestamp" : "2015-09-14T09:49:53Z",
"build_snapshot" : false,
"lucene_version" : "4.10.4"
},
"tagline" : "You Know, for Search"
}

With 6.x, I get:

{
"name" : "node_name",
"cluster_name" : "cluster_name",
"cluster_uuid" : "XagsK7MmT1CghWS9SrKQUg",
"version" : {
"number" : "6.5.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "816e6f6",
"build_date" : "2018-11-09T18:58:36.352602Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

There is no status anymore.
In 1.7.2 version, our http monitor monitors it with the following regex

[1][0-9][0-9]$

Question is, how should I do this on 6.x..?
Aren't there status codes anymore..? (at least the current regex does not work any more)

Regards
Raul


  1. 234 ↩︎

You might be able to instead use the _cluster/health endpoint. This contains a status, but is possibly a bit more expensive.

Well, this status: "green" is actually not what I am looking for.

I have 2 nodes.
I have defined a single gslb name for these IP's, but since all the requests are handled by first node (primary/backup), I would like to know if first node is offline for some reason. If that happens, then his service is automatically redirected to the node 2.

This _cluster/health is for whole cluster, and since if status="yellow", I do not know, which node has problems.

Regards
Raul

If you only have two nodes in the cluster, losing either of the nodes should make the cluster red (assuming you have 2 master eligible nodes and have configured it correctly). Why can't you simply establish the status of the cluster and nodes through a call to another API if there is an issue?

I am not sure, what you mean by that:

Why can't you simply establish the status of the cluster and nodes through a call to another API if there is an issue?

I have 1 master eligble node, bear in mind, this is development environment.

Regards
Raul

OK, so the cluster would only go red if the master node went down and otherwise be green or yellow. By other API I meant e.g. _cat/nodes.

Ok, I figured out, HTTP code is actually 200 as well.
Problem was, that I had firewall issue..:smiley:

curl -i http://IP:9200/

HTTP/1.1 403 Forbidden
Content-Type: text/html
Cache-Control: no-cache
Content-Length: 1393

After this got sorted out.

curl -i http://IP:9200/

HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 505

{
"name" : "node_name",
"cluster_name" : "cluster_name",
"cluster_uuid" : "XagsK7MmT1CghWS9SrKQUg",
"version" : {
"number" : "6.5.0",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "816e6f6",
"build_date" : "2018-11-09T18:58:36.352602Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

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