一懦砂、安裝
下載
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用戶下運行最仑,所以需要創(chuàng)建獨立的用戶來運行es姨拥。創(chuàng)建elasticsearch用戶組及elasticsearch用戶
groupadd elasticsearch
useradd elasticsearch -g elasticsearch -p elasticsearch
分配權(quán)限
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
重新設(shè)置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中,然后執(zhí)行sysctl -p
2、錯誤:max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
原因:在Linux的系統(tǒng)中對于進程會有一些限制
切換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