ElasticSearch入门单节点初体验
# 安装Elasticsearch
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
# 启动Elasticsearch服务
sudo systemctl start elasticsearch.service
# 验证Elasticsearch是否正在运行
curl -X GET "localhost:9200/"
这段代码提供了在Ubuntu系统上安装Elasticsearch的步骤。首先,我们下载Elasticsearch的GPG密钥,并将其添加到apt-key中。然后,我们为Elasticsearch配置APT源,并更新本地的包索引。最后,我们安装Elasticsearch,并启动它。最后,我们使用curl命令来验证Elasticsearch是否正在运行并接受请求。
评论已关闭