Elasticsearch Linux安装

Linux版本CentOS 7

一. 下载Elasticsearch

官方版本: [https://www.elastic.co/cn/downloads/past-releases#elasticsearch](https://www.elastic.co/cn/downloads/past-releases#elasticsearch)

二. 解压Elasticsearch到 /usr/local/ 目录下

tar -avxf elasticsearch.tar.gz -C /usr/local/

三. 解压后进入elasticsearch

1. 创建一个 data 目录

mkdir data

2.修改 elasticsearch/config/elasticsearch.yml

cluster.name: my-application #集群名称
node.name: node-1 #节点名称
#数据和日志的存储目录
path.data: /usr/local/elasticsearch-7.1.1/data path.logs: /usr/local/elasticsearch-7.1.1/logs
#设置绑定的ip,设置为0.0.0.0以后就可以让任何计算机节点访问到了
network.host: 0.0.0.0 http.port: 9200 #端口
#设置在集群中的所有节点名称,这个节点名称就是之前所修改的,当然你也可以采用默认的也行,目前是单机,放入一个节点即可
cluster.initial_master_nodes: [“node-1”]
#增加参数,使head插件可以访问es
http.cors.enabled: true
http.cors.allow-origin: “*”

完成后保存退出 wq!

四.添加一个 es 用户启动 elasticsearch

elasticsearch 为了安全不能用root用户启动

adduser es
passwd es
(再输入新的密码和确认密码)

改一下es目录所属用户:

chown es /usr/local/elasticsearch-7.1.1/ -R

vim 编辑 /etc/security/limits.conf,在末尾加上

es soft nofile 65536
es hard nofile 65536
es soft nproc 4096
es hard
nproc 4096

vim 编辑 vim /etc/security/limits.d/20-nproc.conf,将 * 改为用户名 es

es soft nproc 4096
root soft nproc unlimited

vim 编辑 /etc/sysctl.conf,在末尾加上

vm.max_map_count = 655360

执行 sysctl -p:\

[root@localhost ~]# sysctl -p
vm.max_map_count = 655360

到此 Elasticsearch的安装就算完成了
上述内容根据 https://blog.csdn.net/luo1544943710/article/details/93196147所写,
如果侵权请告知

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值