笔记搬到博客 - CentOS-6.8安装elasticsearch-5.5.3

经过网络搜索、整理、实践笔记

 

1. elastic官网下载es安装文件

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

2. 解压文件

将文件上传至服务器存放的目录,执行解压:

tar -zxvf elasticsearch-5.5.3.tar.gz

3. 启动

elasticsearch2.3以后不允许root 用户启动es服务,创建一个新用户来启动服务

root下创建用户:useradd elastic

对文件夹授权:chown -R elastic elasticsearch-5.5.3

权限:chmod 755 elasticsearch-5.5.3

4. elasticsearch.yml配置修改

打开文件:vim config/elasticsearch.yml

修改访问IP的名称:network.host: 59.110.104.99

打开访问的端口:http.port: 9200

参考配置:bootstrap.memory_lock: true

(待确认)之前配置:

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

跨域支持:

http.cors.enabled: true

http.cors.allow-origin: "*"

5. max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

vim /etc/sysctl.conf

add:

#for elasticsearch

vm.max_map_count = 262144

执行命令:sysctl -p

sysctl vm.max_map_count 检查是否生效,临时方法:sysctl -w vm.max_map_count=262144

6. 调整虚拟机参数

vi jvm.options

-Xms32766m

-Xmx32766m

7. max number of threads [1024] for user [es] likely too low, increase to at least [2048]

vim /etc/security/limits.d/90-nproc.conf

* soft nproc 1024 修改为:

* soft nproc 2048

8. max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]

执行:vim /etc/security/limits.conf

修改:

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

9. 启动停止es服务

启动:

su elastic

./elasticsearch --前台

./elasticsearch -d --后台

停止:

kill -9 进程号

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值