ES安装
赛博朔方 枫叶
0.系统环境:# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
JDK:1.8.133
ELK:6.0.0
# tar -zxf jdk-8u131-linux-x64.tar.gz
# mv jdk1.8.0_131/ jdk
# vim /etc/profile
#java
export JAVA_HOME=/home/software/jdk
export PATH=$PATH:$JAVA_HOME/bin
# source /etc/profile
# java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
# useradd elasticsearch
# echo qynsy,stjdc |passwd --stdin elasticsearch
# echo "elasticsearch ALL = (root) NOPASSWD:ALL" | tee /etc/sudoers.d/elasticsearch
# chmod 0440 /etc/sudoers.d/elasticsearch
# wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz
# tar -zxvf elasticsearch-6.0.0.tar.gz
# mv elasticsearch-6.0.0 es
# chown -R elasticsearch:elasticsearch /home/software/es
# mkdir -p /home/data/es/data
# mkdir -p /home/data/es/logs
# chown -R elasticsearch:elasticsearch /home/data/es/
# vim /etc/security/limits.conf
elasticsearch soft memlock unlimited #指定用户在当前系统生效的最大锁定内存地址空间
elasticsearch hard memlock unlimited
* soft nofile 65536 #所有用户在当前系统生效的文件描述符的数量
* hard nofile 131072
* soft nproc 2048 #所有用户在系统中创建的进程数的限制
* hard nproc 4096
# vim /etc/security/limits.d/20-nproc.conf
修改如下内容:
* soft nproc 1024
修改为
* soft nofile 65536
* hard nofile 65536
* soft nproc 65536
* hard nproc 65536
* soft memlock -1
* hard memlock -1
# vim /etc/sysctl.conf
vm.max_map_count=655360
# sysctl -p
# vim /etc/profile
#es
export ES_HOME=/home/software/es
export PATH=$PATH:$ES_HOME/bin
# source /etc/profile
# vim /home/software/es/config/elasticsearch.yml(这个需要根据使用者各自的业务进行具体修改)
# su elasticsearch
$ elasticsearch -d
(如果有问题会直接控制台报错,很多原因是文件权限问题,注意!)
# curl 'http://masternode01:9200/?pretty'
{
"name" : "masternode01",
"cluster_name" : "sfinfoELK",
"cluster_uuid" : "K43Cw_R_R7u5puJwaZqKkw",
"version" : {
"number" : "6.0.0",
"build_hash" : "8f0685b",
"build_date" : "2017-11-10T18:41:22.859Z",
"build_snapshot" : false,
"lucene_version" : "7.0.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}