[Mounting Elasticsearch + Kibana single node, multiple instances ES]

Foreword

  Objective: Elasticsearch deploy multiple instances on a single server and can be used Kibana. The following process focus process, only give details of critical processes.

  ElasticSearch 6.8.4 + Kibana 6.8.4, the version best match both otherwise there will be an alarm, error and the like.

  Download link: https://www.elastic.co/cn/downloads/past-releases#kibana  . ES, Kibana and ELK package can be downloaded from this link.

1, deployment

  1.1 JDK version

    Ensure JDK version 1.8 and above, Linux in the JDK configuration methods can Baidu.

    Mainly for the following system environment JDK version 1.7, and to the operation of the ES.

    The user may use the root / etc / profile in JDK 1.8 configure the environment variables, such as: JAVA8_HOME, and add the following code to the bin / elasticsearch script.

1 export JAVA_HOME=$JAVA8_HOME      
2 export PATH=$JAVA_HOME/bin:$PATH
3 
4 if [ -x "$JAVA_HOME/bin/java" ]; then
5         JAVA="$JAVA8_HOME/bin/java"
6 else
7         JAVA=`which java`
8 fi

  1.2 new users

    Because elasticsearch root user is not allowed to run, you need to create a new user, such as: es, the new process can refer to Baidu. The only caveat: the need to create a new user needs to have rights to the ES, Kibana directory where the most direct method is to change the owner of the relevant directory of new users, use the command: chown -R es: elasticsearch / path

  1.3 Elasticsearch configuration changes

    The downloaded files unzip elasticsearch reach a copy to the same directory (No location). Modify config / elastisearch.yml two file folders, each additional basic information is as follows:

1 # ip is assumed that the machine 192. 168.0 . 100 , two mounting ES Example
 2  a first example of elasticsearch.yml # configured as follows:
 . 3 cluster.name: ES- Cluster
 . 4 node.name: node- 1 
. 5 path. Data: / Data / elasticsearch / Data
 . 6 path.logs: / Data / elasticsearch / logs
 . 7 network.host: 0.0 . 0.0 
. 8 http.port,: 9200 
. 9 transport.tcp.port: 9300 
10 . discovery.zen of ping .unicast. hosts: [ " 192.168.0.100:9300 " , "192.168.0.100:9301"]
11 discovery.zen.minimum_master_nodes: 2
12 node.max_local_storage_nodes: 2
13 
14 #第二个实例配置如下:
15 cluster.name: es-cluster
16 node.name: node-2
17 path.data: /data/elasticsearch/data
18 path.logs: /data/elasticsearch/logs
19 network.host: 0.0.0.0
20 http.port: 9201
21 transport.tcp.port: 9301
22 discovery.zen.ping.unicast.hosts: ["192.168.0.100:9300","192.168.0.100:9301"]
23 discovery.zen.minimum_master_nodes: 2
24 node.max_local_storage_nodes: 2

  To summarize: When you install multiple instances of the same elasticsearch a node, simply unzip the file multiple copies, and modify elasticsearch.yml, major changes in the configuration file in a different node name and port. In fact, you can also do not need to copy the file can also be specified with the command at startup.

  Also, note that the default JVM is too small, and the number of file systems and so need to transfer large demand according to.

  1.4 Kibana AnSo

    Extract the files into the same directory and elasticsearch (not mandatory), modify kibana.yml file, add the following:

1 server.host: "192.168.0.100"
2 elasticsearch.url: "http:// 192.168.0.100:9200"

2, start

 2.1 startup command

  Elasticsearch start is: ./ bin / elasticsearch

  Kibana 启动: ./bin/kibana

  About the root user can not start, it is recommended to use the following command at the root:

1  # command path needs to be done according to the actual changes corresponding
 2  
. 3  # Start ES
 . 4  SU - ES -C "/ opt / elasticsearch / bin / elasticsearch - D"
 . 5  # start Kibana
 . 6  SU - ES -C "the nohup / opt / kibana / bin / kibana & >> / opt / kibana / logs / kibana.log & "

  Elasticsearch and Kibana should start with the same non-root user to avoid unavailable.

 2.2 error

    Maybe will get an error during the boot process, the error message may be based on analysis and timely fashion.

Ref:

[1] https://www.lizenghai.com/archives/39863.html  

Guess you like

Origin www.cnblogs.com/love-yh/p/12334093.html