首页 > 运维 > linux运维 > 正文

linux elasticsearch-8.2.0安装

雪夜
发布: 2025-07-23 09:28:13
原创
818人浏览过
  1. 下载并解压缩,命令行前不要留空格

官方下载地址:https://www.php.cn/link/88a9225cf17ea3bf8bef2b4658ef7bf2

下载链接:https://www.php.cn/link/fc64088b0f734c47f016d7a69cc53333

linux elasticsearch-8.2.0安装

解压命令:tar -zxvf elasticsearch-8.2.0-linux-x86_64.tar.gz

切换到目录:cd /usr/local/elasticsearch-8.2.2/bin/

启动Elasticsearch:./elasticsearch

[root@VM-4-3-centos bin]# ./elasticsearch

  1. 创建es用户

[root@VM-4-3-centos ~]# useradd es

[root@VM-4-3-centos ~]# passwd es

[root@VM-4-3-centos ~]# id es

uid=1001(es) gid=1001(es) groups=1001(es)

如果使用root账号启动Elasticsearch会报错:java.lang.RuntimeException: can not run elasticsearch as root

使用root账号创建用户:sudo adduser es

设置密码:sudo passwd es

对es用户授权,目录elasticsearch-8.2.0(重要):sudo chown -R es:es elasticsearch-8.2.0

  1. 切换es账号并启动服务

su es

./bin/elasticsearch

后台运行,避免客户端退出后服务停止:./bin/elasticsearch -d

帮衣帮-AI服装设计
帮衣帮-AI服装设计

AI服装设计神器,AI生成印花、虚拟试衣、面料替换

帮衣帮-AI服装设计 106
查看详情 帮衣帮-AI服装设计

当看到“started”时,服务已成功启动

关闭ES服务:kill pid

说明:Elasticsearch使用9300和9200端口,其中9300为tcp通讯端口,用于集群节点间通信,9200为http协议的RESTful接口

  1. 启动时报错,调整配置文件属性

解决内存不足问题:启动时卡住,可能是由于Elasticsearch默认分配的JVM空间大小为2g。修改JVM空间大小,如果Linux服务器配置较高,可以不做修改。

修改JDK启动内存:vim /usr/local/elasticsearch-8.2.0/config/jvm.options

-Xms256m
-Xmx256m
登录后复制

报错:Native controller process has stopped - no new native processes can be started

继续配置文件:sudo vim /etc/security/limits.conf

* soft nofile 262144
* hard nofile 131072
* soft nproc 4096
* hard nproc 4096
登录后复制

报错信息:

bootstrap check failure [1] of [3]: max number of threads [2048] for user [es] is too low, increase to at least [4096]

bootstrap check failure [2] of [3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

bootstrap check failure [3] of [3]: 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

soft nproc:单个用户可用的最大进程数量(超过会警告);hard nproc:单个用户可用的最大进程数量(超过会报错);soft nofile:可打开的文件描述符的最大数(超过会警告);hard nofile:可打开的文件描述符的最大数(超过会报错)

bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

在es bin目录执行:vim ../config/elasticsearch.yml

修改配置文件:

cluster.name: es.study
node.name: node-1
network.host: 0.0.0.0
http.port: 9200
bootstrap.memory_lock: false
#system_call_filter启动报错,去掉#
bootstrap.system_call_filter: false
# 为Elasticsearch设置登录密码
xpack.security.enabled: false
cluster.initial_master_nodes: ["node-1"]
# error downloading geoip database [GeoLite2-Country.mmdb]
#关闭geoip数据库的更新
ingest.geoip.downloader.enabled: false
登录后复制
  1. 其他

linux elasticsearch-8.2.0安装linux elasticsearch-8.2.0安装linux elasticsearch-8.2.0安装

以上就是linux elasticsearch-8.2.0安装的详细内容,更多请关注php中文网其它相关文章!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号