linux安装Elasticsearch详细步骤
坑都已经踩好了 照着步骤一次成功 不多废话 走起
# ## 安装java运行环境
elasticsearch是用Java实现的 跑elasticsearch必须要有jre支持 所以必须先安装jre
传送门 :
# ## 安装elasticsearch-7.8.1
也可以去官网下载 https://www.elastic.co/cn/downloads/elasticsearch
下载 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.12.1-linux-x86_64.tar.gz
解压后启动 elasticsearch
[root@localhost ~]# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.8.1.tar.gz [root@localhost ~]# tar -zxvf elasticsearch-7.8.1-linux-x86_64.tar.gz -C /usr/local/ [root@localhost ~]# sh /usr/local/elasticsearch-7.8.1/bin/elasticsearch
ps -ef|grep elasticsearch
elastic 已经启动了
启动时候 不能用root权限启动。
解决报错max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
从报错信息vm.max_map_count看出内存太小了 所以 需要修改vm.max_map_count的内存大小 切换到root账户 命令 su root
修改sysctl.conf文件 命令: vim /etc/sysctl.conf 如下:
输入命令:sysctl -p
[root@izbp1agmpooj77xy5u4sspz bin]# useradd elastic [root@izbp1agmpooj77xy5u4sspz bin]# chown -R elastic:elastic /usr/local/elasticsearch-7.8.1 [root@izbp1agmpooj77xy5u4sspz bin]# su elastic
配置文件报错
done < <(env) 【<改成三连,括号改成单引号】 done <<<'env'
[root@localhost ~]# vim /etc/security/limits.conf 在文件的末尾加上 elasticsearch soft nofile 65536 elasticsearch hard nofile 65536 elasticsearch soft nproc 4096 elasticsearch hard nproc 4096
配置 elasticsearch.yml
配置 jvm.options
启动完毕~!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)