Linux安装ES(elasticsearch-6.2.4)

安装elasticsearch-6.2.4

wget 命令安装:

$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz

$ tar -zxvf elasticsearch-6.2.4.tar.gz -C /usr/local/

$ sh /usr/local/elasticsearch-6.2.4/bin/elasticsearch

执行sh /usr/local/elasticsearch-6.2.4/bin/elasticsearch会报错
在这里插入图片描述
从5.0开始 elasticsearch 安全级别提高,不允许采用root帐号启动,所以,我们要添加一个用户,用来启动 es

先把防火墙关了

$ systemctl stop firewalld.service
$ systemctl disable firewalld.service	//禁止防火墙开机启动

创建es用户

$ useradd es

把目录权限赋予给es用户

$ chown -R es:es /usr/local/elasticsearch-6.2.4

切换至es用户

$ su es

修改:elasticsearch.yml

$ vi /usr/local/elasticsearch-6.2.4/config/elasticsearch.yml

把 host改为本机地址:
在这里插入图片描述

接着执行 :

$ sh /usr/local/elasticsearch-6.2.4/bin/elasticsearch

注意:
以下操作都要切换到root下执行

$ su root

修改/etc/security/limits.conf文件,在文件末尾添加如下:

$ vi /etc/security/limits.conf
 *       hard    nofile           65536
 *       soft     nofile           65536

在文件末尾添加如下:

$ vi /etc/security/limits.d/20-nproc.conf
 *            soft            nproc     4096
 *            hard          nproc     4096
 root       soft            nproc     unlimited

/etc/sysctl.conf文件末尾添加

$ vi  /etc/sysctl.conf

vm.max_map_count = 2621441

图示:
在这里插入图片描述


立即生效

$ sudo sysctl -p /etc/sysctl.conf

切换到es用户启动

$ su es

$ /usr/local/elasticsearch-6.2.4/bin/elasticsearch

成功↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

在这里插入图片描述

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值