Elastic search installation settings under -(2) - linux

Keywords: ElasticSearch Java Attribute RPM

Setting up Elastic search

This section contains information on how to set up and run Elastic search, including:

  • download
  • install
  • start
  • To configure

Supported Platform

Formally supported operating systems and JVM matrices are available here: support matrices. Elastic search has been tested on the listed platforms, but it may also work on other platforms.

Java (JVM) Version Editing

Elastic search is built in Java and requires at least Java 8 to run. Only Oracle's Java and OpenJDK are supported. All Elastic search nodes and clients should use the same JVM version.

We recommend installing Java version 1.8.0_131 or higher in the Java 8 distribution series. We recommend using the supported LTS version of Java. Elastic search will refuse to start if a known Java version is used.

The Java version that Elastic search will use can be configured by setting the JAVA_HOME environment variable.

Install Elasticsearch Editor

Elastic search is provided in the following package format:

zip/tar.gz

The zip and tar.gz packages are suitable for installation on any system, and are the easiest choice for introducing Elastic search in most systems.

Use. zip or. tar.gzInstall Elastic search or On WindowsInstall Elasticsearch.zip

deb

The deb package is suitable for Debian, Ubuntu and other Debian-based systems. The Debian package can be downloaded from the Elastic search website or from our Debian repository.

Installing Elastic search with Debian package

rpm

The RPM package is suitable for installation on Red Hat, Centos, SLES, OpenSuSE and other RPM-based systems. RPM can be downloaded from the Elastic search website or from our RPM repository.

Installing Elastic search with RPM

msi

The MSI package is suitable for installing Windows 64-bit system with at least. NET 4.5 framework installed. It is the simplest choice for Elastic search entry on Windows. MSI can be downloaded from Elastic search.

Install Elastic search using Windows MSI installer

docker

The image can be used to run Elastic search as a Docker container. They can be downloaded from Elastic Docker Registry. Default Image Attachment pre-positioned X-Pack.

Installing Elastic search with Docker

Configuration Management Tool Editor We also provide the following configuration management tools to help large deployments:

Puppet

puppet-elasticsearch

Chef

cookbook-elasticsearch

Ansible

ansible-elasticsearch

Install Elastic search using. zip or. tar.gz

Elastic search is provided by. zip as a. tar.gz wrapper. These packages can be used to install Elastic search on any system and are the simplest package format to try out Elastic search.

The latest stable version of Elastic search can be found on the download Elastic search page. Other versions can be found on the "Past Versions" page.

Be careful
Elastic search requires Java 8 or higher. Use official Oracle distributions or open source distributions such as OpenJDK.

Download and install. zip package editing

The archive of.Zip Elastic search v6.2.0 can be downloaded and installed as follows:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.zip.sha512
shasum -a 512 -c elasticsearch-6.2.0.zip.sha512 
unzip elasticsearch-6.2.0.zip
cd elasticsearch-6.2.0/ 

Compare the SHA of the downloaded. zip archive with the checksum of the publication of the output and elastic search - {version}. zip: OK.

This directory is called $ES_HOME.

Download and install the. tar.gz package

The archive of.Tar.gz Elastic search v6.2.0 can be downloaded and installed as follows:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.tar.gz
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.0.tar.gz.sha512
shasum -a 512 -c elasticsearch-6.2.0.tar.gz.sha512 
tar -xzf elasticsearch-6.2.0.tar.gz
cd elasticsearch-6.2.0/ 

Compare downloaded. tar.gz archived SHA with the published checksum of the output elastic search - {version}. tar.gz: OK.

This directory is called $ES_HOME.

I download it and install it offline.

I am a root user:

tar -zxvf elasticsearch-6.2.0.tar.gz -C /opt/moudles/
[2018-02-08T14:31:43,598][ERROR][o.e.b.Bootstrap          ] Exception
java.lang.RuntimeException: can not run elasticsearch as root
    at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) [elasticsearch-6.2.0.jar:6.2.0]
[2018-02-08T14:31:43,610][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.0.jar:6.2.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
    at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:105) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.0.jar:6.2.0]
    ... 6 more

Solution 1: (unsuccessful)

1. Start elastic search if there is an exception can not run elastic search as root
Solution: Create ES account, modify user group of folder file

Delete the es just now

# rm -rf /opt/moudles/elasticsearch-6.2.0
# groupadd ES
# useradd ES -g ES
# tar -zxvf elasticsearch-6.2.0.tar.gz -C /opt/moudles/
# chgrp -R ES elasticsearch-6.2.0/
# chown -R ES elasticsearch-6.2.0/
# bin/elasticsearch
//Still wrong

Solution 2: (unsuccessful)

  1. Download the ES installation package elastic search-5.6.3.zip, create the ES folder in the usr directory, upload the installation package to it, decompress unzip elastic search-5.6.3.zip CD and enter the elastic search-5.6.3 file.

    1. Create ES users and groups (create elsearch user groups and elsearch users), because there will be errors when using root users to execute ES programs; therefore, we need to create a separate user to execute ES files; the commands are as follows:

      • Command 1: group add elsearch
      • Command 2: useradd elsearch-g elsearch
      • Command 3: tar-zxvf elastic search-6.2.0.tar.gz-C/opt/moudles/
      • Command 4: chown-R elsearch: elsearch elastic search-5.6.3
        This command is to change the permissions of the user groups that belong to this folder
  2. Create ES data files and log files directly in the root user root directory

      Command 1: mkdir/opt/moudles/elastic search-6.2.0_data
      Command 2: chown-R elsearch: elsearch/opt/moudles/elastic search-6.2.0_data/
      Command 3: su - elsearch 
      Command 4: mkdir-p/opt/moudles/elastic search-6.2.0_data/data
      Command 5: mkdir-p/opt/moudles/elastic search-6.2.0_data/logs
  1. Modify the ES configuration file, use the cd command to enter the config file, and execute VI elastic search. YML command. As shown in the figure, I did not configure the cluster, but simply configure it. Detailed instructions can be referred to the official network.
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
cluster.name: myapplication
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
node.name: my_lcc_node_one
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
path.data: /opt/moudles/elasticsearch-6.2.0_data/es/data/

# Path to log files:
#
#path.logs: /path/to/logs
#
path.logs: /opt/moudles/elasticsearch-6.2.0_data/es/data/


# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

#
 Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
network.host: 192.168.10.173
#
# Set a custom port for HTTP:
#
#http.port: 9200
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
  1. Execute the ES file, go into the bin directory and execute the. / elastic search command. Execute. / elasticesrarch -d is running in the background. If there is no problem, it can be generated safely. Then execute curl'http://your own IP address: 9200/'command, and the following results will appear.
# curl -X GET http://localhost:9200

{
  "name" : "dRoj17S",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "kN_fnGlHTkSY4wjpRCqNNA",
  "version" : {
    "number" : "6.2.0",
    "build_hash" : "37cdac1",
    "build_date" : "2018-02-01T17:31:12.527918Z",
    "build_snapshot" : false,
    "lucene_version" : "7.2.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

But my mistake

Solution 3: (Success)

root# useradd es
root# passwd es
root# mkdir /home/es
root#  chown es:es /home/es
root# cd /home/es/
root# mkdir elasticsearch
root# tar -zxvf /opt/software/elasticsearch-6.2.0.tar.gz -C /home/es/elasticsearch/
root# chown -R es:es /home/es/elasticsearch/
root# su es
es# cd /home/es/elasticsearch/elasticsearch-6.2.0/
es# bin/elasticsearch

Run as follows

[2018-02-08T18:07:35,077][WARN ][o.e.b.JNANatives         ] unable to install syscall filter: 
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
    at org.elasticsearch.bootstrap.SystemCallFilter.linuxImpl(SystemCallFilter.java:328) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.SystemCallFilter.init(SystemCallFilter.java:616) ~[elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.JNANatives.tryInstallSystemCallFilter(JNANatives.java:258) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Natives.tryInstallSystemCallFilter(Natives.java:113) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:110) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:172) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-6.2.0.jar:6.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) [elasticsearch-6.2.0.jar:6.2.0]
[2018-02-08T18:07:35,493][INFO ][o.e.n.Node               ] [] initializing ...
[2018-02-08T18:07:35,724][INFO ][o.e.e.NodeEnvironment    ] [dRoj17S] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [7.4gb], net total_space [25.4gb], types [rootfs]
[2018-02-08T18:07:35,724][INFO ][o.e.e.NodeEnvironment    ] [dRoj17S] heap size [1007.3mb], compressed ordinary object pointers [true]
[2018-02-08T18:07:35,728][INFO ][o.e.n.Node               ] node name [dRoj17S] derived from node ID [dRoj17SdQ12H6bAgF_jfLw]; set [node.name] to override
[2018-02-08T18:07:35,729][INFO ][o.e.n.Node               ] version[6.2.0], pid[21222], build[37cdac1/2018-02-01T17:31:12.527918Z], OS[Linux/2.6.32-504.el6.x86_64/amd64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_121/25.121-b13]
[2018-02-08T18:07:35,729][INFO ][o.e.n.Node               ] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.AuexHKPB, -XX:+HeapDumpOnOutOfMemoryError, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/home/es/elasticsearch/elasticsearch-6.2.0, -Des.path.conf=/home/es/elasticsearch/elasticsearch-6.2.0/config]
[2018-02-08T18:07:37,299][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [aggs-matrix-stats]
[2018-02-08T18:07:37,304][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [analysis-common]
[2018-02-08T18:07:37,304][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [ingest-common]
[2018-02-08T18:07:37,305][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [lang-expression]
[2018-02-08T18:07:37,305][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [lang-mustache]
[2018-02-08T18:07:37,306][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [lang-painless]
[2018-02-08T18:07:37,306][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [mapper-extras]
[2018-02-08T18:07:37,306][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [parent-join]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [percolator]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [rank-eval]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [reindex]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [repository-url]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [transport-netty4]
[2018-02-08T18:07:37,307][INFO ][o.e.p.PluginsService     ] [dRoj17S] loaded module [tribe]
[2018-02-08T18:07:37,308][INFO ][o.e.p.PluginsService     ] [dRoj17S] no plugins loaded
[2018-02-08T18:07:43,383][INFO ][o.e.d.DiscoveryModule    ] [dRoj17S] using discovery type [zen]
[2018-02-08T18:07:44,446][INFO ][o.e.n.Node               ] initialized
[2018-02-08T18:07:44,446][INFO ][o.e.n.Node               ] [dRoj17S] starting ...
[2018-02-08T18:07:44,739][INFO ][o.e.t.TransportService   ] [dRoj17S] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[2018-02-08T18:07:44,757][WARN ][o.e.b.BootstrapChecks    ] [dRoj17S] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2018-02-08T18:07:44,757][WARN ][o.e.b.BootstrapChecks    ] [dRoj17S] max number of threads [1024] for user [es] is too low, increase to at least [4096]
[2018-02-08T18:07:44,757][WARN ][o.e.b.BootstrapChecks    ] [dRoj17S] max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2018-02-08T18:07:44,758][WARN ][o.e.b.BootstrapChecks    ] [dRoj17S] system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[2018-02-08T18:07:47,892][INFO ][o.e.c.s.MasterService    ] [dRoj17S] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {dRoj17S}{dRoj17SdQ12H6bAgF_jfLw}{UBEX5MGRQ5iWiKb8lYm1IA}{127.0.0.1}{127.0.0.1:9300}
[2018-02-08T18:07:47,904][INFO ][o.e.c.s.ClusterApplierService] [dRoj17S] new_master {dRoj17S}{dRoj17SdQ12H6bAgF_jfLw}{UBEX5MGRQ5iWiKb8lYm1IA}{127.0.0.1}{127.0.0.1:9300}, reason: apply cluster state (from master [master {dRoj17S}{dRoj17SdQ12H6bAgF_jfLw}{UBEX5MGRQ5iWiKb8lYm1IA}{127.0.0.1}{127.0.0.1:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2018-02-08T18:07:47,957][INFO ][o.e.h.n.Netty4HttpServerTransport] [dRoj17S] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[2018-02-08T18:07:47,957][INFO ][o.e.n.Node               ] [dRoj17S] started
[2018-02-08T18:07:47,966][INFO ][o.e.g.GatewayService     ] [dRoj17S] recovered [0] indices into cluster_state

implement

curl -X GET http://localhost:9200

Result:

{
  "name" : "dRoj17S",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "kN_fnGlHTkSY4wjpRCqNNA",
  "version" : {
    "number" : "6.2.0",
    "build_hash" : "37cdac1",
    "build_date" : "2018-02-01T17:31:12.527918Z",
    "build_snapshot" : false,
    "lucene_version" : "7.2.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Run Elastic search from command line editing

Elastic search can be started from the command line, as follows:

./bin/elasticsearch

By default, Elastic search runs in the foreground, prints its log to stdout, and can stop Ctrl-C by pressing.

Be careful
All scripts packaged with Elastic search require a Bash version that supports arrays and assumes that Bash is available / bin/bash. Therefore, Bash should be available on this path directly or through symbolic links.

Check whether Elastic search is running the edit

You can test that your Elastic search node runs 9200 localhost on a port that sends an HTTP request:

GET /

This should give you a response like this:

{
  "name" : "Cp8oag6",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
  "version" : {
    "number" : "6.2.0",
    "build_hash" : "f27399d",
    "build_date" : "2016-03-30T09:51:41.449Z",
    "build_snapshot" : false,
    "lucene_version" : "7.2.1",
    "minimum_wire_compatibility_version" : "1.2.3",
    "minimum_index_compatibility_version" : "1.2.3"
  },
  "tagline" : "You Know, for Search"
}

stdout can disable log printing using the - q or - quiet option on the command line.

Running as a daemon

To run Elastic search as a daemon, specify - d on the command line and log the process ID to a file using the following - p option:

./bin/elasticsearch -d -p pid

Log messages can be found in the $ES_HOME/logs/directory.

To close Elastic search, kill the process ID recorded in the pid file:

kill `cat pid`

Be careful
The startup scripts provided in RPM and Debian packages are responsible for starting and stopping the Elastic search process for you.

Configure Elastic search on the command line

Elasticsearch $ES_HOME/config/elasticsearch.yml loads its configuration from the file by default. Configuration Elastic search explains the format of this configuration file.

Any settings specified in the configuration file can also be specified on the command line, using the - E grammar as follows:

./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1

TIP
Normally, any cluster-wide settings (such as cluster.name) should be added to the elasticsearch.yml configuration file, and any node-specific settings (such as node.name can be specified on the command line).

Directory layout. zip and. tar.gz files

The. zip and. tar.gz packages are completely independent. All files and directories, by default, are included in the directory created when $ES_HOME_unzips the files.

This is very convenient, because you don't have to create any directories to start using Elastic search, unloading Elastic search is as simple as deleting the $ES_HOME directory. However, it is recommended to change the default locations of config directory, data directory and log directory in order not to delete important data later.

Type Description Default Location Setting

home

Elasticsearch home directory or $ES_HOME

Directory created by unpacking the archive

bin

Binary scripts including elasticsearch to start a node and elasticsearch-plugin to install plugins

$ES_HOME/bin</code></p></td><td align="left" valign="top"><p></p></td></tr><tr><td align="left" valign="top"><p><span class="strong strong"><strong>conf</strong></span></p></td><td align="left" valign="top"><p>Configuration files including <code class="literal">elasticsearch.yml</code></p></td><td align="left" valign="top"><p><code class="literal">$ES_HOME/config

ES_PATH_CONF

data

The location of the data files of each index / shard allocated on the node. Can hold multiple locations.

$ES_HOME/data</code></p></td><td align="left" valign="top"><p><code class="literal">path.data</code></p></td></tr><tr><td align="left" valign="top"><p><span class="strong strong"><strong>logs</strong></span></p></td><td align="left" valign="top"><p>Log files location.</p></td><td align="left" valign="top"><p><code class="literal">$ES_HOME/logs

path.logs

plugins

Plugin files location. Each plugin will be contained in a subdirectory.

$ES_HOME/plugins</code></p></td><td align="left" valign="top"><p><code class="literal"></code></p></td></tr><tr><td align="left" valign="top"><p><span class="strong strong"><strong>repo</strong></span></p></td><td align="left" valign="top"><p>Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here.</p></td><td align="left" valign="top"><p>Not configured</p></td><td align="left" valign="top"><p><code class="literal">path.repo</code></p></td></tr><tr><td align="left" valign="top"><p><span class="strong strong"><strong>script</strong></span></p></td><td align="left" valign="top"><p>Location of script files.</p></td><td align="left" valign="top"><p><code class="literal">$ES_HOME/scripts

path.scripts

Subsequent steps

You have now set up a test Elastic search environment. Before you begin to develop or use Elastic search for production, you need some additional settings:

  • Learn how to configure Elastic search.
  • Configure important Elastic search settings.
  • Configure important system settings.

Posted by VisionsOfCody on Sun, 16 Dec 2018 20:33:04 -0800