20-linux under elasticsearch.6.2.2 cluster installation with Head, Kibana, X-pack. Plug-in configuration installation __linux

Source: Internet
Author: User
Tags create directory deprecated mixed pack git clone kibana

Introduction: Mainly on the three Linux servers, cluster installation elasticsearch.6.2.1, and its ES plug-ins, a variety of management software 1. cluster installation es 1.1 environment

Domain          IP
biluos.com      192.168.10.173
biluos1.com     192.168.10.174
biluos2.com     192.168.10.175
The latest version of JDK is installed on 1.2 machines
[Root@biluos es]# java-version
openjdk version "1.8.0_161"
openjdk Runtime-Environment (build 1.8.0_161-b14)
OpenJDK 64-bit Server VM (build 25.161-b14, mixed mode)
[Root@biluos es]# 

[root@biluos1 ~]# java-version
java version ' 1.8.0_121 '
java (TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot (TM) 64-bit Server VM (build 25.121-b13, Mixed mode)
[ ROOT@BILUOS1 ~]# 

[root@biluos2 ~]# java-version
java Version "1.8.0_121"
Java (TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot (TM) 64-bit Server VM (build 25.121-b13, Mixed mode)
1.3 Three machines are unified user for ES
[Root@biluos ~]# useradd es you have new mail in/var/spool/mail/root [root@biluos ~]# passwd ES
# The password is qwaszx changing password for user es. New Password:bad Password:it is based on a dictionary word bad Password:is too simple retype new password:passwd:al
L Authentication tokens updated successfully.                                    [Root@biluos ~]# mkdir/home/es mkdir:cannot Create directory '/home/es ': File exists [root@biluos ~]# ll/home/ # Note is not ES user and user group total 4 drwx------3 es es 4096 Feb 03:51 es [root@biluos ~]# [Root@bil UOS1 ~]# useradd es [root@biluos1 ~]# passwd es # password for qwaszx [root@biluos1 ~]# mkdir/ home/es [root@biluos1 ~]# ll/home/# Note If ES users and user groups [Root@biluos2 ~]# useradd es [root@b  Iluos2 ~]# passwd es # password qwaszx [root@biluos2 ~]# mkdir/home/es [Root@biluos2 ~]# Ll/home/# attention is not ESUsers and user groups 
 
1.4 Three machines are established/home/es/elasticsearch directory, used to store ES packages and data storage, using ES users
[Root@biluos1 ~]# su es
[es@biluos1 root]$ cd/home/es/
[es@biluos1 ~]$, mkdir elasticsearch
[es@biluos1 ~]$ L L
drwxrwxr-x 2 es es 4096 Feb 03:59 elasticsearch
[es@biluos1 ~]$ the 

remaining two units here omitted
1.5 Three machines are unpacked and installed to/home/es/elasticsearch

Download: Https://www.elastic.co/cn/downloads/elasticsearch
Package: elasticsearch-6.2.2.tar.gz
Decompression: Tar-zxvf/home/es/elasticsearch/elasticsearch-6.2.2.tar.gz-c/home/es/elasticsearch

[Root@biluos elasticsearch-6.2.0]# pwd
/home/es/elasticsearch/elasticsearch-6.2.0

[es@biluos1 elasticsearch-6.2.0]$ pwd
/home/es/elasticsearch/elasticsearch-6.2.0

[Es@biluos2 elasticsearch-6.2.0]$ PWD
/home/es/elasticsearch/elasticsearch-6.2.0
1.6 Three machines have modified ES software package permissions for ES users

Because I'm root-unzipped.

[Es@biluos2 elasticsearch]$ ll Total
4
drwxr-xr-x 9 root root 4096 Feb-04:04 elasticsearch-6.2.0

To modify permissions using the root user

[Es@biluos2 ~]$ su root
Password: 
[root@biluos2 es]# chown-r es:es/home/es/The

remaining two units omitted here
1.7 Three machines create data directories and log directories, using ES users
[Root@biluos2 es]# su es
[es@biluos2 ~]$ mkdir-p/home/es/elasticsearch/elasticsearch-6.2.0_data/data/
[ Es@biluos2 ~]$ mkdir-p/home/es/elasticsearch/elasticsearch-6.2.0_data/logs/The

remaining two units are omitted here
1.8 Three machines are modified configuration

191.168.10.173 machine configuration
Vim/home/es/elasticsearch/elasticsearch-6.2.2/config/elasticsearch.yml

Cluster.name:lcc-application # must be the same node.name:node-191-168-10- 173 # must be different path.data:/home/es/elasticsearch/elasticsearch-6.2.0
_data/data/path.logs:/home/es/elasticsearch/elasticsearch-6.2.0_data/logs/bootstrap.memory_lock:false Bootstrap.system_call_filter:false network.host:0.0.0.0 http.port:9200 # cluster discovers #集群节点ip或者主机 Discovery.zen.ping.unica St.hosts: ["192.168.10.173", "192.168.10.174", "192.168.10.175"] #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点. The default is 1, for large clusters, you can set a larger value (2-4) Discovery.zen.minimu      
M_master_nodes:3 # The following two lines are configured for the Haad plug-in configuration and the three servers are consistent.                                                                                                                                                                                                   
Http.cors.enabled:true Http.cors.allow-origin: " *"       

191.168.10.174 machine configuration
Vim/home/es/elasticsearch/elasticsearch-6.2.2/config/elasticsearch.yml

Cluster.name:lcc-application # must be the same node.name:node-191-168-10- 174 # must be different path.data:/home/es/elasticsearch/elasticsearch-6.2.0
_data/data/path.logs:/home/es/elasticsearch/elasticsearch-6.2.0_data/logs/bootstrap.memory_lock:false Bootstrap.system_call_filter:false network.host:0.0.0.0 http.port:9200 # cluster discovers #集群节点ip或者主机 Discovery.zen.ping.unica St.hosts: ["192.168.10.173", "192.168.10.174", "192.168.10.175"] #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点. The default is 1, for large clusters, you can set a larger value (2-4) Discovery.zen.minimu      
M_master_nodes:3 # The following two lines are configured for the Haad plug-in configuration and the three servers are consistent.                                                                                                                                                                                                   
Http.cors.enabled:true Http.cors.allow-origin: " *"       

191.168.10.175 machine configuration
Vim/home/es/elasticsearch/elasticsearch-6.2.2/config/elasticsearch.yml

Cluster.name:lcc-application # must be the same node.name:node-191-168-10- 175 # must be different path.data:/home/es/elasticsearch/elasticsearch-6.2.0
_data/data/path.logs:/home/es/elasticsearch/elasticsearch-6.2.0_data/logs/bootstrap.memory_lock:false Bootstrap.system_call_filter:false network.host:0.0.0.0 http.port:9200 # cluster discovers #集群节点ip或者主机 Discovery.zen.ping.unica St.hosts: ["192.168.10.173", "192.168.10.174", "192.168.10.175"] #设置这个参数来保证集群中的节点可以知道其它N个有master资格的节点. The default is 1, for large clusters, you can set a larger value (2-4) Discovery.zen.minimu      
M_master_nodes:3 # The following two lines are configured for the Haad plug-in configuration and the three servers are consistent.                                                                                                                                                                                                   
Http.cors.enabled:true Http.cors.allow-origin: " *"       
1.9 Three machines have modified Linux under/etc/security/limits.conf file SettingsChange the maximum file description limit requirements for Linux
Add or modify the following:
* Soft Nofile 262144
* Hard Nofile 262144 Change the lock memory limit requirements for Linux
Add or modify the following:
User (Elasticsearch) soft Memlock Unlimited
User (Elasticsearch) hard Memlock Unlimited

The final configuration is as follows

vim/etc/security/limits.conf

* Soft nofile 262144                                                                                                                                              
* Hard nofile 262144                                                                                                                                              
es soft Memlock Unlimited                                                                                                                                         

Here es is ES user 1.10 Three machines are modified configure Linux under/etc/security/limits.d/90-nproc.conf file Settings

Change the maximum number of threads for Linux, add or modify as follows:
* Soft Nproc Unlimited

vim/etc/security/limits.d/90-nproc.conf
*          soft    Nproc     unlimited
root       soft    Nproc     Unlimited
1.11 Three machines are modified configure Linux/etc/sysctl.conf file SettingsChange Linux one to have the most memory area requirements, add or modify the following:
Vm.max_map_count = 262144 Change Linux disable swapping, add or modify as follows:
vm.swappiness = 1
vim/etc/sysctl.conf

vm.max_map_count = 262144
vm.swappiness = 1
1.12 machines are activated .
[Es@biluos elasticsearch-6.2.2]$  bin/elasticsearch

[es@biluos1 elasticsearch-6.2.2]$  bin/ Elasticsearch

[Es@biluos2 elasticsearch-6.2.2]$  Bin/elasticsearch

Just the error,

[2018-02-25t13:49:33,967] [WARN] [O.e.d.z.zendiscovery     ] [node-191-168-10-173] Not enough master nodes discovered during pinging (found [[candidate{ NODE={NODE-191-168-10-173}{WQUJ4GYUTTEO7M5UXZSBIQ}{19L-SAVFRVQVYYJSKTBP_G}{192.168.1.194}{192.168.1.194:9300}, Clusterstateversion=-1}]], but needed [3]), pinging again

I thought it was because I did not configure SSH, and finally found that the above IP write wrong, and then verify that the SSH is not configured to be OK.

This is the first boot on the top of the print log, the other is the same, less log

Now there's a question that I'm visiting
Http://192.168.10.173:9200/
Http://192.168.10.174:9200/
Http://192.168.10.175:9200/
Can print out the version number, to prove that the correct operation, I tried to shut down a 174, found http://192.168.10.174:9200/can not open, and then, I think there should be a master master, but who is the Lord. Not good to see, below we install the graphical interface head try 2 install Elasticsearch-head

Three machines just need a head to install. 2.1 Adopt Nodejs installation

6.X, Elasticsearch-head cannot be placed in Elasticsearch plugins, modules directory cannot be used Elasticsearch-plugin install

Direct start Elasticsearch can 2.2 install Elasticsearch-head

1. Modify Elasticsearch/config/elasticsearch.yml
2. Add

Http.cors.enabled:true
http.cors.allow-origin: "*"

3. Download Elasticsearch-head or git clone to a random folder

Https://github.com/mobz/elasticsearch-head

I was directly downloaded to

[Es@biluos elasticsearch-head-master]$ pwd
/home/es/elasticsearch-head-master

of the Directory

4. Install Nodejs
http://blog.csdn.net/qq_21383435/article/details/79367366

5.cd/home/es/elasticsearch-head-master
6.NPM install-g GRUNT-CLI
Grunt is a handy build tool for packaging, testing, executing, and so on.

[Es@biluos elasticsearch-head-master]$ npm install-g grunt-cli npm WARN checkpermissions Missing Write access To/opt/mo Udles/node-v8.9.4-linux-x64/lib/node_modules NPM err! Path/opt/moudles/node-v8.9.4-linux-x64/lib/node_modules NPM err! Code eacces NPM err! ERRNO-13 NPM err! Syscall Access NPM err!  Error:EACCES:permission denied, access '/opt/moudles/node-v8.9.4-linux-x64/lib/node_modules ' NPM err!   {Error:EACCES:permission denied, access '/opt/moudles/node-v8.9.4-linux-x64/lib/node_modules ' NPM err!   Stack: ' Error:EACCES:permission denied, access \/opt/moudles/node-v8.9.4-linux-x64/lib/node_modules\ ', NPM err!   errno: -13, NPM err!   Code: ' Eacces ', NPM err!   Syscall: ' Access ', NPM err! 
Path: '/opt/moudles/node-v8.9.4-linux-x64/lib/node_modules '} npm err! NPM err!

Please try running this command again as Root/administrator. NPM err!     A Complete log of this run can is found IN:NPM err! /home/es/.npm/_logs/2018-02-25t02_49_37_372z-debug.log

A look will know is the permissions issue, because my nodejs is root installed, here I am an ES user

[Es@biluos elasticsearch-head-master]$ su root
Password: 
[root@biluos elasticsearch-head-master]#  NPM Install-g grunt-cli 
/opt/moudles/node-v8.9.4-linux-x64/bin/grunt->/opt/moudles/node-v8.9.4-linux-x64/lib /node_modules/grunt-cli/bin/grunt
+ grunt-cli@1.2.0
added packages in 21.663s

7.NPM Install

[Root@biluos elasticsearch-head-master]# npm install npm WARN deprecated http2@3.3.7:use The built-in module in node 9.0 

.0 or newer, instead NPM WARN deprecated coffee-script@1.10.0:coffeescript on NPM has moved to "Coffeescript" (no hyphen) > phantomjs-prebuilt@2.1.16 install/home/es/elasticsearch-head-master/node_modules/phantomjs-prebuilt > Node
    Install.js module.js:540 Throw err; ^ error:cannot Find module '/home/es/elasticsearch-head-master/node_modules/phantomjs-prebuilt/install.js ' at Functi On. Module._resolvefilename (module.js:538:15) at Function.module._load (module.js:468:25) at Function.Module.runMain (Module.js:684:10) at startup (bootstrap_node.js:187:16) at Bootstrap_node.js:608:3 npm WARN elasticsearch-head@0. 0.0 license should be a valid SPDX license expression npm WARN optional skipping optional dependency:fsevents@1.1.3 (node _modules/fsevents): npm WARN notsup skipping OPTIONAL dependency:unsupported for platform.1.3:wanted {"OS": "Darwin", "Arch": "Any"} (current: {"OS": "Linux", "Arch": "x64"}) NPM err! Code elifecycle NPM err! errno 1 NPM err! phantomjs-prebuilt@2.1.16 Install: ' node Install.js ' NPM err! 
Exit Status 1 npm err! NPM err!
Failed at the phantomjs-prebuilt@2.1.16 install script. NPM err! This isn't probably problem with NPM.

There is likely additional logging output above. NPM err!     A Complete log of this run can is found IN:NPM err! /root/.npm/_logs/2018-02-25t03_01_11_887z-debug.log

This is because my elasticsearch is an ES user, and the Elasticsearch-head-master file is the root user

[Root@biluos es]# ll Total
drwxr-xr-x 4 es   es   4096 Feb  9 14:55 elasticsearch

[root@biluos elasticsearch-head-master]# ll/home/es/elasticsearch-head-master/node_modules Total
1028
drwxr-xr-x  2 root 4096 Feb 11:01 abbrev
drwxr-xr-x  2 root root 4096 Feb-11:01 accepts drwxr-xr-x  3 root Root 4096 Feb 11:01 after
drwxr-xr-x  2 root 4096 Feb-11:01 Ansi-regex drwxr-xr-x
  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.