Introduction: elasticsearch as a distributed Lucene-based search engine, power of its search function Needless to say, while elasticsearch-head node as a project, can easily manage the cluster configuration elasticsearch
Installation elasticsearch
1. Download and extract the resource kit installed
- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.tar.gz
- tar -zxvf elasticsearch-6.2.4.tar.gz -C / usr / local / -C extracted to represent the specified directory
2, because the root account is not allowed es start in 5 versions, so you need to create a user
es useradd
chown -R es: es /usr/local/elasticsearch-6.2.4 given user rights assigned to extracted directory
3, modify configuration files es
- Modify ip and port numbers
- Possible error solutions (should be carried out under the root user to modify the time) when you start
vim /etc/security/limits.conf
Hard nofile 65536 *
* Soft nofile 65536 // * denotes any user, it can also be written as users start es
vim /etc/security/limits.d/20-nproc.conf
* soft nproc 4096
* hard nproc 4096
root soft nproc unlimited
root hard nproc unlimited
vim /etc/sysctl.conf file is added at the end of vm.max_map_count = 2621441
3, if you want to start in the background, you can use ./elasticsearch -d (of course, in the bin directory)
4, Elasticsearch multi-node configuration
a) a main node configurations (only one node)
Cluster # Name cluster.name: Demon # Node IP network.host: // 192.168.184.131 native IP # Name node node.name: elk-1 position of the storage of data # Path.Data: / Data / ES-Data # storage location running log of
path.logs: / var / log / elasticsearch
locked memory at startup #
bootstrap.memory_lock: to true
# Node port
http.port: 9200
# whether to support cross-domain
http.cors.enabled: to true
# * support all domain names
http.cors.allow-origin: "*"
a +) master node configuration (multiple nodes)
# Node name
node.name: Master
# Is there a master node qualified
node.master: to true
# cluster name
cluster.name: elasticsearch
# node ip
network.host: 192.168.184.131
Node # Name
node.name: Elk. 1-
# data storage location
Path.Data: / Data / ES-Data
# operation log storage location
path.logs: / var / log / elasticsearch
lock memory when the startup #
bootstrap.memory_lock: true
# Node port http.port: 9200 transport.tcp.port: 9300 #master minimum number discovery.zen.minimum_master_nodes: 1 # node list of the default port 9300, non 9300 need to bring a port number, automatically poll found discovery.zen. ping.unicast.hosts: [ " 192.168.184.131 : 9300", "192.168.184.131:9301","192.168.184.131:9302"]
# support cross-domain
http.cors.enabled: true
# * Support all domain names
http.cors.allow-origin: "*"
b) the child node configuration, remember to copy the entire file elasticsearch, to delete a file in the data directory, directory or data manually set separately
Installation elasticsearch-head plug
The relevant version: Elasticsearch: 6.2.4 node: 10.16.0 jdk: 1.8
Installation node
1, download resources wget https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz
2, extract the tar -xf node-v10.16.0-linux-x64.tar.xz
3, rename mv node-v10.16.0-linux-x64 nodejs
4, establish a soft link ln -s / usr / local / nodejs / bin / node / usr / local / bin
ln -s /usr/local/nodejs/bin/npm /usr/local/bin
5, using the node -v view node version
Installation elasticsearch-head plug
1, clone resources in the git: git clone git: //github.com/mobz/elasticsearch-head.git
2, elasticsearch-head into the directory: cd elasticsearch-head /
3, installed using npm install
Errors and solutions a) during Installation
i. phantomjs manually install
-
-
- Before that you need to install bz2, use yum install
- yum search bzip2 // Query installation package
- yum -y install bzip2.x86_64
- Decompression: tar -xjvf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C / data
- Soft establish the connection: ln -s /data/phantomjs-2.1.1-linux-x86_64/bin/phantomjs / usr / bin
- Use phantomjs -v view the installed version
- Before that you need to install bz2, use yum install
-
ii. 报错 “error while loading shared libraries: libfontconfig.so.1: cannot open” 解决:yum -y install fontconfig-devel
Error " Failed AT at The [email protected] install scriptb) " solve: npm install [email protected] --ignore-scripts
4、 更新curl:yum update -y nss curl libcurl
5, the installation appears
It generally represents a success
6, modified elasticsearch-head configuration
Modify Gruntfile.js file
Modify _site / app.js
Finally, using npm run install command to start, the following appears to indicate a successful start
final effect:
Reference article: https://www.cnblogs.com/cheyunhua/p/11238489.html