问题描述
我正在按照此处的步骤进行安装,并使Elasticsearch正常工作.
I am following the steps here to install and get elasticsearch to work.
我有一个ubuntu 17,我以具有sudo权限的非root用户身份登录.
I have a ubuntu 17 and i am logged in as non root user with sudo rights.
我执行了以下步骤
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服务.
i donot see elasticsearch service listed in the services list.
请注意,我已经安装了ufw,并且打开了以下端口
Please note that i have ufw installed and i have the following ports open
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端口,但这似乎不太可能,因为应该允许内部通信.
could this be preventing the 9200 port but that doesnt seem likely since internal communications should be allowed.
更新:
这是我通过 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 命令检查了可用内存
I checked the free memory using free -m command
推荐答案
首先,您应该启用journalctl
,这样我们就可以了解发生了什么.
First, you should enable journalctl
so we can gain some insights about what is going on.
由于这似乎是内存问题(您的VPS上有1GB,并且ES已预先配置了1GB堆),因此您有两个选择:
Since it seems to be a memory issue (you have 1GB on your VPS and ES is pre-configured with 1GB heap), you have two options:
- 减少
config/jvm.options
中的堆 - 或增加您的VPS RAM
- decrease the heap in
config/jvm.options
- or increase your VPS RAM
这篇关于无法获得Elasticsearch服务在ubuntu 17中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!