Description
ES website does not recommend the use of elastic Server root users, so the ES cluster configuration are using the ordinary account operation, new account elastic.
The Linux version is CentOS 7.3,es version for 5.5.0.
First, download and install the ES program
Download path:/home/elastic
Download Instructions:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.0.tar.gz
Installation Instructions: TAR-ZXVF elasticsearch-5.5.0.tar.gz
Second, system parameter setup
In order for the ES service to start properly, you need to set the following parameters (root permissions):
1. Modify max file descriptors parameters
Vim/etc/security/limits.conf Open Limits File
Add or modify the following two line parameters:
* Hard Nofile 65536
* Soft Nofile 65536
To see if the setting parameters are in effect:
Ulimit-hn
Note: The account needs to log off and then log back in to view the set value.
This setting parameter corresponds to the following ES startup error:
Max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
2, modify the Vm.max_map_count parameters
1) Temporary modification method:
Sysctl-w vm.max_map_count=262144
Sysctl-p
To view parameter directives:
sysctl-a | grep "Vm.max_map_count"
Note: After the host restarts, the parameters are restored.
2) Permanent modification method:
vim/etc/sysctl.conf add vm.max_map_count=262144, Save and execute sysctl-p.
This setting parameter corresponds to the following ES startup error:
Max virtual Memory Areas Vm.max_map_count [65530] likely too low, increase to at least [262144]
Third,es cluster configuration
client node Clinet:
Intranet ip:172.26.178.100
ELASTICSEARCH.YML parameter configuration: Path/home/elastic/elasticsearch-5.5.0/config
Modify the file parameters as follows:
Cluster.name:tuyou-application
node.name:node-195
#client节点设置
Node.master:false
Node.data:false
network.host:172.26.178.100
http.port:9200
#查询master节点地址列表
Discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
#配合head插件管理ES集群
Http.cors.enabled:true
Http.cors.allow-origin: "*"
mixed node Master/data:
Intranet ip:172.26.178.99
ELASTICSEARCH.YML parameter configuration:
Modify the file parameters as follows:
Cluster.name:tuyou-application
node.name:node-255
network.host:172.26.178.99
http.port:9200
Discovery.zen.ping.unicast.hosts: ["172.26.178.98", "172.26.178.99"]
Discovery.zen.minimum_master_nodes:2
mixed node Master/data:
Intranet ip:172.26.178.98
ELASTICSEARCH.YML parameter configuration:
Modify the file parameters as follows:
Cluster.name:tuyou-application
node.name:node-150
network.host:172.26.178.98
http.port:9200
Discovery.zen.ping.unicast.hosts: ["172.26.178.99", "172.26.178.98"]
Discovery.zen.minimum_master_nodes:2
Four, the installation of participle plug-in
Note: The client node does not need to be installed
Plug-ins include: IK Chinese word breaker, pinyin pinyin participle plug-in, note that the plugin version and ES version consistent.
Copy the plug-in folder to the plugins path of ES, with the path address as follows:
/home/elastic/elasticsearch-5.5.0/plugins
IK Plug-in configuration description:
Path: The IKAnalyzer.cfg.xml file under/home/elastic/elasticsearch-5.5.0/plugins/ik/config.
<?xml version= "1.0" encoding= "UTF-8"?> <!
DOCTYPE Properties SYSTEM "Http://java.sun.com/dtd/properties.dtd" >
<properties>
<comment> IK Analyzer Extension Configuration </comment>
<!--users can configure their own extended dictionaries here-->
<entry key= "Ext_dict" >custom/ Mydict.dic;custom/single_word_low_freq.dic;custom/sougou.dic</entry>
<!--users can configure their own extended stop word dictionaries here-- >
<entry key= "Ext_stopwords" >custom/ext_stopword.dic</entry>
<!--Users can configure the remote extension dictionary here-- >
<!--<entry key= "Remote_ext_dict" >http://192.168.1.152:8080/tour/interface/getcustomdict.htm </entry>-->
<!--Users can configure the remote extension Stop word dictionary here-->
<!--<entry key= "Remote_ext_stopwords" > words_location</entry>-->
</properties>
Note: The external dictionary is temporarily closed.
V. start the service
The three services are switched to elastic users in the following path:
/home/elastic
Follow the instructions below to start the ES service in the background:
./elasticsearch-5.5.0/bin/elasticsearch-d
View ES service Process directives:
Ps-ef | grep elasticsearch
Once started, you can see if the service is working correctly by following these commands:
Curl http://Intranet Ip:9200/