Ubuntu のカーネル
$ uname -a
Linux iwata 5.13.0-27-generic #29-Ubuntu SMP Wed Jan 12 17:36:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Java のインストール
sudo apt install openjdk-11-jdk
Java のバージョン
$ java --version
openjdk 11.0.14 2022-01-18
OpenJDK Runtime Environment (build 11.0.14+9-Ubuntu-0ubuntu2.22.10)
OpenJDK 64-Bit Server VM (build 11.0.14+9-Ubuntu-0ubuntu2.22.10, mixed mode, sharing)
Elasticsearch のインストール
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt update
sudo apt install elasticsearch
サーバーの状態の確認
sudo systemctl status elasticsearch
サーバーの起動
sudo systemctl start elasticsearch
クライアントから、サーバーの確認
$ http http://localhost:9200
HTTP/1.1 200 OK
X-elastic-product: Elasticsearch
content-encoding: gzip
content-length: 319
content-type: application/json
{
"cluster_name": "elasticsearch",
"cluster_uuid": "R92Wu-uxTl2gad2cs6OkIg",
"name": "iwata",
"tagline": "You Know, for Search",
"version": {
"build_date": "2022-03-17T22:01:32.658689558Z",
"build_flavor": "default",
"build_hash": "d0925dd6f22e07b935750420a3155db6e5c58381",
"build_snapshot": false,
"build_type": "deb",
"lucene_version": "9.0.0",
"minimum_index_compatibility_version": "7.0.0",
"minimum_wire_compatibility_version": "7.17.0",
"number": "8.1.1"
}
}
クライアントからの確認は、こちら
Elasticsearch の使い方
立ち上がらない時の対策
/etc/elasticsearch/elasticsearch.yml
(省略)
xpack.security.enabled: false