虚拟机centos7.2部署elasticsearch7.5+Kibana7.5

es

https://www.elastic.co/cn/downloads/kibana

es和Kibana必须版本一致才可以,当前版本7.5

es必须放在普通用户的目录下编译运行

具体部署:参考https://www.elastic.co/downloads/elasticsearch

遇到的问题:

一.could not find java in bundled JDK at /root/download/elasticsearch-7.15.2/jdk/bin/java

解决:

kkk是我创建的非root用户
1.切换kkk用户的/home/kkk目录,用kkk账户执行
2.export ES_JAVA_HOME=/home/kkk/kkk/elasticsearch-7.15.2/jdk
二.max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

原因:max_map_count 这个参数就是允许一个进程在 VMAs(虚拟内存区域)拥有最大数量,VMA 是一个连续的虚拟地址空间,当进程创建一个内存映像文件时 VMA 的地址空间就会增加,当达 到max_map_count 了就是返回 out of memory errors。

出现这个问题,我们需要切换到 root 用户下。

vi /etc/sysctl.conf 

//添加以下配置  
vm.max_map_count=655360
添加完后保存,然后执行:
sysctl -p
//-p   从指定的文件加载系统参数,如不指定即从/etc/sysctl.conf中加载
三. max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

原因:最大文件打开数量太小,出现此错误,切换到 root 用户下,修改 limits.conf。

// 编辑此文件
vim /etc/security/limits.conf
在文件后加上

* soft nofile 65536
* hard nofile 65536`

重新登陆用户生效

四。max number of threads [3798] for user [kkk] is too low, increase to at least [4096]

设置/etc/security/limits.conf

添加kkk为你的linux普通用户的用户名

kkk soft nofile 65536

kkk hard nofile 65536

五。es开放远程连接:

network.host: 0.0.0.0

network.bind_host: 0.0.0.0

network.publish_host: 0.0.0.0

Additionally:

discovery.seed_hosts: ["0.0.0.0", "[::0]"]

并且开放防火墙端口

参考:

https://blog.csdn.net/oHeiZhiShi123/article/details/98942984?spm=1001.2101.3001.6650.6&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-6.highlightwordscore&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-6.highlightwordscore

[https://blog.csdn.net/vincent_duan/article/details/100880327](Elasticsearch启动问题:max number of threads [3753] for user [XX] is too low, increase to at least [4096])

https://www.cnblogs.com/mjtabu/p/14314088.html

[https://stackoverflow.com/questions/33696944/how-do-i-enable-remote-access-request-in-elasticsearch-2-0](How do I enable remote access/request in Elasticsearch 2.0?)