我正在按照这里的步骤进行安装,并使Elasticsearch正常工作。
我有一个ubuntu 17,我以具有sudo权限的非root用户身份登录。
我做了以下步骤
sudo apt-get update
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.1.1.deb
sudo dpkg -i elasticsearch-6.1.1.deb
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch
最后当我测试使用
curl -X GET 'http://localhost:9200'
我收到以下错误
curl: (7) Failed to connect to localhost port 9200: Connection refused
当我做的时候
service --status-all
我看不到服务列表中列出的elasticsearch服务。
请注意,我已经安装了ufw,并且打开了以下端口
To Action From
-- ------ ----
22/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
这可能会阻止9200端口,但这似乎不太可能,因为应该允许内部通信。
更新:
这是我使用sudo journalctl -f获得的输出
-- Logs begin at Fri 2017-12-29 10:27:23 +0545. --
Dec 30 13:31:40 elasticsearch[29595]: #
Dec 30 13:31:40 elasticsearch[29595]: # There is insufficient memory for the Java Runtime Environment to continue.
Dec 30 13:31:40 elasticsearch[29595]: # Native memory allocation (mmap) failed to map 986513408 bytes for committing reserved memory.
Dec 30 13:31:40 elasticsearch[29595]: # An error report file with more information is saved as:
我使用free -m命令检查了可用内存
首先,您应该启用它,journalctl
以便我们可以对正在发生的事情有所了解。
由于这似乎是内存问题(您的VPS上有1GB,并且ES已预配置1GB堆),因此有两个选择:
config/jvm.options
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句