Linux下安装Elasticsearch
在Linux下安装Elasticsearch,可以遵循以下步骤:
- 导入Elasticsearch公钥:
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
- 更新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/"
以上步骤适用于基于Debian的系统,如Ubuntu。如果你使用的是基于RPM的系统,如CentOS,步骤可能略有不同。请根据你的Linux发行版相应调整命令。
评论已关闭