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

 

 

 

 

 启动完毕~!

 

posted @ 2020-08-12 10:06  黑锦鲤  阅读(2844)  评论(1编辑  收藏  举报