The above method didn't work as expected. So I tried creating an additional node using the same directory. I ran the below command.
C:\Program Files\Elastic\Elasticsearch\7.12.0>bin\elasticsearch -Enode.name=node-2 -Epath.data=./node-2/data -Epath.logs=./node-2/logs
But, this as well gave the following error.
</C:\Program Files\Elastic\Elasticsearch\7.12.0>bin\elasticsearch -Enode.name=node-2 -Epath.data=./node-2/data -Epath.logs=./node-2/logs
Could not rename log file 'logs/gc.log' to 'logs/gc.log.30' (Permission denied).
[2021-04-29T16:51:55,902][INFO ][o.e.n.Node ] [node-2] version[7.12.0], pid[15924], build[unknown/unknown/78722783c38caa25a70982b5b042074cde5d3b3a/2021-03-18T06:17:15.410153305Z], OS[Windows 10/10.0/amd64], JVM[AdoptOpenJDK/OpenJDK 64-Bit Server VM/15.0.1/15.0.1+9]
[2021-04-29T16:51:55,905][INFO ][o.e.n.Node ] [node-2] JVM home [C:\Program Files\Elastic\Elasticsearch\7.12.0\jdk]
[2021-04-29T16:51:55,907][INFO ][o.e.n.Node ] [node-2] 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\hussshe\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, -Xmx2560m, -Xms2560m, -XX:MaxDirectMemorySize=1342177280, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Delasticsearch, -Des.path.home=C:\Program Files\Elastic\Elasticsearch\7.12.0, -Des.path.conf=C:\ProgramData\Elastic\Elasticsearch\config]
[2021-04-29T16:52:03,031][INFO ][o.e.p.PluginsService ] [node-2] loaded module [aggs-matrix-stats]
[2021-04-29T16:52:03,032][INFO ][o.e.p.PluginsService ] [node-2] loaded module [analysis-common]
[2021-04-29T16:52:03,537][INFO ][o.e.e.NodeEnvironment ] [node-2] using [1] data paths, mounts [[OSDisk (C:)]], net usable_space [54.1gb], net total_space [236.8gb], types [NTFS]
[2021-04-29T16:52:03,538][INFO ][o.e.e.NodeEnvironment ] [node-2] heap size [2.5gb], compressed ordinary object pointers [true]
[2021-04-29T16:52:03,657][INFO ][o.e.n.Node ] [node-2] node name [node-2], node ID [vEJLD-ONRaq_q6LB75WTxw], cluster name [elasticsearch], roles [transform, data_frozen, master, remote_cluster_client, data, ml, data_content, data_hot, data_warm, data_cold, ingest]
[2021-04-29T16:52:08,456][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-2] [controller/11896] [Main.cc@117] controller (64 bit): Version 7.12.0 (Build 778cc7261dfdd1) Copyright (c) 2021 Elasticsearch BV
[2021-04-29T16:52:08,991][INFO ][o.e.x.s.a.s.FileRolesStore] [node-2] parsed [0] roles from file [C:\ProgramData\Elastic\Elasticsearch\config\roles.yml]
[2021-04-29T16:52:10,394][INFO ][o.e.t.NettyAllocator ] [node-2] creating NettyAllocator with the following configs: [name=elasticsearch_configured, chunk_size=1mb, suggested_max_allocation_size=1mb, factors={es.unsafe.use_netty_default_chunk_and_page_size=false, g1gc_enabled=true, g1gc_region_size=4mb}]
[2021-04-29T16:52:10,475][INFO ][o.e.d.DiscoveryModule ] [node-2] using discovery type [zen] and seed hosts providers [settings]
[2021-04-29T16:52:10,997][INFO ][o.e.g.DanglingIndicesState] [node-2] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2021-04-29T16:52:11,473][INFO ][o.e.n.Node ] [node-2] initialized
[2021-04-29T16:52:11,474][INFO ][o.e.n.Node ] [node-2] starting ...
[2021-04-29T16:52:11,487][INFO ][o.e.x.s.c.PersistentCache] [node-2] persistent cache index loaded
[2021-04-29T16:52:11,743uncaught exception in thread [main]
][ERRORBindTransportException[Failed to bind to 127.0.0.1:9300]; nested: BindException[Address already in use: bind];
][Likely root cause: java.net.BindException: Address already in use: bind
o.e.b.ElasticsearchUncaughtExceptionHandler] at java.base/sun.nio.ch.Net.bind0(Native Method)
[node-2 at java.base/sun.nio.ch.Net.bind(Net.java:550)
] uncaught exception in thread at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:249)
[main at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550)
org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to 127.0.0.1:9300]; nested: BindException[Address already in use: bind];
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.12.0.jar:7.12.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.12.0.jar:7.12.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.12.0.jar:7.12.0]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.12.0.jar:7.12.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.12.0.jar:7.12.0]
Caused by: org.elasticsearch.transport.BindTransportException: Failed to bind to 127.0.0.1:9300
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
at org.elasticsearch.transport.TcpTransport.bindToPort(TcpTransport.java:406) ~[elasticsearch-7.12.0.jar:7.12.0]
at org.elasticsearch.transport.TcpTransport.bindServer(TcpTransport.java:370) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
at org.elasticsearch.transport.netty4.Netty4Transport.doStart(Netty4Transport.java:120) ~[?:?]
at org.elasticsearch.xpack.core.security.transport.netty4.SecurityNetty4Transport.doStart(SecurityNetty4Transport.java:85) ~[?:?]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
at org.elasticsearch.xpack.security.transport.netty4.SecurityNetty4ServerTransport.doStart(SecurityNetty4ServerTransport.java:47) ~[?:?]
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:48) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at org.elasticsearch.transport.TransportService.doStart(TransportService.java:263) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at org.elasticsearch.common.component.AbstractLifecycleComponent.start(AbstractLifecycleComponent.java:48) ~[elasticsearch-7.12.0.jar:7.12.0]
at org.elasticsearch.node.Node.start(Node.java:827) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at org.elasticsearch.bootstrap.Bootstrap.start(Bootstrap.java:311) ~[elasticsearch-7.12.0.jar:7.12.0]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:406) ~[elasticsearch-7.12.0.jar:7.12.0]
at java.base/java.lang.Thread.run(Thread.java:832)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.12.0.jar:7.12.0]
... 6 more
For complete error details, refer to the log at C:\Program Files\Elastic\Elasticsearch\7.12.0\node-2\logs\elasticsearch.log
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:?]
at sun.nio.ch.Net.bind(Net.java:550) ~[?:?]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:249) ~[?:?]
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134) ~[?:?]
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550) ~[?:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491) ~[?:?]
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973) ~[?:?]
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248) ~[?:?]
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472) ~[?:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[?:?]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
at java.lang.Thread.run(Thread.java:832) [?:?]
[2021-04-29T16:52:12,524][INFO ][o.e.n.Node ] [node-2] stopping ...
[2021-04-29T16:52:12,529][INFO ][o.e.n.Node ] [node-2] stopped
[2021-04-29T16:52:12,530][INFO ][o.e.n.Node ] [node-2] closing ...
[2021-04-29T16:52:12,544][INFO ][o.e.n.Node ] [node-2] closed