How to run two Elasticsearch Service on Window Server 2019?

Hello,

I have two instance of Elastic installed and configured to run on a different port on Windows server.

I am required to run both the instance simultaneously. However when I try to run the second Elasticsearch service after the first one has successfully started the second one doesnt start. I have configured both the service on different port and yet it doesnt run. Could you please advise if that's even possible to run multiple service on Windows Server? If so could you please advise how to get it to work?

Below are the two config files
ElasticSearch_1

cluster.name: cluster1
 node.name: node-1
 http.port: 9200

 xpack.security.enabled: true

 xpack.security.enrollment.enabled: true

 xpack.security.http.ssl:
     enabled: true
     keystore.path: certs/http.p12

 xpack.security.transport.ssl:

    enabled: true
    verification_mode: certificate
    keystore.path: certs/transport.p12
    truststore.path: certs/transport.p12
    
 cluster.initial_master_nodes: ["node-1"]

 http.host: 0.0.0.0

ElasticSearch_2

 cluster.name: cluster2
 http.port: 9400
 xpack.security.enabled: true

Please format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

Can you share the logs from the second instance?

hi sorry about that, I've corrected the post and please find the logs below

[2022-11-22 14:41:10] [debug] ( prunsrv.c:1994) [ 6432] Apache Commons Daemon procrun log initialized.
[2022-11-22 14:41:10] [info]  ( prunsrv.c:2002) [ 6432] Apache Commons Daemon procrun (1.3.1.0 64-bit) started.
[2022-11-22 14:41:11] [info]  ( prunsrv.c:1906) [ 6432] Running Service 'es_sdap'...
[2022-11-22 14:41:11] [debug] ( prunsrv.c:1677) [ 5468] Inside serviceMain()...
[2022-11-22 14:41:11] [debug] ( prunsrv.c:1123) [ 5468] reportServiceStatusE: dwCurrentState = 2 (SERVICE_START_PENDING), dwWin32ExitCode = 0, dwWaitHint = 3000 milliseconds, dwServiceSpecificExitCode = 0.
[2022-11-22 14:41:11] [info]  ( prunsrv.c:1422) [ 5468] Starting service...
[2022-11-22 14:41:11] [debug] ( prunsrv.c:497 ) [ 5468] Checking Java options for environment variable requirements
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-XX:+UseSerialGC'
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-Des.path.home=C:\ES_1\elasticsearch'
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-Des.path.conf=C:\ES_1\elasticsearch\config'
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-Des.distribution.type=zip'
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-Dcli.name=windows-service-daemon'
[2022-11-22 14:41:11] [debug] ( prunsrv.c:501 ) [ 5468] Checking environment variable requirements for '-Dcli.libs=lib/tools/server-cli,lib/tools/windows-service-cli'
[2022-11-22 14:41:11] [debug] ( javajni.c:216 ) [ 5468] Explicit RuntimeLib specified 'C:\ES_1\elasticsearch\jdk\bin\server\jvm.dll'
[2022-11-22 14:41:11] [debug] ( javajni.c:280 ) [ 5468] Adding Java bin path to the PATH to fix loading of awt.dll: 'C:\ES_1\elasticsearch\jdk\bin'
[2022-11-22 14:41:11] [debug] ( javajni.c:286 ) [ 5468] Loading JVM DLL 'C:\ES_1\elasticsearch\jdk\bin\server\jvm.dll'
[2022-11-22 14:41:11] [debug] ( javajni.c:414 ) [ 5468] Loaded JVM DLL 'C:\ES_1\elasticsearch\jdk\bin\server\jvm.dll', home '(null)'.
[2022-11-22 14:41:11] [debug] ( javajni.c:419 ) [ 5468] JNI_GetCreatedJavaVMs...
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[0] -XX:+UseSerialGC
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[1] -Des.path.home=C:\ES_1\elasticsearch
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[2] -Des.path.conf=C:\ES_1\elasticsearch\config
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[3] -Des.distribution.type=zip
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[4] -Dcli.name=windows-service-daemon
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[5] -Dcli.libs=lib/tools/server-cli,lib/tools/windows-service-cli
[2022-11-22 14:41:11] [debug] ( javajni.c:817 ) [ 7916] JVM Option[6] -Djava.class.path=C:\ES_1\elasticsearch/lib/ecs-logging-core-1.2.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-cli-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-core-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-geo-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-log4j-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-logging-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-lz4-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-plugin-analysis-api-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-plugin-api-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-plugin-classloader-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-secure-sm-8.5.0.jar;C:\ES_1\elasticsearch/lib/elasticsearch-x-content-8.5.0.jar;C:\ES_1\elasticsearch/lib/HdrHistogram-2.1.9.jar;C:\ES_1\elasticsearch/lib/hppc-0.8.1.jar;C:\ES_1\elasticsearch/lib/jna-5.10.0.jar;C:\ES_1\elasticsearch/lib/jopt-simple-5.0.2.jar;C:\ES_1\elasticsearch/lib/log4j-api-2.18.0.jar;C:\ES_1\elasticsearch/lib/log4j2-ecs-layout-1.2.0.jar;C:\ES_1\elasticsearch/lib/lucene-analysis-common-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-backward-codecs-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-core-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-grouping-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-highlighter-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-join-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-memory-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-misc-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-queries-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-queryparser-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-sandbox-9.4.1.jar;C:\ES_1\elasticsearch/lib/lucene-suggest-9.4.1.jar;C:\ES_1\elasticsearch/lib/lz4-java-1.8.0.jar;C:\ES_1\elasticsearch/lib/t-digest-3.2.jar;C:\ES_1\elasticsearch/lib/cli-launcher/cli-launcher-8.5.0.jar
[2022-11-22 14:41:12] [debug] ( javajni.c:817 ) [ 7916] JVM Option[7] exit
[2022-11-22 14:41:12] [debug] ( javajni.c:817 ) [ 7916] JVM Option[8] abort
[2022-11-22 14:41:13] [debug] ( javajni.c:1062) [ 7916] Java worker thread started for org/elasticsearch/launcher/CliToolLauncher:main
[2022-11-22 14:41:13] [debug] ( javajni.c:1068) [ 7916] JNI calling static void method org/elasticsearch/launcher/CliToolLauncher:main
[2022-11-22 14:41:14] [debug] ( prunsrv.c:1486) [ 5468] Java started 'org/elasticsearch/launcher/CliToolLauncher'.
[2022-11-22 14:41:14] [info]  ( prunsrv.c:1585) [ 5468] Service started in 3258 milliseconds.
[2022-11-22 14:41:14] [debug] ( prunsrv.c:1123) [ 5468] reportServiceStatusE: dwCurrentState = 4 (SERVICE_RUNNING), dwWin32ExitCode = 0, dwWaitHint = 0 milliseconds, dwServiceSpecificExitCode = 0.
[2022-11-22 14:41:14] [debug] ( prunsrv.c:1832) [ 5468] Waiting for worker to finish...
[2022-11-22 14:41:14] [debug] ( javajni.c:1157) [ 5468] apxJavaWait -> WaitForSingleObject (0x0000000000000294, -1 milliseconds) (-1=INFINITE)...
[2022-11-22 14:41:15] [debug] ( javajni.c:1075) [ 7916] Exception has been thrown
[2022-11-22 14:41:15] [debug] ( javajni.c:1087) [ 7916] Java worker thread finished org/elasticsearch/launcher/CliToolLauncher:main with status = 6
[2022-11-22 14:41:15] [debug] ( javajni.c:1160) [ 5468] apxJavaWait <- WaitForSingleObject (0x0000000000000294, -1 milliseconds) = 0
[2022-11-22 14:41:15] [debug] ( prunsrv.c:1837) [ 5468] Worker finished.
[2022-11-22 14:41:15] [debug] ( prunsrv.c:1864) [ 5468] Waiting for all threads to exit.
[2022-11-22 14:41:15] [debug] ( prunsrv.c:1123) [ 5468] reportServiceStatusE: dwCurrentState = 3 (SERVICE_STOP_PENDING), dwWin32ExitCode = 0, dwWaitHint = 0 milliseconds, dwServiceSpecificExitCode = 0.
[2022-11-22 14:41:15] [debug] ( prunsrv.c:1868) [ 5468] JVM destroyed.
[2022-11-22 14:41:15] [debug] ( prunsrv.c:1123) [ 5468] reportServiceStatusE: dwCurrentState = 1 (SERVICE_STOPPED), dwWin32ExitCode = 1066, dwWaitHint = 0 milliseconds, dwServiceSpecificExitCode = 1.
[2022-11-22 14:41:15] [info]  ( prunsrv.c:1908) [ 6432] Run service finished.
[2022-11-22 14:41:15] [info]  ( prunsrv.c:2086) [ 6432] Apache Commons Daemon procrun finished.
022-11-22 14:41:11 Apache Commons Daemon procrun stderr initialized.
java.lang.RuntimeException: starting java failed with [1]
output:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for G1 virtual space
# An error report file with more information is saved as:
# logs/hs_err_pid7416.log
error:
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455)
	at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:113)
	at org.elasticsearch.server.cli.JvmOption.findFinalOptions(JvmOption.java:80)
	at org.elasticsearch.server.cli.JvmErgonomics.choose(JvmErgonomics.java:36)
	at org.elasticsearch.server.cli.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:141)
	at org.elasticsearch.server.cli.JvmOptionsParser.determineJvmOptions(JvmOptionsParser.java:92)
	at org.elasticsearch.server.cli.ServerProcess.createProcess(ServerProcess.java:214)
	at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:108)
	at org.elasticsearch.server.cli.ServerProcess.start(ServerProcess.java:91)
	at org.elasticsearch.windows.service.WindowsServiceDaemon.execute(WindowsServiceDaemon.java:38)
	at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
	at org.elasticsearch.cli.Command.main(Command.java:50)
	at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)

and the hs_err_pid7416.log has

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for G1 virtual space
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is
#     placed in the first 32GB address space. The Java Heap base address is the
#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_windows.cpp:3527), pid=7416, tid=360
#
# JRE version:  (19.0+36) (build )
# Java VM: OpenJDK 64-Bit Server VM (19+36-2238, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Core dump will be written. Default location: C:\ES_1\elasticsearch\hs_err_pid7416.mdmp
#

---------------  S U M M A R Y ------------

Command Line: -XX:+UseG1GC -Djava.io.tmpdir=C:\Windows\TEMP\elasticsearch -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -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 -Xms8191m -Xmx8191m -XX:+PrintFlagsFinal 

Host: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz, 4 cores, 15G,  Windows Server 2019 , 64 bit Build 17763 (10.0.17763.3287)
Time: Tue Nov 22 14:41:15 2022 Coordinated Universal Time elapsed time: 0.032858 seconds (0d 0h 0m 0s)

---------------  T H R E A D  ---------------

Current thread (0x0000019f14ae6f00):  JavaThread "Unknown thread" [_thread_in_vm, id=360, stack(0x000000519ee00000,0x000000519ef00000)]

Stack: [0x000000519ee00000,0x000000519ef00000]
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x6ee8fa]
V  [jvm.dll+0x857a1e]
V  [jvm.dll+0x85940e]
V  [jvm.dll+0x859ac3]
V  [jvm.dll+0x28291f]
V  [jvm.dll+0x6eb6e9]
V  [jvm.dll+0x6e028a]
V  [jvm.dll+0x357136]
V  [jvm.dll+0x35eb96]
V  [jvm.dll+0x3b555e]
V  [jvm.dll+0x3b578f]
V  [jvm.dll+0x32c6ea]
V  [jvm.dll+0x32d59e]
V  [jvm.dll+0x821b20]
V  [jvm.dll+0x3c27c1]
V  [jvm.dll+0x8022f1]
V  [jvm.dll+0x44b30f]
V  [jvm.dll+0x44cc91]
C  [jli.dll+0x5287]
C  [ucrtbase.dll+0x2268a]
C  [KERNEL32.DLL+0x17974]
C  [ntdll.dll+0x5a371]


---------------  P R O C E S S  ---------------

Threads class SMR info:
_java_thread_list=0x00007ff9e75cd048, length=0, elements={
}

Java Threads: ( => current thread )

Other Threads:
  0x0000019f14b983d0 WorkerThread "GC Thread#0" [stack: 0x000000519ef00000,0x000000519f000000] [id=5084]
  0x0000019f14baa3f0 ConcurrentGCThread "G1 Main Marker" [stack: 0x000000519f000000,0x000000519f100000] [id=6864]
  0x0000019f14bab8f0 WorkerThread "G1 Conc#0" [stack: 0x000000519f100000,0x000000519f200000] [id=4644]

[error occurred during error reporting (printing all threads), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff9e6d8d127]

VM state: not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0x0000019f14ae2030] Heap_lock - owner thread: 0x0000019f14ae6f00

Heap address: 0x0000000600000000, size: 8192 MB, Compressed Oops mode: Zero based, Oop shift amount: 3

CDS archive(s) mapped at: [0x0000000000000000-0x0000000000000000-0x0000000000000000), size 0, SharedBaseAddress: 0x0000000800000000, ArchiveRelocationMode: 0.
Narrow klass base: 0x0000000000000000, Narrow klass shift: 0, Narrow klass range: 0x0

GC Precious Log:
 CardTable entry size: 512
 Card Set container configuration: InlinePtr #cards 4 size 8 Array Of Cards #cards 16 size 48 Howl #buckets 8 coarsen threshold 7372 Howl Bitmap #cards 1024 size 144 coarsen threshold 921 Card regions per heap region 1 cards per card region 8192

Heap:
 garbage-first heap   total 0K, used 0K [0x0000000600000000, 0x0000000800000000)
  region size 4096K, 0 young (0K), 0 survivors (0K)

[error occurred during error reporting (printing heap information), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff9e7196959]

GC Heap History (0 events):
No events

Dll operation events (1 events):
Event: 0.008 Loaded shared library C:\ES_1\elasticsearch\jdk\bin\java.dll

Deoptimization events (0 events):
No events

Classes loaded (0 events):
No events

Classes unloaded (0 events):
No events

Classes redefined (0 events):
No events

Internal exceptions (0 events):
No events

VM Operations (0 events):
No events

Events (0 events):
No events


Dynamic libraries:
0x00007ff74d6f0000 - 0x00007ff74d6fe000 	C:\ES_1\elasticsearch\jdk\bin\java.exe
0x00007ffa23ad0000 - 0x00007ffa23cbe000 	C:\Windows\SYSTEM32\ntdll.dll
0x00007ffa20ef0000 - 0x00007ffa20fa3000 	C:\Windows\System32\KERNEL32.DLL
0x00007ffa1fc00000 - 0x00007ffa1fe9d000 	C:\Windows\System32\KERNELBASE.dll
0x00007ffa1fea0000 - 0x00007ffa1ff9a000 	C:\Windows\System32\ucrtbase.dll
0x00007ff9f7ed0000 - 0x00007ff9f7eeb000 	C:\ES_1\elasticsearch\jdk\bin\VCRUNTIME140.dll
0x00007ff9f7e90000 - 0x00007ff9f7ea7000 	C:\ES_1\elasticsearch\jdk\bin\jli.dll
0x00007ffa21070000 - 0x00007ffa21208000 	C:\Windows\System32\USER32.dll
0x00007ffa1fbe0000 - 0x00007ffa1fc00000 	C:\Windows\System32\win32u.dll
0x00007ffa14c30000 - 0x00007ffa14ea9000 	C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17763.3650_none_de72e6e05349b85a\COMCTL32.dll
0x00007ffa21ca0000 - 0x00007ffa21cc9000 	C:\Windows\System32\GDI32.dll
0x00007ffa20e50000 - 0x00007ffa20eee000 	C:\Windows\System32\msvcrt.dll
0x00007ffa20160000 - 0x00007ffa20300000 	C:\Windows\System32\gdi32full.dll
0x00007ffa215c0000 - 0x00007ffa218eb000 	C:\Windows\System32\combase.dll
0x00007ffa1ffa0000 - 0x00007ffa20040000 	C:\Windows\System32\msvcp_win.dll
0x00007ffa21b80000 - 0x00007ffa21c9d000 	C:\Windows\System32\RPCRT4.dll
0x00007ffa20500000 - 0x00007ffa20582000 	C:\Windows\System32\bcryptPrimitives.dll
0x00007ffa04940000 - 0x00007ffa0494c000 	C:\ES_1\elasticsearch\jdk\bin\vcruntime140_1.dll
0x00007ff9f5e00000 - 0x00007ff9f5e8e000 	C:\ES_1\elasticsearch\jdk\bin\msvcp140.dll
0x00007ff9e6a50000 - 0x00007ff9e7710000 	C:\ES_1\elasticsearch\jdk\bin\server\jvm.dll
0x00007ffa20fc0000 - 0x00007ffa21067000 	C:\Windows\System32\ADVAPI32.dll
0x00007ffa23a00000 - 0x00007ffa23a9f000 	C:\Windows\System32\sechost.dll
0x00007ffa0ba70000 - 0x00007ffa0ba79000 	C:\Windows\SYSTEM32\WSOCK32.dll
0x00007ffa1db30000 - 0x00007ffa1db54000 	C:\Windows\SYSTEM32\WINMM.dll
0x00007ffa15f80000 - 0x00007ffa15f8a000 	C:\Windows\SYSTEM32\VERSION.dll
0x00007ffa22150000 - 0x00007ffa221bd000 	C:\Windows\System32\WS2_32.dll
0x00007ffa1dab0000 - 0x00007ffa1dadd000 	C:\Windows\SYSTEM32\winmmbase.dll
0x00007ffa1fb90000 - 0x00007ffa1fbda000 	C:\Windows\System32\cfgmgr32.dll
0x00007ffa1fb10000 - 0x00007ffa1fb21000 	C:\Windows\System32\kernel.appcore.dll
0x00007ffa06710000 - 0x00007ffa0671a000 	C:\ES_1\elasticsearch\jdk\bin\jimage.dll
0x00007ffa145c0000 - 0x00007ffa147ad000 	C:\Windows\SYSTEM32\DBGHELP.DLL
0x00007ffa14410000 - 0x00007ffa1443a000 	C:\Windows\SYSTEM32\dbgcore.DLL
0x00007ffa05730000 - 0x00007ffa05756000 	C:\ES_1\elasticsearch\jdk\bin\java.dll

dbghelp: loaded successfully - version: 4.0.5 - missing functions: none
symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\ES_1\elasticsearch\jdk\bin;C:\Windows\SYSTEM32;C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17763.3650_none_de72e6e05349b85a;C:\ES_1\elasticsearch\jdk\bin\server

VM Arguments:
jvm_args: -XX:+UseG1GC -Djava.io.tmpdir=C:\Windows\TEMP\elasticsearch -XX:+HeapDumpOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError -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 -Xms8191m -Xmx8191m -XX:+PrintFlagsFinal 
java_command: <unknown>
java_class_path (initial): <not set>
Launcher Type: SUN_STANDARD

[Global flags]
     intx CICompilerCount                          = 3                                         {product} {ergonomic}
     uint ConcGCThreads                            = 1                                         {product} {ergonomic}
    ccstr ErrorFile                                = logs/hs_err_pid%p.log                     {product} {command line}
     bool ExitOnOutOfMemoryError                   = true                                      {product} {command line}
     uint G1ConcRefinementThreads                  = 4                                         {product} {ergonomic}
   size_t G1HeapRegionSize                         = 4194304                                   {product} {ergonomic}
    uintx GCDrainStackTargetSize                   = 64                                        {product} {ergonomic}
     bool HeapDumpOnOutOfMemoryError               = true                                   {manageable} {command line}
    ccstr HeapDumpPath                             = data                                   {manageable} {command line}
   size_t InitialHeapSize                          = 8589934592                                {product} {command line, ergonomic}
   size_t MarkStackSize                            = 4194304                                   {product} {ergonomic}
   size_t MaxHeapSize                              = 8589934592                                {product} {command line, ergonomic}
   size_t MinHeapDeltaBytes                        = 4194304                                   {product} {ergonomic}
   size_t MinHeapSize                              = 8589934592                                {product} {command line, ergonomic}
    uintx NonNMethodCodeHeapSize                   = 5832780                                {pd product} {ergonomic}
    uintx NonProfiledCodeHeapSize                  = 122912730                              {pd product} {ergonomic}
     bool PrintFlagsFinal                          = true                                      {product} {command line}
    uintx ProfiledCodeHeapSize                     = 122912730                              {pd product} {ergonomic}
    uintx ReservedCodeCacheSize                    = 251658240                              {pd product} {ergonomic}
     bool SegmentedCodeCache                       = true                                      {product} {ergonomic}
   size_t SoftMaxHeapSize                          = 8589934592                             {manageable} {ergonomic}
     bool UseCompressedClassPointers               = true                           {product lp64_product} {ergonomic}
     bool UseCompressedOops                        = true                           {product lp64_product} {ergonomic}
     bool UseG1GC                                  = true                                      {product} {command line}
     bool UseLargePagesIndividualAllocation        = false                                  {pd product} {ergonomic}

Logging:
Log output configuration:
 #0: stdout all=warning uptime,level,tags foldmultilines=false
 #1: stderr all=off uptime,level,tags foldmultilines=false
 #2: file=logs/gc.log all=off,gc*=info,age*=trace,safepoint=info utctime,pid,tags foldmultilines=false,filecount=32,filesize=65536K,async=false (reconfigured)

Environment Variables:
PATH=C:\ES_1\elasticsearch\jdk\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\OpenSSL-Win64\bin;C:\Program Files\Microsoft VS Code\bin;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
USERNAME=mypc$
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 85 Stepping 4, GenuineIntel
TMP=C:\Windows\TEMP
TEMP=C:\Windows\TEMP



---------------  S Y S T E M  ---------------

OS:
 Windows Server 2019 , 64 bit Build 17763 (10.0.17763.3287)
OS uptime: 5 days 21:21 hours
Hyper-V virtualization detected

CPU: total 4 (initial active 4) (4 cores per cpu, 1 threads per core) family 6 model 85 stepping 4 microcode 0xffffffff, cx8, cmov, fxsr, mmx, 3dnowpref, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, lzcnt, tsc, avx, avx2, aes, erms, clmul, bmi1, bmi2, rtm, adx, fma, vzeroupper, clflush, clflushopt, hv, rdtscp

Memory: 4k page, system-wide physical 16382M (3686M free)
TotalPageFile size 18942M (AvailPageFile size 6029M)
current process WorkingSet (physical memory assigned to process): 10M, peak: 10M
current process commit charge ("private bytes"): 52M, peak: 8244M

vm_info: OpenJDK 64-Bit Server VM (19+36-2238) for windows-amd64 JRE (19+36-2238), built on 2022-08-12T20:29:01Z by "mach5one" with MS VC++ 17.1 (VS2022)

END.

Two ES instances on the same host? Might work on different ports.
You have issue with memory:

error='The paging file is too small for this operation to complete' (DOS error/errno=1455)
at org.elasticsearch.server.cli.JvmOption.flagsFinal(JvmOption.java:113)

Yes the two instance is on the same host. configured on different ports.

Is the error something which can be fixed in software or should I increase the VM hardware RAM?

had to set the jvm.option as below to fix the error(the jvm.option is in the Elasticsearch/config folder on Windows. . The issues was with Ram completely being occupied by the first ES and Kibana instance.

-Xms2g
-Xmx2g