我在端口8082中打开了通往远程服务器上托管的InfluxDB
的 SSH隧道。隧道似乎运行良好,因为在发出以下请求时得到了结果:
jscherman$ curl -i 'http://localhost:8082/infrastructure/query' --data-urlencode "db=telegraf" --data-urlencode "q=SHOW MEASUREMENTS"
HTTP/1.1 200 OK
Server: nginx/1.12.2
Date: Fri, 17 May 2019 23:25:29 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Request-Id: 0eb526db-78fb-11e9-b7bd-000000000000
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.6.4
X-Request-Id: 0eb526db-78fb-11e9-b7bd-000000000000
{"results":[{"statement_id":0,"series":[{"name":"measurements","columns":["name"],"values":[["response_time"]]}]}]}
但是,当我尝试向Java
客户端发出相同的请求时,该请求不起作用,因此我开始使用基本命令并尝试ping通它。这就是我所拥有的:
madmin’s-MacBook-Pro:sentinel jscherman$ curl -i --get "http://localhost:8082/infrastructure/ping"
HTTP/1.1 404 Not Found
Server: nginx/1.12.2
Date: Fri, 17 May 2019 23:23:14 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.12.2</center>
</body>
</html>
怎么可能ping不起作用,但同时执行查询时仍能给我正确的结果?任何帮助将不胜感激。