Elasticsearch 安装与启动
安装Elasticsearch的步骤取决于你的操作系统。以下是在Linux上安装和启动Elasticsearch的基本步骤:
- 导入Elasticsearch公钥:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
- 添加Elasticsearch的APT仓库:
sudo sh -c 'echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list'
- 更新APT包索引:
sudo apt-get update
- 安装Elasticsearch:
sudo apt-get install elasticsearch
- 启动Elasticsearch服务:
sudo systemctl start elasticsearch.service
- 确保Elasticsearch随系统启动:
sudo systemctl enable elasticsearch.service
- 验证Elasticsearch是否正在运行:
curl -X GET "localhost:9200/"
这些步骤会安装Elasticsearch并启动服务,你可以通过访问 http://localhost:9200/
来验证它是否正常运行。如果你使用的是其他操作系统,请参考Elasticsearch官方文档中的安装指南:https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html
评论已关闭