我最近安装了Elasticsearch,头几天一切都很好,但是今天却停止了工作。
当我开始服务的时候,它声称很好.
sudo /etc/init.d/elasticsearch start
* Starting Elasticsearch Server
...done.但后来我得到了
curl -GET http://127.0.0.1:9200
curl: (7) couldn't connect to host
查看elasticsearch日志:
[WARN ][bootstrap ] jvm uses the client vm, make sure to run `java` with the server vm for best performance by adding `-server` to the command line似乎有关于Java的警告;这可能是问题所在吗?我还应该试试看什么呢?
发布于 2014-03-02 04:53:02
1)在linux中使用lsof命令检查端口9200的状态。
在我的例子中,下面是启动elasticsearch时的结果。
prayag@prayag:~$ sudo lsof -i TCP | grep 9200
chrome 2639 praayg 84u IPv4 116310 0t0 TCP prayag.local:58989->10.0.4.70:9200 (ESTABLISHED)
chrome 2639 prayag 99u IPv4 116313 0t0 TCP prayag.local:58990->10.0.4.70:9200 (ESTABLISHED)
java 7634 prayag 141u IPv6 130960 0t0 TCP *:9200 (LISTEN)elasticsearch不是对我的服务,否则要查找正在运行的端口 es,我可以检查,
$ sudo lsof -iTCP -sTCP:LISTEN | grep elasticsearch2)检查elasticsearch端点
$ curl -IGET http://localhost:9200
HTTP/1.1 200 OK
content-type: application/json; charset=UTF-8
content-length: 327-IGET等同于仅返回http响应头的--head。200意味着elasticsearch端点正在正确地响应。发布于 2014-03-01 21:14:50
curl -GET http://127.0.0.1:9200是错误的命令。
试试curl -XGET http://127.0.0.1:9200。它应该返回关于正在运行的本地节点和状态200的简短信息。如果这样做不起作用,那么肯定有其他问题。
发布于 2017-10-16 00:24:55
不管怎么说,我会尝试命令:
卷曲-XGET http://localhost:9200
https://stackoverflow.com/questions/22110249
复制相似问题