ES环境搭建
搭建集群环境
选择 7.5.0. 更高版本需要jdk9 甚至更高版本.
1 | wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.0-linux-x86_64.tar.gz |
后续下载, 先下载jdk11, 然后下载高版本的 es.
下载并解压
修改配置文件
default : $ES_HOME/config/elasticsearch.yml
一般需要修改的几个地方如下:
1 | # 集群名称 |
具体配置文件解释见: elasticsearch配置文件详解
配置集群模式,在其它节点修改以上对应配置项,启动即可。
- 启动
1
./bin/elasticsearch -d
异常
bootstrap check failure [1] of [2]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
第二个异常: 原因是 es用户拥有的内存权限太小。 至少需要262144.
解决方案: sudo sysctl -w vm.max_map_count=262144
第一个异常:
解决方案: vim /etc/security/limits.conf, 添加
tensor soft nofile 65536
tensor hard nofile 65536
root soft nofile 65536
root hard nofile 65536
https://blog.csdn.net/qq_38636133/article/details/105621876
验证:
1 | ulimit -Hu |
ubuntu 环境不生效.
经过排查,limits.conf这个文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so模块的配置文件,然而,ubuntu的PAM默认并没有加载这个模块,导致最后limits.conf里面的配置不生效。
- sudo vim /etc/pam.d/su
https://mikemiao.com/ubuntu-limits-conf/
第三个异常:1
[2]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
解决: cluster.initial_master_nodes: [“tensor-es”]
node.name: tensor-es
最大文件描述符》》》 ubuntu子系统 没法改.
使用 高版本es.
配置使用高版本的jdk. JAVA11_HOME=
重启win10 子系统
1 | net stop LxssManager |