tutorials.Time-Series-Data icon indicating copy to clipboard operation
tutorials.Time-Series-Data copied to clipboard

Problem with the CrateDB Health Status

Open flopezag opened this issue 4 years ago • 0 comments

Sometimes there is an error when we try to execute CrateDB requests due to the server has not finished the process of creation of the indexes and therefore the Health Status is still not GREEN.

The solution should be the implementation of a new services function 'waiting_cratedb' before finishing the script in which we request:

curl -iX POST \
  'http://localhost:4200/_sql' \
  -H 'Content-Type: application/json' \
  -d '{"stmt": "select health from sys.health order by severity desc limit 1;"}'

And example of the response is the following:

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

{"cols":["health"],"rows":[["GREEN"]],"rowcount":1,"duration":41.1477}                                                                                                                                                             

We need to wait until response['rows'][0] is ["GREEN"] possible values are:

  • ["GREEN"]
  • ["YELLOW"]
  • ["RED"]
  • []

flopezag avatar Aug 25 '21 08:08 flopezag