注意:已非root用户操作一下操作,切记 切记 切记
1、官网下载ElasticSearch7.2
打开官⽹链接 https://www.elastic.co/guide/en/elastic-stack/7.2/index.html
选择你要下载的版本



下载完成之后,解压到自己想放的路径下
2、JDK环境配置。。。省略
注意:ElasticSearch对jdk版本要求很严格,我用的jdk11对应ES7.2
3、修改配置文件:/opt/es/elasticsearch-7.2.0/config/elasticsearch.yml
network.host: 192.168.164.26
http.port: 9200
4、启动
查看所有用户:compgen -u
创建用户:useradd es
创建密码:passwd es
切换用户到es:sudo su 或者 su --》 su es
进入到|/opt/es/elasticsearch-7.2.0/bin/,
启动命令:./elasticsearch
后台运行:./elasticsearch -d
或者守护进程的方式可以使用sh elasticsearch.sh -d -p pid
启动问题处理:
ERROR: [5] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: memory locking requested for elasticsearch process but memory is not locked
[3]: max number of threads [1024] for user [wangxiang] is too low, increase to at least [4096]
[4]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[5]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
1.修改vi /etc/security/limits.conf文件,增加配置
* soft nofile 65536
* hard nofile 65536
2. 切换到root用户,编辑vi /etc/security/limits.conf配置文件,添加如下内容:
* soft memlock unlimited
* hard memlock unlimited
备注:\* 代表Linux所有用户名称
3. 最大线程个数太低。修改配置文件 vi /etc/security/limits.d/90-nproc.conf
* soft nproc 4096
* hard nproc 4096
4. 修改/etc/sysctl.conf文件,增加配置
vm.max_map_count=262144
或者
vm.max_map_count=655360
执行命令sysctl -p生效
5. 在elasticsearch.yml中添加配置项
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
6、在elasticsearch.yml中修改配置项
node.name: node-1
cluster.initial_master_nodes: ["node-1"]
保存重启后访问

还没有评论,来说两句吧...