ElasticSearch安装

1.下载ElasticSearch 地tar包 

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

1.1 解压

tar xf elasticsearch-6.4.1.tar.gz

1.2 进入elasticsearch目录

cd  elasticsearch-6.4.1

1.3 进入bin目录运行

cd bin
./elasticsearch

报错:不能以root 用户地方式启动创建用户和组

2. 创建es组

groupadd eszu

2.1 创建es用户

useradd chaopeng

2.2 指定用户密码

passwd chaopeng

2.3 修改文件所属用户

chown -R chaopeng  elasticsearch-6.4.1

2.4 修改文件所属组

chgrp -R eszu elasticsearch-6.4.1

3. 切换用户启动elasticsearch

su chaopeng
./elasticsearch

这时候elasticsearch已经成功启动,我们来测试一下curl localhost:9200,如果得到了这些数据就说明成功了,但是在浏览器里面并不能访问,需要修改配置文件

3.1 配置elasticsearch端口和ip

进入config文件夹,里面有一个elasticsearch.yml文件,添加如下内容

network.host: 192.168.1.53
http.port: 9200

3.2 再次启动elasticsearch,报错如下

[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [3802] for user [esyonghu] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

第一个错误需要将当前用户的软硬调用限制调大

切换到root用户配置/etc/security/limits.conf

文件末尾添加:

chaopeng soft nofile 65536
chaopeng hard nofile 131072
chaopeng soft nproc 2048
chaopeng hard nproc 4096

第二个错误修改/etc/security/limits.d/20-nproc.conf 文件

chaopeng soft nproc  4096

第三个错误需要修改/etc/sysctl.conf,添加如下

vm.max_map_count=262144

需要使改文件生效,执行sysctl -p

切换到chaopeng用户启动elasticsearch

以后台方式启动

./bin/elasticsearch -d

结束elasticsearch

输入jps命令,杀死elasticsearch进程

如果绑定本地ip失败,那么在elasticsearch.yml里面加上

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值