下载安装包
解压压缩包
tar-zxvfelasticsearch-8.7.0-linux-x86_64.tar.gz
修改elasticsearch.yml配置
进入config文件夹
cdelasticsearch-8.7.0/config/
编辑elasticsearch.yml
vimelasticsearch.yml
去掉network.host和http.port 注释
启动服务
./bin/elasticsearch
访问服务 http://ip:port 响应数据启动成功
启动报错
虚拟内存过低
nodevalidationexception[1] bootstrapchecksfailed. Youmustaddressthepointsdescribedinthefollowing [1] linesbeforestartingElasticsearch. bootstrapcheckfailure [1] of [1]: maxvirtualmemoryareasvm.max_map_count [65530] istoolow, increasetoatleast [262144] ERROR: Elasticsearchdidnotexitnormally-checkthelogsat/opt/elasticsearch-8.7.0/logs/elasticsearch.log
- 编辑 /etc/sysctl.conf
sudovim/etc/sysctl.conf
- 添加配置
vm.max_map_count=655360
- 保存修改
sudosysctl-p
安全验证访问 http://ip:9200 无反应
- 编辑elasticsearch.yml
vimconfig/elasticsearch.yml
- 将安全验证改为flase