Centos 8 安装 Elasticsearch
CentOS 8 安装 Elasticsearch 的步骤如下:
- 导入Elasticsearch公钥:
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
- 创建Elasticsearch的yum仓库文件:
echo "[elasticsearch-8.x]
name=Elasticsearch repository for 8.x packages
baseurl=https://artifacts.elastic.co/packages/8.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md" | sudo tee /etc/yum.repos.d/elasticsearch.repo
- 安装Elasticsearch:
sudo dnf install elasticsearch
- 启动并使Elasticsearch随系统启动:
sudo systemctl daemon-reload
sudo systemctl enable --now elasticsearch.service
- 检查Elasticsearch服务状态:
sudo systemctl status elasticsearch.service
以上步骤会安装Elasticsearch 8.x 版本。如果需要安装其他版本,请修改仓库文件中的版本号。安装完成后,您可以通过访问 http://<your-server-ip>:9200
来确认Elasticsearch是否正常运行。
评论已关闭