LoginSignup
3
4

More than 3 years have passed since last update.

Ubuntu 18.04にElasticsearch 7.3を導入する(aptコマンドでインストール)

Last updated at Posted at 2019-08-15

参考
https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html

1ノード構成でElasticsearchクラスターを構築する時の導入手順のメモです。
以下、rootユーザーで実行しています。

1. Elasticsearchのインストール

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-7.x.list
apt update
apt install elasticsearch

2. jvm.optionsの編集

-XmsXXと-XmxXXのパラメータを、OSメモリの半分に値に変更します(以下は4GBの場合)。

/etc/elasticsearch/jvm.options
-Xms2g
-Xmx2g

3. elasticsearch.ymlの編集

以下のパラメーターを追加します。

/etc/elasticsearch/elasticsearch.yml
network.host: XX.XX.XX.XX # 自身のIPアドレス
discovery.type: single-node

4. 起動

systemctl start elasticsearch

5. 動作確認

curl http://XX.XX.XX.XX(network.hostに設定したIPアドレス):9200
{
  "name" : "cloudclt1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "U1IGG-fURIWGXH1EcWYWtA",
  "version" : {
    "number" : "7.3.0",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "de777fa",
    "build_date" : "2019-07-24T18:30:11.767338Z",
    "build_snapshot" : false,
    "lucene_version" : "8.1.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

もしくは、ブラウザで
http://XX.XX.XX.XX(network.hostに設定したIPアドレス):9200
にアクセスして、下記のような画面が表示されることを確認します。
Screenshot_2019-08-15 Screenshot.png

3
4
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
3
4