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开机自启
sudo systemctl enable elasticsearch.service
# 验证Elasticsearch是否正确运行
curl -X GET "localhost:9200/"
这段代码提供了在Ubuntu系统上安装和配置Elasticsearch的步骤。首先,我们导入Elasticsearch的GPG密钥,然后添加Elasticsearch的APT仓库,接着执行更新并安装Elasticsearch。最后,我们启动Elasticsearch服务,并设置开机自启。最后,我们使用curl命令验证Elasticsearch是否正确运行。
评论已关闭