在Ubuntu 18.04上使用apt命令安装Elasticsearch 7.3
请参考以下链接:
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参数更改为操作系统内存的一半(以4GB为例)。
-Xms2g
-Xmx2g
3. 编辑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"
}
![Screenshot_2019-08-15 Screenshot.png](https://cdn.silicloud.com/blog-img/blog/img/657d439437434c4406c9c8f0/14-0.png)