[elasticsearch + kibana] installation configuration

The first article of the new year, due to work needs, I configured elasticsearch + kibana on my own Windows computer, so I recorded while doing it

Elasticsearch

Download: Elasticsearch

After downloading the compressed package, unzip it, enter it elasticsearch-8.6.1-windows-x86_64\elasticsearch-8.6.1\bin, and start it elasticsearch.bat.

error
Whoops, something went wrong. It seems that my JDK is missing files, go to see the log to determine further problems.

[2023-02-04T14:46:51,609][ERROR][o.e.b.Elasticsearch      ] [R9000X-BLUEBONN] fatal exception while booting Elasticsearch
java.nio.file.NoSuchFileException: C:\Program Files\Java\jdk1.8.0_281\lib\dt.jar
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:85) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:53) ~[?:?]
	at sun.nio.fs.WindowsFileAttributeViews$Basic.readAttributes(WindowsFileAttributeViews.java:38) ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.readAttributes(WindowsFileSystemProvider.java:199) ~[?:?]
	at java.nio.file.Files.readAttributes(Files.java:1849) ~[?:?]
	at java.util.zip.ZipFile$Source.get(ZipFile.java:1279) ~[?:?]
	at java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:710) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:243) ~[?:?]
	at java.util.zip.ZipFile.<init>(ZipFile.java:172) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:345) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:316) ~[?:?]
	at java.util.jar.JarFile.<init>(JarFile.java:255) ~[?:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:221) ~[elasticsearch-core-8.6.1.jar:?]
	at org.elasticsearch.jdk.JarHell.checkJarHell(JarHell.java:84) ~[elasticsearch-core-8.6.1.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.initPhase2(Elasticsearch.java:180) ~[elasticsearch-8.6.1.jar:?]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:66) ~[elasticsearch-8.6.1.jar:?]

According to this site: Support Matrix

8.0 and later versions require at least JDK17. My computer is 1.8. Of course, I don't think it is necessary to go to 17, I think it is enough to upgrade to 11. So let's change the version of Elasticsearch and choose the last 7.17.9 that supports JDK1.8.

The same steps, download, decompress, start.
java not found
Currently I don't know the source of this bug, my Java JDK is intact. Presumably the Java version is too low?

Modify this file:elasticsearch-7.17.9-windows-x86_64\elasticsearch-7.17.9\bin\elasticsearch-env.bat

Change to the following code:

@REM if defined ES_JAVA_HOME (
@REM   set JAVA="%ES_JAVA_HOME%\bin\java.exe"
@REM   set JAVA_TYPE=ES_JAVA_HOME
@REM ) else if defined JAVA_HOME (
@REM   rem fallback to JAVA_HOME
@REM   echo "warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME" >&2
@REM   set JAVA="%JAVA_HOME%\bin\java.exe"
@REM   set "ES_JAVA_HOME=%JAVA_HOME%"
@REM   set JAVA_TYPE=JAVA_HOME
@REM ) else (
  rem use the bundled JDK (default)
  set JAVA="%ES_HOME%\jdk\bin\java.exe"
  set "ES_JAVA_HOME=%ES_HOME%\jdk"
  set JAVA_TYPE=bundled JDK
@REM )

If you are smart, you should be able to understand it, and force the JDK that comes with the compressed package to replace the JDK of the system.

In this way, it runs and opens this web page: http://localhost:9200/. Seeing output similar to the following proves that our Elasticsearch is running.

{
    
    
  "name" : "R9000X-BLUEBONN",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "6Ik54DgQRkWmd2epBpAFUQ",
  "version" : {
    
    
    "number" : "7.17.9",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "ef48222227ee6b9e70e502f0f0daa52435ee634d",
    "build_date" : "2023-01-31T05:34:43.305517834Z",
    "build_snapshot" : false,
    "lucene_version" : "8.11.1",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Next install kibana.

kibana

Strictly speaking, the versions of kibana and Elasticsearch must correspond. However, it is also compatible within a certain range. We don't think about compatibility issues, just download the corresponding version directly.

Oh, by the way, to terminate the Elasticsearch operation, just press Ctrl+Cit.

unzip. It is recommended to execute the bat script in the terminal (I use PowerShell), otherwise, if you double-click a problem, you will exit directly, and you don’t know where the problem is. in kibana-7.17.9-windows-x86_64\kibana-7.17.9-windows-x86_64\binexecution.\kibana.bat

This time it went very smoothly. When you visit the browser http://localhost:5601/, you can see the kibana interface.
kibana

check connection

If you never changed the configuration file, the connection between the two should be very fast.

Start Elasticsearch and kibana respectively, and enter the following command in kibana's devtools to view the health status of Elasticsearch:

GET /_cat/health?v

The output is as follows:
output
In the next article, I will study how to use this thing.

Guess you like

Origin blog.csdn.net/qq_37387199/article/details/128881809