一、安装
下载
wget [https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz)
解压
tar -zvxf elasticsearch-5.5.2.tar.gz -C /usr/local/
因为es不允许在root用户下运行,所以需要创建独立的用户来运行es。创建elasticsearch用户组及elasticsearch用户
groupadd elasticsearch
useradd elasticsearch -g elasticsearch -p elasticsearch
分配权限
chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-5.5.2
切换用户
su elasticsearch
启动,进入到elasticsearch-5.5.2目录
bin/elasticsearch
bin/elasticsearch -d 后台启动
二、bootstrap checks failed解决方法
1、 错误:max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
查看max_map_count的值
$ cat /proc/sys/vm/max_map_count
65530
重新设置max_map_count的值
$ sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144
永久更改max_map_count值,
vm.max_map_count=200000直接写到/etc/sysctl.conf中,然后执行sysctl -p
2、错误:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
原因:在Linux的系统中对于进程会有一些限制
切换root用户
vi /etc/security/limits.conf
在文件末尾加入以下代码
elasticsearch soft nofile 65536
elasticsearch hard nofile 131072
elasticsearch soft nproc 2048
elasticsearch hard nproc 4096
重新登录elasticsearch用户
三、安装ik插件
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.5.2/elasticsearch-analysis-ik-5.5.2.zip
网友评论