CentOS 7 安装 Elasticsearch 7.12.1
在CentOS 7上安装Elasticsearch 7.12.1,可以遵循以下步骤:
- 导入Elasticsearch公钥:
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
- 创建Elasticsearch的yum仓库文件:
echo "[elasticsearch-7.x]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.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 yum install --enablerepo=elasticsearch elasticsearch
- 启动并设置Elasticsearch开机自启:
sudo systemctl start elasticsearch.service
sudo systemctl enable elasticsearch.service
- 验证安装是否成功:
curl -X GET "localhost:9200/"
以上步骤会安装Elasticsearch 7.12.1并启用服务,你可以通过访问localhost:9200
来验证安装是否成功。
评论已关闭