ElasticSearch5.5.0安装(Linux)

一、部署环境

Java1.8.0
CentOS6.8
Elasticsearch5.5.0

二、前期准备

**
1.安装Java环境
2.创建一个新的用户,并加授权

[root@localhost /]# adduser test
[root@localhost /]# mkdir /soft
[root@localhost /]# chown test /soft
[root@localhost /]# ls -al /soft
drwxr-xr-x.  2 test root 4096 93 01:58 .
dr-xr-xr-x. 26 root root 4096 93 01:58 ..

**

三、安装

**
1.下载并解压elasticsearch

root@localhost soft]#wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.zip
root@localhost soft]unzip elasticsearch-5.5.0.zip

2.配置和修改config/elasticsearch.yml

添加
network.host: 0.0.0.0
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

3.修改内存配置:jvm.options(es默认2G内存,减小):

-Xms2g
-Xmx2g

改为

-Xms512m
-Xmx512m

四、错误处理

can not run elasticsearch as root
切换到非root用户
main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
改变elasticsearch文件夹所有者到当前用户

sudo chown -R noroot:noroot elasticsearch
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

sudo vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

sudo vi /etc/sysctl.conf 
添加下面配置:
vm.max_map_count=655360
使用以下命令使其生效
sudo sysctl -p
max number of threads [1024] for user [king] is too low, increase to at least [2048]

增加线程数 vi /etc/security/limits.d/90-nproc.conf
将其中的
*          soft    nproc     1024
改为
*          soft    nproc     2048

使用以下命令使其生效
sudo sysctl -p

你可能感兴趣的:(elasticsearch)