Ubuntu 22.04 安装 Elasticsearch 8.3

Elasticsearch的Debian软件包可以用于在任何基于Debian的系统(如Debian和Ubuntu)上安装Elasticsearch。
1,更新源
sudo apt-get update
2,下载安装密钥
wget -qO – https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg –dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
3,安装 apt-transport-https 包
sudo apt-get install apt-transport-https
4,将存储库定义保存到/etc/apt/sources.list.d/elastic-8.x.list:
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
5,安装Elasticsearch Debian软件包
sudo apt-get update && sudo apt-get install elasticsearch
6,下载并安装Debian软件包manuallyedit
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.3.2-amd64.deb
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.3.2-amd64.deb.sha512
shasum -a 512 -c elasticsearch-8.3.2-amd64.deb.sha512
sudo dpkg -i elasticsearch-8.3.2-amd64.deb
7,使用systemdedit运行Elasticsearch,将Elasticsearch配置为在系统启动时自动启动。
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
Elasticsearch可以按如下方式启动和停止:
sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service
8,重启,设置超级用户[elastic]的密码,
roboot
/usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
9,检查Elasticsearch是否正在运行,您可以通过向localhost上的端口9200发送HTTPS请求来测试Elasticsearch节点是否正在运行:
curl –cacert /etc/elasticsearch/certs/http_ca.crt -u elastic https://localhost:9200
官方说明文档:https://www.elastic.co/guide/en/elasticsearch/reference/8.3/deb.html
TagsElasticsearch Ubuntu


本文出自快速备案,转载时请注明出处及相应链接。

本文永久链接: https://www.xiaosb.com/beian/53761/