Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to /status to ensure it is valid rqlite node #59

Open
invisal opened this issue Mar 29, 2024 · 1 comment
Open

Call to /status to ensure it is valid rqlite node #59

invisal opened this issue Mar 29, 2024 · 1 comment
Labels

Comments

@invisal
Copy link
Collaborator

invisal commented Mar 29, 2024

If you can, I would perform an explicit "network test connect" call first. Call /status, and ensure you get 200 back. That way you can be sure you're talking to an rqlite node.

Actually it just calls the URL and looks for X-Rqlite-Version has a HTTP header in the response.

Reference:
https://github.com/rqlite/rqlite/blob/master/cmd/rqlite/main.go#L101

@invisal invisal added the rqlite label Mar 29, 2024
@otoolep
Copy link

otoolep commented Mar 29, 2024

Actually, just call / on whatever host and port is supplied in the URL. See:

~ $ curl -v localhost:4001
*   Trying ::1:4001...
* TCP_NODELAY set
* Connected to localhost (::1) port 4001 (#0)
> GET / HTTP/1.1
> Host: localhost:4001
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 302 Found
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Content-Type, Authorization
< Access-Control-Allow-Methods: OPTIONS, GET, POST
< Content-Type: text/html; charset=utf-8
< Location: /status
< X-Rqlite-Version: v8.23.0
< Date: Fri, 29 Mar 2024 13:21:44 GMT
< Content-Length: 30
< 
<a href="/status">Found</a>.

* Connection #0 to host localhost left intact
~ $ 

Then look for X-Rqlite-Version as a header (value doesn't matter, just that it's there).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants