下载地址:Download Elasticsearch | Elastic
curl下载
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.10.2-linux-x86_64.tar.gz tar -xzvf elasticsearch-7.10.2-linux-x86_64.tar.gz cd elasticsearch-7.10.2 ./bin/elasticsearch2.解压,配置
tar -xzvf elasticsearch-7.10.0
cd elasticsearch-7.10.0
修改config目录下elasticsearch.yml文件:
cluster.name: my-application node.name: node-1 network.host: 0.0.0.0 # 所有ip可以访问 http.port: 9200 # 访问端口 cluster.initial_master_nodes: ["node-1"] #单节点写上方配置的节点名称3.启动
cd到bin目录下,执行启动脚本
./elasticsearch ./elasticsearch -d # 后台运行4.我遇到的问题以及解决方法
elasticsearch启动时错误 can not run elasticsearch as root_Kiven_l的博客-CSDN博客linux环境下启动es时报错如下:错误原因:es因为安全问题拒绝使用root用户启动;解决方法:1.添加用户组:es,用户:es,she,设置密码2.添加目录拥有权限groupadd es useradd es -g es -p password # -g 指定组 -p 密码chown es:es -R elasticsearch-7.10.0/ # -R 处理指定目录以及其子目录下的所有文件3.切换到es用户,启动su es./elasticsearchhttps://blog.csdn.net/Kiven_l/article/details/123329340?spm=1001.2014.3001.5502elasticsearch 7.10启动报错 bootstrap checks failed_Kiven_l的博客-CSDN博客错误信息:ERROR: [1] bootstrap checks failed[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535][2]: max number of threads [3795] for user [es] is too low, increase to at least [4096][3]: max virtual memory ahttps://blog.csdn.net/Kiven_l/article/details/123332956?spm=1001.2014.3001.5502
5.启动成功正常访问:
注:如果你是在虚拟机启动的es,宿主机访问不到时,关闭防火墙就好了,或者开放端口
systemctl stop firewalld.service
查看已经开放的端口:
firewall-cmd --list-ports
开放端口
firewall-cmd --zone=public --add-port=9200/tcp --permanent



