6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOSのElasticsearchで「not enough memory」が出たら

Posted at

CentOSでElasticsearchを動かす際に、Javaのパッケージ関連でハマったのでメモ。

  • CentOS 6.5 x86_64
  • Elasticsearch 1.2.3 (rpm)

Elasticsearchインストール&起動→失敗

rpmから。

$ sudo yum install elastic search

起動を試みる。

$ sudo service elasticsearch start
Starting elasticsearch:                                    [  OK  ]
Can't start up: not enough memory

not enough memoryと出て落ちるが、メモリ以外の原因もあるそうで、今回は下記の通りJavaが合ってなかったようでした。

Javaパッケージ確認と変更

$ rpm -qa | grep java
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64

$ java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-4)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

このように、GNU製Javaが原因だったもよう。
Oracle謹製のJava(jre)じゃないとダメだというリソースもあるが、openjdkでも大丈夫なようです。

$ sudo yum install java-1.7.0-openjdk

$ java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

Elasticsearch起動→成功

再度Elasticsearch起動を試みる。

$ sudo service elasticsearch start
Starting elasticsearch:                                    [  OK  ]

接続確認。

$ curl -X GET http://localhost:9200/
{
  "status" : 200,
  "name" : "Elias Bogan",
  "version" : {
    "number" : "1.2.3",
    "build_hash" : "4596e81285d3c1a1609c8382b1e804115ef610fb",
    "build_timestamp" : "2014-07-23T13:16:05Z",
    "build_snapshot" : false,
    "lucene_version" : "4.8"
  },
  "tagline" : "You Know, for Search"
}

無事動作しました。

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?