Installation of Elastic Search 5.X and Head Plug-ins under Mac

Installation of Elastic search 5.x: After the ELK upgrade to 5.0, some features have changed, such as full use of JDK8, plug-in changes and environment checking.

Installation of Elastic search

  • Download tar packages on the official website. Download address
  • Unzip after downloading
  • Start in bin directory

    Note: If the root user starts, there will be an exception, because es goes out for security considerations. It is forbidden to start with root user. The solution is to build a new user. See this blog for details: CENTOS Installation Elastic Search.

  • Modify the configuration file by entering the conf directory of es

    cluster.name: es-cluster
    node.name: node-1
    network.host: 0.0.0.0
    http.port: 9200
  • Start ES with the following command

    • ./elasticsearch
    • / elastic search-d (this is background boot)
  • See the following log information:

    [2017-03-25T14:30:45,189][INFO ][o.e.n.Node               ] [node-1] initializing ...
    [2017-03-25T14:30:45,272][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [278.8gb], net total_space [464.6gb], spins? [unknown], types [hfs]
    [2017-03-25T14:30:45,272][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1.9gb], compressed ordinary object pointers [true]
    [2017-03-25T14:30:45,273][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [n1HFjO-TQlSs4Ncw0HD34A]
    [2017-03-25T14:30:45,276][INFO ][o.e.n.Node               ] [node-1] version[5.2.2], pid[3763], build[f9d9b74/2017-02-24T17:26:45.835Z], OS[Mac OS X/10.12.3/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_111/25.111-b14]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [aggs-matrix-stats]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-common]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-expression]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-groovy]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-mustache]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-painless]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [percolator]
    [2017-03-25T14:30:45,971][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [reindex]
    [2017-03-25T14:30:45,972][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty3]
    [2017-03-25T14:30:45,972][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty4]
    [2017-03-25T14:30:45,972][INFO ][o.e.p.PluginsService     ] [node-1] no plugins loaded
    [2017-03-25T14:30:47,936][INFO ][o.e.n.Node               ] [node-1] initialized
    [2017-03-25T14:30:47,936][INFO ][o.e.n.Node               ] [node-1] starting ...
    [2017-03-25T14:30:48,119][INFO ][o.e.t.TransportService   ] [node-1] publish_address {192.168.31.110:9300}, bound_addresses {[::]:9300}
    [2017-03-25T14:30:48,123][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
    [2017-03-25T14:30:51,226][INFO ][o.e.c.s.ClusterService   ] [node-1] new_master {node-1}{n1HFjO-TQlSs4Ncw0HD34A}{gn6UwArmTG-DEwYmzh1U9g}{192.168.31.110}{192.168.31.110:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
    [2017-03-25T14:30:51,240][INFO ][o.e.h.HttpServer         ] [node-1] publish_address {192.168.31.110:9200}, bound_addresses {[::]:9200}
    [2017-03-25T14:30:51,240][INFO ][o.e.n.Node               ] [node-1] started
    [2017-03-25T14:30:51,246][INFO ][o.e.g.GatewayService     ] [node-1] recovered [0] indices into cluster_state
  • Through IP access, for example, my IP is 192.168.31.110, then the access address is 192.168.31.110:9200, you can see the following information
    {
    name: "n1HFjO-",
    cluster_name: "elasticsearch",
    cluster_uuid: "njH6T6eMS-mDf3tloN5THg",
    version: {
    number: "5.2.2",
    build_hash: "f9d9b74",
    build_date: "2017-02-24T17:26:45.835Z",
    build_snapshot: false,
    lucene_version: "6.4.1"
    },
    tagline: "You Know, for Search"
    }

Installation of Head Plug-in

Head plug-in is our commonly used plug-in, but after ELK 5.0 according to the previous plug-in installation method can not be used, after looking at the head official website, it is necessary to start a separate service.

  • Head-GitHub official website
  • Simple Course on Official Website
    git clone git://github.com/mobz/elasticsearch-head.git
    cd elasticsearch-head
    npm install
    grunt server

Depending on the Node environment, we need to do some work:

Head plug-in installation

  • Download and install the corresponding Node installation package
  • Installing Git Environment
  • Download Head Project
  • cd elasticsearch-head
  • Modify the server listening address, address directory: head/Gruntfile.js
    connect: {
      server: {
          options: {
              port: 9100,
              hostname: '*',
              base: '.',
              keepalive: true
          }
      }
    }
  • Modify the connection address, directory: head/_site/app.js

Paste_Image.png
  • npm install

    Note: If the npm source is particularly slow, you can refer to this document: npm install non-response solution

  • Grunt is a very convenient build tool for packaging, compression, testing, execution and so on. The head plug-in in 5.0 is launched through grunt. So you need to install grunt: npm install grunt-cli
  • grunt server: Make sure the es service is started

Paste_Image.png
  • Open browser input: IP:9100

Paste_Image.png
  • Normally, you can see that ES has been connected, but many people in the ES community have been configurated, but you can not see the connection information. At this time, you need to add the following configuration in the elastic search. YM of es:
    http.cors.enabled: true
    http.cors.allow-origin: "*"

Keywords: npm ElasticSearch git github

Added by mojito on Tue, 16 Jul 2019 03:24:55 +0300