搭建部署过程中常见的错误
ES错误:can not run elasticsearch as root
ES错误:could not find java in bundled JDK at /root/data/elasticsearch-7.16.2/jdk/bin/java
ES错误:外部无法访问ElasticSearch
ES错误:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
ES错误:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ES错误:the default discovery settings are unsuitable for production use; at least one of [discovery.se]
搭建部署步骤
下载Elasticsearch
curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.16.2-linux-x86_64.tar.gz
解压
tar -zxvf elasticsearch-7.16.2-linux-x86_64.tar.gz
修改配置让外部能访问
# config目录下执行
vim elasticsearch.yml
# 加入下方配置 (默认只能本地访问,加入下方配置外部即可访问)
network.host: 0.0.0.0
启动ElasticSearch
# 可以加上 -d 参数表示后台运行
# ./bin/elasticsearch -d
./bin/elasticsearch
测试是否启动成功
发送一个 HTTP 请求到 localhost 的端口9200来测试 Elasticsearch 节点是否正在运行
http://192.168.6.130:9200/
响应如下内容表示启动成功