medcl / elasticsearch-rtf

elasticsearch中文发行版,针对中文集成了相关插件,方便新手学习测试.
Apache License 2.0
2.67k stars 715 forks source link

2.2.0版本es在centos6.5 x64上自动关闭 #47

Closed ZhangShufan15 closed 8 years ago

ZhangShufan15 commented 8 years ago

我下载的是2.2.0版本的rtf,安装在centos6.5 x64上,同时用plugin install mobz/elasticsearch-head安装了head。

在es上有一个索引,索引中包含2个类型,1个分片,0个备份。数据量很小,总共500条,200k数据。

es启动后,每隔一段时间,第一次是2天,后来都是半天不到,就自动关闭了。查看了/var/log/messages里面没有异常杀死进程的信息。

看es的日志,能够看到输出了stopping stopped closing closed ,但是没有关闭的原因。以下是最后的日志输出:

[2016-10-18 01:55:57,872][INFO ][node                     ] [Tom Thumb] stopping ...
[2016-10-18 01:55:57,893][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing ... (reason [shutdown])
[2016-10-18 01:55:57,894][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing index service (reason [shutdown])
[2016-10-18 01:55:57,894][DEBUG][index                    ] [Tom Thumb] [nggirl-esdb-test] [0] closing... (reason: [shutdown])
[2016-10-18 01:55:57,895][DEBUG][index.shard              ] [Tom Thumb] [nggirl-esdb-test][0] state: [STARTED]->[CLOSED], reason [shutdown]
[2016-10-18 01:55:57,895][DEBUG][index.shard              ] [Tom Thumb] [nggirl-esdb-test][0] operations counter reached 0, will not accept any further writes
[2016-10-18 01:55:57,895][DEBUG][index.engine             ] [Tom Thumb] [nggirl-esdb-test][0] flushing shard on close - this might take some time to sync files to disk
[2016-10-18 01:55:57,897][DEBUG][index.engine             ] [Tom Thumb] [nggirl-esdb-test][0] close now acquiring writeLock
[2016-10-18 01:55:57,897][DEBUG][index.engine             ] [Tom Thumb] [nggirl-esdb-test][0] close acquired writeLock
[2016-10-18 01:55:57,898][DEBUG][index.translog           ] [Tom Thumb] [nggirl-esdb-test][0] translog closed
[2016-10-18 01:55:57,909][DEBUG][index.engine             ] [Tom Thumb] [nggirl-esdb-test][0] engine closed [api]
[2016-10-18 01:55:57,910][DEBUG][index.store              ] [Tom Thumb] [nggirl-esdb-test][0] store reference count on close: 0
[2016-10-18 01:55:57,910][DEBUG][index                    ] [Tom Thumb] [nggirl-esdb-test] [0] closed (reason: [shutdown])
[2016-10-18 01:55:57,910][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing index cache (reason [shutdown])
[2016-10-18 01:55:57,910][DEBUG][index.cache.query.index  ] [Tom Thumb] [nggirl-esdb-test] full cache clear, reason [close]
[2016-10-18 01:55:57,911][DEBUG][index.cache.bitset       ] [Tom Thumb] [nggirl-esdb-test] clearing all bitsets because [close]
[2016-10-18 01:55:57,912][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] clearing index field data (reason [shutdown])
[2016-10-18 01:55:57,912][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing analysis service (reason [shutdown])
[2016-10-18 01:55:57,912][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing mapper service (reason [shutdown])
[2016-10-18 01:55:57,912][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing index query parser service (reason [shutdown])
[2016-10-18 01:55:57,917][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closing index service (reason [shutdown])
[2016-10-18 01:55:57,917][DEBUG][indices                  ] [Tom Thumb] [nggirl-esdb-test] closed... (reason [shutdown])
[2016-10-18 01:55:57,918][INFO ][node                     ] [Tom Thumb] stopped
[2016-10-18 01:55:57,918][INFO ][node                     ] [Tom Thumb] closing ...
[2016-10-18 01:55:57,925][INFO ][node                     ] [Tom Thumb] closed

请问,这可能是什么原因造成的,谢谢?

medcl commented 8 years ago

是不是没有设置 java 的堆栈大小ES_HEAP_SIZE

ZhangShufan15 commented 8 years ago

确实没有设置,这个地方是最好设置么?

后来发现问题可能的原因是我再远程ssh,登录的centos,然后用./elasticsearch 启动的,没有加-d 让他后台启动,这样的话一旦关闭了本机的命令行窗口,elasticsearch就会shutdown,我再跟踪一段时间看看。

medcl commented 8 years ago

调大一点看看吧,可能内存不够用

ZhangShufan15 commented 8 years ago

好的,我再跟一段时间

Steven-Z-Yang commented 8 years ago

基本上就是你没有加-d的原因