大网数据广告活动
服务器运维问答

Elasticsearch service often goes down or gets killed

· 52CE 我爱测

My webserver is running ubuntu 14.10 with elasticsearch 1.5.0 and java 1.7u55 For some reason, the elasticsearch service often goes down, resulting in my website not being available to my users anymore (using FOSElasticaBundle wi…

问题原文

原帖链接 · Sébastien · CC BY-SA 3.0

My webserver is running ubuntu 14.10 with elasticsearch 1.5.0 and java 1.7u55

For some reason, the elasticsearch service often goes down, resulting in my website not being available to my users anymore (using FOSElasticaBundle with symfony).

I am using systemctl to restart it automatically, but I would prefer a good fix once and for all. I feel the logs I have are not descriptive enough. Being pretty new to managing a server, I need some help.

Can someone help me figure out the reason for this failure ? What are the right files I can output here to better understand the issue ?

Thanks !

My systemctl status gives :

elasticsearch.service - ElasticSearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled)
   Active: active (running) since Mon 2015-04-20 12:04:24 CEST; 1h 56min ago          <------------- Here it means restarted 1h56 ago. Why did it fail in the first place ?
 Main PID: 9120 (java)
   CGroup: /system.slice/elasticsearch.service
           └─9120 /usr/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingO...

In my journalctl, I have :

Apr 18 18:56:19 xx.ovh.net sshd[29397]: error: open /dev/tty failed - could not set controlling tty: Permission denied
Apr 20 13:52:45 xx.ovh.net sshd[9764]: error: open /dev/tty failed - could not set controlling tty: Permission denied

EDIT: it often restarts when I launch the first search request:

elasticsearch.service - ElasticSearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled)
   Active: activating (auto-restart) (Result: signal) since Tue 2015-04-21 12:27:43 CEST; 10s ago
  Process: 15618 ExecStart=/usr/share/elasticsearch/bin/elasticsearch (code=killed, signal=ABRT)
 Main PID: 15618 (code=killed, signal=ABRT)

已采纳解答

原帖链接 · Will Barnwell · CC BY-SA 3.0

Well, due to low rep I cannot comment, but one elasticsearch instance needs at least 1.5 gB to run comfortably, maybe a lot more depending on what you're asking of it. By default elastic takes 1 gB of memory and then lucene (the search library that ES leverages) will take up some other memory to perform searches. Below are a couple links from elastic's site about managing memory and stopping your process from being killed by OOM killer because of its memory usage.

https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html#setup-configuration-memory

https://www.elastic.co/guide/en/elasticsearch/guide/current/_limiting_memory_usage.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-04-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。