安装其实很简单,直接上官网链接:下载地址,官网提供了所有安装方式,总一款适合你。我的目标系统是Debian12,包管理是apt-get,所以就以这个为示例,仅供参考。
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
sudo apt-get install apt-transport-https
echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt-get update && sudo apt-get install elasticsearch
sudo systemctl daemon-reload
sudo systemctl enable elasticsearch.service
sudo systemctl start elasticsearch.service
通过端口号看一下:netstat -anlt
命令请求验证一下:
curl http://127.0.0.1:9200
解决方案:修改/etc/elasticsearch/elasticsearch.yml文件,将xpack.security.enabled: true改为false。
cd /etc/elasticsearch
sudo vi elasticsearch.yml
重启
systemctl restart elasticsearch.service
curl http://127.0.0.1:9200
浏览器访问:ip:9200
安装完成!!!