【elasticsearch】linux环境搭建ES
在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
- 更新包索引并安装Elasticsearch:
sudo apt-get update && sudo apt-get install elasticsearch
- 启动Elasticsearch服务并设置开机自启:
sudo systemctl start elasticsearch.service
sudo systemctl enable elasticsearch.service
- 验证Elasticsearch是否正在运行:
curl -X GET "localhost:9200/"
以上步骤将在你的Linux系统上安装Elasticsearch 7.x版本。如果需要其他版本,请替换相应的版本号。记得开放防火墙端口9200以允许外部访问。
评论已关闭