Elasticsearch在UBUNTU下的安装与启动_ubuntu elasticsearch 后台运行
在Ubuntu系统上安装Elasticsearch并确保其在后台运行,可以按照以下步骤操作:
- 导入Elasticsearch公共GPG密钥:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- 添加Elasticsearch到APT源列表:
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
- 更新包索引并安装Elasticsearch:
sudo apt-get update && sudo apt-get install elasticsearch
- 启动Elasticsearch服务并设置开机自启:
sudo systemctl start elasticsearch.service
sudo systemctl enable elasticsearch.service
- 验证Elasticsearch是否正在运行:
sudo systemctl status elasticsearch.service
或者使用curl检查Elasticsearch状态:
curl -X GET "localhost:9200/"
以上步骤将在Ubuntu系统上安装Elasticsearch,并设置为开机自启动,确保其在后台运行。
评论已关闭