17th December 2024

How to Install Elasticsearch in Windows?

We explained what Elasticsearch is in our previous article. You can check it by clicking here. Now we will install Elasticsearch on Windows 10.

Elasticsearch Installation on Windows 10

We download the file with the .zip extension from the Elastichsearch site. You can download Elastichsearch from the link below.

https://www.elastic.co/downloads/elasticsearch

download Elastichsearch
Download Elastichsearch

 

We extract the downloaded “elasticsearch-7.12.1-windows-x86_64.zip” file from the zip.

elasticsearch-7.12.1-windows-x86_64.zip
elasticsearch-7.12.1-windows-x86_64.zip

 

Then we open the Windows PowerShell program.

Windows PowerShell
Windows PowerShell

 

We go to the location “elasticsearch-7.12.1-windows-x86_64 \elasticsearch-7.12.1\bin“. Run the “elasticsearch” file here.

PS C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\bin> .\elasticsearch                Could not rename log file 'logs/gc.log' to 'logs/gc.log.03' (Permission denied).
[2021-05-19T23:57:54,305][INFO ][o.e.n.Node               ] [DESKTOP-4OEUMOR] version[7.12.1], pid[5384], build[default/zip/3186837139b9c6b6d23c3200870651f10d3343b7/2021-04-20T20:56:39.040728659Z], OS[Windows 10/10.0/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/16/16+36]
[2021-05-19T23:57:54,338][INFO ][o.e.n.Node               ] [DESKTOP-4OEUMOR] JVM home [C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\jdk], using bundled JDK [true]
[2021-05-19T23:57:54,409][INFO ][o.e.n.Node               ] [DESKTOP-4OEUMOR] JVM arguments [-Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -XX:+ShowCodeDetailsInExceptionMessages, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=ALL-UNNAMED, -XX:+UseG1GC, -Djava.io.tmpdir=C:\Users\omer\AppData\Local\Temp\elasticsearch, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Xms2047m, -Xmx2047m, -XX:MaxDirectMemorySize=1073741824, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Delasticsearch, -Des.path.home=C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1, -Des.path.conf=C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\config, -Des.distribution.flavor=default, -Des.distribution.type=zip, -Des.bundled_jdk=true]
[2021-05-19T23:58:05,002][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [aggs-matrix-stats]
[2021-05-19T23:58:05,006][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [analysis-common]
[2021-05-19T23:58:05,008][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [constant-keyword]
[2021-05-19T23:58:05,011][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [flattened]
[2021-05-19T23:58:05,013][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [frozen-indices]
[2021-05-19T23:58:05,018][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [ingest-common]
[2021-05-19T23:58:05,019][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [ingest-geoip]
[2021-05-19T23:58:05,023][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [ingest-user-agent]
[2021-05-19T23:58:05,024][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [kibana]
[2021-05-19T23:58:05,026][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [lang-expression]
[2021-05-19T23:58:05,027][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [lang-mustache]
[2021-05-19T23:58:05,029][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [lang-painless]
[2021-05-19T23:58:05,029][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [mapper-extras]
[2021-05-19T23:58:05,030][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [mapper-version]
[2021-05-19T23:58:05,031][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [parent-join]
[2021-05-19T23:58:05,031][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [percolator]
[2021-05-19T23:58:05,032][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [rank-eval]
[2021-05-19T23:58:05,033][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [reindex]
[2021-05-19T23:58:05,037][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [repositories-metering-api]
[2021-05-19T23:58:05,038][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [repository-encrypted]
[2021-05-19T23:58:05,039][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [repository-url]
[2021-05-19T23:58:05,039][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [search-business-rules]
[2021-05-19T23:58:05,041][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [searchable-snapshots]
[2021-05-19T23:58:05,042][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [snapshot-repo-test-kit]
[2021-05-19T23:58:05,042][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [spatial]
[2021-05-19T23:58:05,043][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [transform]
[2021-05-19T23:58:05,047][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [transport-netty4]
[2021-05-19T23:58:05,048][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [unsigned-long]
[2021-05-19T23:58:05,049][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [vectors]
[2021-05-19T23:58:05,055][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [wildcard]
[2021-05-19T23:58:05,055][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-aggregate-metric]
[2021-05-19T23:58:05,058][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-analytics]
[2021-05-19T23:58:05,059][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-async]
[2021-05-19T23:58:05,061][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-async-search]
[2021-05-19T23:58:05,062][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-autoscaling]
[2021-05-19T23:58:05,063][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-ccr]
[2021-05-19T23:58:05,064][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-core]
[2021-05-19T23:58:05,065][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-data-streams]
[2021-05-19T23:58:05,065][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-deprecation]
[2021-05-19T23:58:05,066][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-enrich]
[2021-05-19T23:58:05,071][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-eql]
[2021-05-19T23:58:05,072][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-fleet]
[2021-05-19T23:58:05,073][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-graph]
[2021-05-19T23:58:05,074][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-identity-provider]
[2021-05-19T23:58:05,075][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-ilm]
[2021-05-19T23:58:05,076][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-ingest]
[2021-05-19T23:58:05,076][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-logstash]
[2021-05-19T23:58:05,077][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-ml]
[2021-05-19T23:58:05,080][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-monitoring]
[2021-05-19T23:58:05,081][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-ql]
[2021-05-19T23:58:05,081][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-rollup]
[2021-05-19T23:58:05,082][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-runtime-fields]
[2021-05-19T23:58:05,082][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-security]
[2021-05-19T23:58:05,083][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-sql]
[2021-05-19T23:58:05,090][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-stack]
[2021-05-19T23:58:05,091][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-text-structure]
[2021-05-19T23:58:05,094][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-voting-only-node]
[2021-05-19T23:58:05,095][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] loaded module [x-pack-watcher]
[2021-05-19T23:58:05,098][INFO ][o.e.p.PluginsService     ] [DESKTOP-4OEUMOR] no plugins loaded
[2021-05-19T23:58:05,693][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [DESKTOP-4OEUMOR] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.12.1.jar:7.12.1]
        at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.12.1.jar:7.12.1]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:292) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.node.Node.<init>(Node.java:352) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.node.Node.<init>(Node.java:278) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:217) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:217) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:397) ~[elasticsearch-7.12.1.jar:7.12.1]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.12.1.jar:7.12.1]
        ... 6 more
uncaught exception in thread [main]
java.lang.IllegalStateException: failed to obtain node locks, tried [[C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:292)
        at org.elasticsearch.node.Node.<init>(Node.java:352)
        at org.elasticsearch.node.Node.<init>(Node.java:278)
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:217)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:217)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:397)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
        at org.elasticsearch.cli.Command.main(Command.java:79)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\logs\elasticsearch.log
PS C:\Users\omer\Downloads\elasticsearch-7.12.1-windows-x86_64\elasticsearch-7.12.1\bin>
Running elasticsearch in Windows PowerShell
Running elasticsearch in Windows PowerShell

 

LEARN MORE  Allowing or Prohibiting the Use of Requested Flash Memory with Windows Server 2019 GPO

And finally, we check whether the elasticsearch application is working properly in our internet browser. We enter the “http://localhost:9200” link in our Internet Browser and run it.

Note: If you do not have Java installed on your computer, you will get an error like this. Download and install the Java program. Java Download

http: // localhost: 9200
http: // localhost: 9200

 

Leave a Reply

Your email address will not be published. Required fields are marked *