Elasticsearch5.X and head plug-in installation instructions under Linux

Elasticsearch5.X and head plugin installation instructions:

1. Download the elasticsearch installation file:

a) Download the official source code:

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz

b) Unzip the compressed file

tar -zxvf elasticsearc-5.0.0.tar.gz

c)  Modify the es configuration file: elasticsearch.yml

cluster.name: kd-cluster // Cluster name, the same cluster name for all hosts is used to discover cluster nodes

node.name: node01 // Node name

node.master: true // Whether the node is used as a management node

node.data: true // Whether the node is used as a data node

node.attr.rack: r1

path.data: data storage path (folder)

path.logs: log storage path (folder)

bootstrap.memory_lock: false

network.host: 172.16.8.229 // node ip address

http.cors.enabled: true // configuration of the head plugin

http.cors.allow-origin: "*" // configuration of the head plugin

http.port: 9200 // Cluster access port

discovery.zen.ping.unicast.hosts: ["node01"] // If mutual trust is configured, the node name can be used in this location (generally the node name is the same as the computer name). If mutual trust is not configured, the host ip is used to discover the management node.

discovery.zen.minimum_master_nodes: 1 // Maximum number of cluster management nodes (configuration to prevent split-brain)

gateway.recover_after_nodes: 1

d) Modify the host configuration

vi /etc/security/limits.conf 

* soft nofile 65536

* hard nofile 131072

* soft nproc 2048

* hard nproc 4096

vi /etc/security/limits.d/90-nproc.conf 

* soft nproc 2048

vi /etc/sysctl.conf 

vm.max_map_count=655360

and execute the command: sysctl -p

Restart the computer.

2. Download the elasticseatch-head plugin:

a)  Download the head plugin file:

https://github.com/mobz/elasticsearch-head (download and upload to server)

git clone git://github.com/mobz/elasticsearch-head.gitgit下载)

b)  Download Node.js :

wget https://nodejs.org/dist/v4.6.1/node-v4.6.1-linux-x64.tar.gz ( linux command direct download)

https://nodejs.org/dist/ (download from the official website and upload to the server)

c)  Configure node.js environment variables:

vim /etc/profile

export PATH=/data/elasticsearch/node-v4.6.1-linux-x64/bin:$PATH (add according to the actual situation, the path and format refer to the local environment)

Execute source /etc/profile to make environment variables take effect

(Modifying the profile file requires root privileges, and the commands to make the environment take effect are executed under the current es cluster user)

d)  Check whether there is a node_modules/grunt directory in the current head plugin directory:

no: execute command to create: npm install grunt --save

e)  Install the head plugin:

npm install

Or install using redirection: npm install -g cnpm --registry=https://registry.npm.taobao.org

f)  Install grunt :

npm install -g grunt-cli

g)  Edit Gruntfile.js

Add hostname: '0.0.0.0' on line 93 of the file

h)  Check if the base folder exists in the head root directory

No: copy the base folder and its contents under _site to the head root directory

i)  Start grunt server :

Run grunt server -d under head to start the head plugin

j)  Access the head plugin:

http://localhost:9100 (there will be a prompt after startup: Started connect web server on http://localhost:9100 )

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326208825&siteId=291194637