0

I have successfully created an index job using fscrawler and made it run as a service in windows as shown in the documentation:

set JAVA_HOME=c:\Program Files\Java\jdk15.0.1
set FS_JAVA_OPTS=-Xmx2g -Xms2g

/Elastic/fscrawler/bin/fscrawler.bat --config_dir C:\Documents\Elasctic\fscrawler job1 >> 
/Elastic/logs/fscrawler.log 2>&1

However, I have several jobs (like 10 of them) which I would like to run concurrently. I have tried adding the start command as below but it gives me errors:

set JAVA_HOME=c:\Program Files\Java\jdk15.0.1
set FS_JAVA_OPTS=-Xmx2g -Xms2g

start "" /Elastic/fscrawler/bin/fscrawler.bat --config_dir C:\Documents\Elasctic\fscrawler job1 >> 
/Elastic/logs/fscrawler.log 2>&1
start "" /Elastic/fscrawler/bin/fscrawler.bat --config_dir C:\Documents\Elasctic\fscrawler job2 >> 
/Elastic/logs/fscrawler.log 2>&1

How do I add several index jobs to the batch file so that they all run simultaneously?

Denn
  • 447
  • 1
  • 6
  • 27
  • 1
    _"but it gives me errors:"_ What are the errors? but some notes, your close set commands in double quotes, starting before variable name. i.e `set "JAVA_HOME=c:\Program Files\Java\jdk15.0.1"` and `set "FS_JAVA_OPTS=-Xmx2g -Xms2g"` windows uses ``\`` instead of `/` Also, windows uses ``\`` instead of `/` so change to `start "" "Elastic\fscrawler\bin\fscrawler.bat" --config_dir "C:\Documents\Elasctic\fscrawler"` – Gerhard Apr 28 '21 at 12:37
  • The redirection to the log file needs to be on the same line. – Squashman Apr 28 '21 at 19:13
  • The batch file with one command (as shown in the documentation) works fine. My greatest challenge is to run several commands simultaneously. – Denn Apr 29 '21 at 14:32
  • I don't understand the question. As you are running on Windows, I'd just open 2 different CMD and launch both separately. – dadoonet May 05 '21 at 07:56
  • Currently I have like 5 indexed but I envision growing to about 40 or 50 indexes.. do I make services for all of them separately or can I create just one service running different indexes within it? – Denn May 06 '21 at 07:18

0 Answers0