Installing Elasticsearch

If, like us, you downloaded the TAR file, start by extracting the content on your filesystem (where x, y, and z are the current version numbers):

tar -xvf elasticsearch-x.y.z.tar.gz

Otherwise, you could refer to the installation documentation at https://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html if you prefer to use another type of installation.

Once extracted, go into the extracted folder with your favorite Terminal tool and run the following command to start Elasticsearch:

cd elasticsearch-x.y.z/bin
./elasticsearch

Elasticsearch will start an empty cluster with the default configuration located in the config folder of the installation directory, as the following example listing of the directory shows:

%> pwd
/Users/yourusername/elasticsearch-6.5.1
%> ls -lF
total 848
-rw-r--r--@ 1 yourusername staff 13675 Nov 15 21:20 LICENSE.txt
-rw-r--r--@ 1 yourusername staff 403816 Nov 15 21:26 NOTICE.txt
-rw-r--r--@ 1 yourusername staff 8519 Nov 15 21:19 README.textile
drwxr-xr-x@ 45 yourusername staff 1440 Nov 15 21:26 bin/
drwxr-xr-x@ 9 yourusername staff 288 Nov 15 21:26 config/
drwxr-xr-x@ 42 yourusername staff 1344 Nov 15 21:26 lib/
drwxr-xr-x@ 2 yourusername staff 64 Nov 15 21:26 logs/
drwxr-xr-x@ 28 yourusername staff 896 Nov 15 21:26 modules/
drwxr-xr-x@ 2 yourusername staff 64 Nov 15 21:26 plugins/

For simplicity, we won't change anything in the configuration of Elasticsearch, and we will only use a single node cluster installation.

When Elasticsearch has started, you should see something like the following log in your console:

%> bin/elasticsearch
[2018-11-25T09:12:51,181][INFO ][o.e.e.NodeEnvironment ] [1RGCSTv] using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [47.1gb], net total_space [233.4gb], types [apfs]
[2018-11-25T09:12:51,183][INFO ][o.e.e.NodeEnvironment ] [1RGCSTv] heap size [990.7mb], compressed ordinary object pointers [true]
[2018-11-25T09:12:51,187][INFO ][o.e.n.Node ] [1RGCSTv] node name derived from node ID [1RGCSTvXQZODVPq8gp2LUw]; set [node.name] to override
[2018-11-25T09:12:51,187][INFO ][o.e.n.Node ] [1RGCSTv] version[6.5.1], pid[22781], build[default/tar/8c58350/2018-11-16T02:22:42.182257Z], OS[Mac OS X/10.14.1/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_171/25.171-b11]
[2018-11-25T09:12:51,188][INFO ][o.e.n.Node ] [1RGCSTv] 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=/var/folders/df/g2gdg5r509d49mv0t7mnft8h0000gn/T/elasticsearch.yNPajKl3, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -XX:+PrintGCDetails, -XX:+PrintGCDateStamps, -XX:+PrintTenuringDistribution, -XX:+PrintGCApplicationStoppedTime, -Xloggc:logs/gc.log, -XX:+UseGCLogFileRotation, -XX:NumberOfGCLogFiles=32, -XX:GCLogFileSize=64m, -Des.path.home=/Users/yourusername/elastic/v6.5/elasticsearch-6.5.1, -Des.path.conf=/Users/yourusername/elastic/v6.5/elasticsearch-6.5.1/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
...
[2018-11-25T09:13:04,168][INFO ][o.e.l.LicenseService ] [1RGCSTv] license [f33e8be3-7742-4390-80dd-35275611de75] mode [basic] - valid

We can see that the node has properly started, bound to the 9200 port, and that a license of the basic type has been applied and is valid. From there, the easiest way to check whether Elasticsearch is properly running is to check through the API. On the Linux/macOS X command line, you could invoke the following:

%> curl -X GET "localhost:9200/"
{
"name" : "1RGCSTv",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "xV8D0pBdSUS-lLU2OLYmlg",
"version" : {
"number" : "6.5.1",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "8c58350",
"build_date" : "2018-11-16T02:22:42.182257Z",
"build_snapshot" : false,
"lucene_version" : "7.5.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

Alternatively, you could load the URL directly in your favorite browser or could use PowerShell if you are on Windows. Regardless of the platform, Elasticsearch gives the same basic information—the name of the node that is servicing the request (here, called 1RGCSTv), and the version of Elasticsearch that is running (here, 6.5.1).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.181.66