我按照此处的步骤安装并让 elasticsearch 工作。
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-elasticsearch-on-ubuntu-16-04
我有一个 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 端口,但这似乎不太可能,因为应该允许内部通信。
UPDATE:
这是我得到的输出须藤日记ctl -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 command