Visokio website     Downloads     Video tutorials     KnowledgeBase  
Scheduler: Running multiple instances concurrently - Visokio Forums
Scheduler: Running multiple instances concurrently
  •     michael April 13, 2012 11:12AM
    To run 2..N Schedulers simultaneously:

    In the text below:

    1) Change YOUR_ACCOUNT_NAME for you correspondent account name.

    2.1) If you have User specific installation (not system-wide) replace OMNISCOPE_INSTALL_DIR for:

    C:\Users\YOUR_ACCOUNT_NAME\AppData\Local\Visokio Omniscope app


    2.1) If you have system wide installation, replace OMNISCOPE_INSTALL_DIR for:

    C:\Program Files (x86)\Visokio Omniscope

    Make sure that the path exists.

    ==========================================================

    1) In your service directory

    "OMNISCOPE_INSTALL_DIR\service\"

    Create 2..N folders s1..sN

    2) In each directory create config.xml file
    and set different/correspondent port and configurationFilePath:
    E.g.:

    OMNISCOPE_INSTALL_DIR\service\s1\config.xml


    <?xml version="1.0" encoding="UTF-8"?>
    <schedulerConfig configurationFilePath="OMNISCOPE_INSTALL_DIR\service\s1\config.xml" port="24680" forkScheduledExecution="false" logDebug="false" logDetail="false" watchFolder="watch" watchPollingInterval="40">
    <tasks>
    </tasks>
    </schedulerConfig>


    OMNISCOPE_INSTALL_DIR\service\s2\config.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <schedulerConfig configurationFilePath="OMNISCOPE_INSTALL_DIR\service\s2\config.xml" port="24682" forkScheduledExecution="false" logDebug="false" logDetail="false" watchFolder="watch" watchPollingInterval="40">
    <tasks>
    </tasks>
    </schedulerConfig>


    3) Go to "OMNISCOPE_INSTALL_DIR"
    and create executable file run_scheduler.bat (if you have x64 version, leave it as in the example below otherwise change for x86 )



    For Omniscope 2.7
    set CONF_DIR=%1
    "OMNISCOPE_INSTALL_DIR\x64\bin\java.exe" -Dsun.java2d.d3d=false -DschedulerConfigLocation="OMNISCOPE_INSTALL_DIR\service\%CONF_DIR%\config.xml" -Xms64M -XX:MaxPermSize=128M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30 -XX:NewRatio=8 -XX:+UseSerialGC -Xmx6183M -Dvisokio.localappdata="C:\Users\YOUR_ACCOUNT_NAME\AppData\Local" -Dvisokio.winproxyenable="0" -Dvisokio.winproxyserver="" -cp "OMNISCOPE_INSTALL_DIR\Main.jar;OMNISCOPE_INSTALL_DIR\lib\mail.jar;OMNISCOPE_INSTALL_DIR\lib\activation.jar;OMNISCOPE_INSTALL_DIR\plugins\bccrypto.jar" com.visokio.ent.EntLaunch -scheduler


    From Omniscope 2.8
    set CONF_DIR=%1
    "OMNISCOPE_INSTALL_DIR\x64\bin\java.exe" -Dsun.java2d.d3d=false -DschedulerConfigLocation="OMNISCOPE_INSTALL_DIR\service\%CONF_DIR%\config.xml" -Xms64M -XX:MaxPermSize=128M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30 -XX:NewRatio=8 -XX:+UseSerialGC -Xmx6183M -Dvisokio.localappdata="C:\Users\YOUR_ACCOUNT_NAME\AppData\Local" -Dvisokio.winproxyenable="0" -Dvisokio.winproxyserver="" -cp "OMNISCOPE_INSTALL_DIR\Main.jar;OMNISCOPE_INSTALL_DIR\lib\mailapi.jar;OMNISCOPE_INSTALL_DIR\lib\smtp.jar;OMNISCOPE_INSTALL_DIR\lib\pop3.jar;OMNISCOPE_INSTALL_DIR\lib\imap.jar;OMNISCOPE_INSTALL_DIR\lib\dsn.jar;OMNISCOPE_INSTALL_DIR\lib\activation.jar;OMNISCOPE_INSTALL_DIR\plugins\bccrypto.jar" com.visokio.ent.EntLaunch -server


    From Omniscope 3.0
    set CONF_DIR=%1
    "OMNISCOPE_INSTALL_DIR\OmniscopeEnterprise.exe" "/jvmarg=-DschedulerConfigLocation=OMNISCOPE_INSTALL_DIR\service\%CONF_DIR%\config.xml"


    4) Start schedulers using run_scheduler.bat and passing folder names s1, s2, ... sN as a parameter:
    E.g.:

    run_scheduler.bat s1
    run_scheduler.bat s2
    ...
    run_scheduler.bat sN

    You can do it into two ways.

    a) You can create Shortcuts. Right-click on your Desktop->New->Shortcut.

    Specify the path to your run_scheduler.bat file and pass the parameter, for example on my computer it is:

    "C:\Users\michael\AppData\Local\Visokio Omniscope app\run_scheduler.bat" s1


    b) Alternatively you can run the command from Windows Console - cmd.exe


    5) In C:\Users\YOUR_ACCOUNT_NAME\scheduler\log.txt you should see log messages from all schedulers.


    You can use attached files as templates replacing (here it is text in bold) with your current file paths
    and then renaming
    config_xml_tempalte.txt => config.xml
    run_scheduler_bat_template.txt => run_scheduler.bat
  • 37 Comments
  • Alexander     Alexander April 17, 2012 5:28AM
    Hi Michael,

    Thanks for the instructions. I believe I did everything as you described it, yet when executing the run_scheduler.bat nothing happens. How do I set s1 or s2 as a parameter?

    Thanks!

    Alexander
  •     michael April 17, 2012 6:36AM
    You can create Shortcuts:
    Right-click on your desktop and in the menu go to New->Shortcut.

    In the dialogue enter (change YOUR_ACCOUNT_NAME for your computer account name)

    "C:\Users\YOUR_ACCOUNT_NAME\AppData\Local\Visokio Omniscope app\run_scheduler.bat" s1

    click next and name this label, e.g. "Service 1"

    Make sure that Shortcut on your desktop works, i.e. starts your first scheduler instance.

    Repeat the same for the second parameter s2:


    "C:\Users\YOUR_ACCOUNT_NAME\AppData\Local\Visokio Omniscope app\run_scheduler.bat" s2

    Shortcut name, e.g. "Service 2"


    image
    image
    Attachments
    01.png 60K
    02.png 75K
  • Alexander     Alexander April 17, 2012 7:42AM
    Hi Michael,

    Feeling rather stupid as your explenation is really clear. I made a shortcut on the desktop, but it is not working. I get a really fast dissappearing cmd screen. The same happens if I just click on the run_scheduler.bat. Is your explenation for 2.7?

    Hope you can help me once more... Thanks!

    Regards,
    Alexander
  •     steve April 17, 2012 7:48AM
    Run the bat file from a command prompt, so you can see the output. Or add a "pause" command at the end of the bat file. What do you see?
  • Alexander     Alexander April 17, 2012 7:58AM
    Hi Steve,

    I've added the pause command, attached the output. "Cannot find the path"

    image
    Attachments
    Output scheduler.png 34K
  •     michael April 17, 2012 8:00AM
    You CONF_DIR is empty, you missed out the parameter s1
  • Alexander     Alexander April 17, 2012 8:05AM
    That is because I executed the Bat file, not the short cut. The output from the shortcut is:
    image
    Attachments
    Untitled.jpg 85K
  •     michael April 17, 2012 8:06AM
    As an alternative for Shortcut you can run from Console:

    go to Start , type "cmd.exe "
    type in following commands:

    cd "C:\Users\YOUR_ACCOUNT_NAME\AppData\Local\Visokio Omniscope app"

    press enter

    run_scheduler.bat s1

    press enter

    image
    Attachments
    03.png 127K
  •     michael April 17, 2012 8:08AM
    Can you also make sure that you have following directory:

    C:\Users\Administrator\AppData\Local\Visokio Omniscope app\service\s1
  • Alexander     Alexander April 17, 2012 8:09AM
    The same thing, cannot find the path. Did I do something wrong in the config files?
  •     michael April 17, 2012 8:10AM
    Could you check that you have this directory:
    C:\Users\Administrator\AppData\Local\Visokio Omniscope app\service\s1
  • Alexander     Alexander April 17, 2012 8:22AM
    Yes, I do have that directory.
  •     michael April 17, 2012 10:52AM
    I sent an email.
  •     michael April 17, 2012 11:18AM
    Do you have x64 version or x86 ()?

    If you have x86 version edit run_scheduler.bat file. Change x64 for x86:


    set CONF_DIR=%1
    "C:\Users\Administrator\AppData\Local\Visokio Omniscope app\x86\bin\java.exe"
    ....................
    ....................
    ....................


    Make sure that
    if you have x64 then following file should exist:
    C:\Users\Administrator\AppData\Local\Visokio Omniscope app\x64\bin\java.exe

    or if you have x86 then following file should exist:
    C:\Users\Administrator\AppData\Local\Visokio Omniscope app\x86\bin\java.exe
  • Alexander     Alexander April 18, 2012 4:31AM
    Hi Michael,

    I found the java.exe file, it is in a different directory...C:\Program Files (x86)\Visokio Omniscope\x86\bin\java.exe

    Could this be causing the error?

    Regards

    Alexander
  •     michael April 18, 2012 7:00AM
    The issue was with the file-path to Omniscope installation. The initial document was for User installation where it is:

    "C:\Users\YOUR_ACCOUNT_NAME\AppData\Local\Visokio Omniscope app\"

    Alexander has system wide installation and the path to Omniscope installation should be changed to:

    "C:\Program Files (x86)\Visokio Omniscope\"
  • antonio     antonio May 21, 2013 7:09AM
    From Omniscope 2.8, to customise the Omniscope Server log filename (both name and extension), uncomment, modify the value and add the following line in the installconfig.properties file:
    ADDITIONAL_JVM_ARGS=-DserverLogFilename="FILENAME.ext"

    This is highly recommended when running different instances of the Omniscope Server (ex Scheduler) to allow logging on different files.
  • edtclarke     edtclarke January 16, 2014 5:24AM
    Can I just ask whether there are any memory configuration settings that need to be changed when running 2 schedulers - we're still on 2.7 (will be upgrading soon).
    Can you configure the amount of memory each scheduler is allocated? Thanks, Ed
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  •     donald January 20, 2014 1:27PM
    Both schedulers will use the same default memory setting as per installconfig.properties file located into the Omniscope install application folder.
    See
    http://www.visokio.com/kb/installconfig

    You can configure them to individually use different memory settings by changing your scheduler batch file to provide a different command line for each of your schedulers.

    run_scheduler.bat

    In the example below it is set to 6Gb " -Xmx6183M" for scheduler 1 "s1" and 3Gb for any other scheduler "-Xmx3000M"
    e.g
    if "%CONF_DIR%" == "s1" (
    "OMNISCOPE_INSTALL_DIR\x64\bin\java.exe" -Dsun.java2d.d3d=false -DschedulerConfigLocation="OMNISCOPE_INSTALL_DIR\service\%CONF_DIR%\config.xml" -Xms64M -XX:MaxPermSize=128M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30 -XX:NewRatio=8 -XX:+UseSerialGC -Xmx6183M -Dvisokio.localappdata="C:\Users\YOUR_ACCOUNT_NAME\AppData\Local" -Dvisokio.winproxyenable="0" -Dvisokio.winproxyserver="" -cp "OMNISCOPE_INSTALL_DIR\Main.jar;OMNISCOPE_INSTALL_DIR\lib\mail.jar;OMNISCOPE_INSTALL_DIR\lib\activation.jar;OMNISCOPE_INSTALL_DIR\plugins\bccrypto.jar" com.visokio.ent.EntLaunch -scheduler
    ) else (
    "OMNISCOPE_INSTALL_DIR\x64\bin\java.exe" -Dsun.java2d.d3d=false -DschedulerConfigLocation="OMNISCOPE_INSTALL_DIR\service\%CONF_DIR%\config.xml" -Xms64M -XX:MaxPermSize=128M -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=30 -XX:NewRatio=8 -XX:+UseSerialGC -Xmx3000M -Dvisokio.localappdata="C:\Users\YOUR_ACCOUNT_NAME\AppData\Local" -Dvisokio.winproxyenable="0" -Dvisokio.winproxyserver="" -cp "OMNISCOPE_INSTALL_DIR\Main.jar;OMNISCOPE_INSTALL_DIR\lib\mail.jar;OMNISCOPE_INSTALL_DIR\lib\activation.jar;OMNISCOPE_INSTALL_DIR\plugins\bccrypto.jar" com.visokio.ent.EntLaunch -scheduler
    )
  • edtclarke     edtclarke January 23, 2014 7:09AM
    Thanks Donald that's really helpful. Can you just tell me if Omniscope grabs that chunk of memory or is this just a maximum threshold that it can use i.e. it wouldn't actually hog 6GB unless it needed it?
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  •     donald January 23, 2014 9:40AM
    It is a maximum threshold. It won't hog the full 6GB unless it is needed.
  • edtclarke     edtclarke January 23, 2014 9:41AM
    Thanks Donald, that's what it looked like when I implemented your suggestion but thought I'd check just in case the allocation hadn't worked.
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  • edtclarke     edtclarke January 30, 2014 5:37AM
    Hi, I got this working on our dev server which has a local install but when I tried on our live, which is a system wide install I am getting the following error message when trying to exec the run_sheduler.bat file:
    "APPLICATION ERROR:
    java.lang.UnsupportedOperationException: EntLaunch not enabled
    at com.visokio.ent.EntLaunch.a(EntLaunch.java:48)
    at com.visokio.ent.EntLaunch.main(EntLaunch.java:28)"
    I also get a popup message which I've attached.
    I've attached all the relevant files in case I've typed something wrong somewhere!
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  • edtclarke     edtclarke January 30, 2014 6:42AM
    Currently on our live server we are running Omniscope (single scheduler) as a windows service - can you run multiple schedulers as services? We are currently on 2.7 but I will be updating to 2.8 so happy for 2.8 instructions if it is possible.
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  •     donald January 30, 2014 7:17AM
    You need to run the scheduler as the user who did the license activation. When you activate the license you also need to use the system wide version of Omniscope when using the GUI to activate.

    Can you log onto the machine as the user you intend to run the service as and run Omniscope from the system wide installation location.
    C:\Program Files (x86)\Visokio Omniscope\Omniscope.exe
    or
    C:\Program Files\Visokio Omniscope\Omniscope.exe

    Select Help->"Licensing and Activation" menu item, this will display either an "Activate Omniscope" dialog box if the license has not been activated for this user or the current license edition, license key and expiry date if it has.

    image


    image
    License is NOT activated

    image
    License IS activated


    The user that is set to run the scheduler service is defined in the Windows Services administration tool, select "Visokio Enterprise" properties and select the "Log On" tab, check the "This account" box and enter the username and password.

    image
  •     donald January 30, 2014 8:30AM
    Yes you can run multiple instances.
    See the post "Scheduler: Running multiple instances concurrently"
    http://forums.visokio.com/discussion/1469/scheduler-running-multiple-instances-concurrently/p1

  • edtclarke     edtclarke January 30, 2014 8:50AM
    Donald, I've seen that thread as it's the one we're commenting on ;-)
    My question, which perhaps wasn't well worded, is really how do the schedulers relate to Omniscope running as a service? We currently have Omniscope running as a service using only one scheduler and we'd like to start running multiple schedulers - other than following the instructions in this thread, is there anything we have to do with regards to the windows service. The bottom line is - if we have one instance of Omniscope running as a service and I implement the instructions above for running 2 schedulers, will both schedulers get started when we reboot the machine?
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  • edtclarke     edtclarke January 30, 2014 9:07AM
    Donald, with regards to the scheduler error - Omniscope was installed and activated as the Administrator account

    the service is running as Administrator
    image
    and I am currently connected via RDC to the server as that account, therefore trying to run the batch file as Administrator.
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  • edtclarke     edtclarke January 30, 2014 11:02AM
    I have just reinstalled our dev environment as Omniscope was a local install and not running as a service. Now it is a system wide install and running as a service I am getting the same error as the live server. I'm sure that it must be some sort of permissions problem but I can't figure it out - if anyone can help quickly it would be much appreciated
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  •     donald January 30, 2014 1:19PM
    You can only run one instance of the server using the Windows services wrapper. If you have the service set to automatically start then on reboot it will start the default first instance of the server with the default configuration and first default scheduler.

    The method described earlier in the thread requires the licensed user logged on and manually starting each of the scheduler instances. In that case it is starting multiple independent Omniscope instances.
  •     donald January 30, 2014 1:21PM
    Thanks for the screen sharing session. I can reproduce the error here and we will get back to you tomorrow morning as discussed to resolve the issue.
  •     donald January 31, 2014 6:27AM
    The scheduler has to be started from the Omniscope installation directory.
    e.g. for the run_scheduler.bat add a change directory command
    cd "C:\Program Files (x86)\Visokio Omniscope"

    The parameter visokio.localappdata passed to Java has to be the users "AppData"
    e.g.
    change it from
    -Dvisokio.localappdata="C:\Program Files (x86)"
    to
    -Dvisokio.localappdata="C:\Users\Administrator\AppData\Local"

    It is also recommended to separate the log for each of your schedulers.
    In the batch file you use to start schedulers modify or add the parameter -DserverLogFilename to the java.exe command line you use.

    Set a different log file name for each of the scheduler instances
    e.g.
    -DserverLogFilename=""C:\Users\Administrator\SchedulerSpecificLogFileName.txt"

    You can double check the parameters used for starting the scheduler using the "OmniscopeEnterprise_debug.exe" in the installation directory
    Open a command prompt and change to the installation directory.
    run OmniscopeEnterprise_debug.exe
    This will display a dialog saying that diagnostic information has been saved to the users home directory, press OK.
    A command prompt will open which you can use to copy and paste the parameters for your batch file.
    Remember to modify the schedulerConfigLocation paramter to match each of the schedulers.
    -DschedulerConfigLocation="C:\Program Files (x86)\Visokio Omniscope\service\%CONF_DIR%\config.xml"

    A dialog box saying Omniscope Scheduler is running will be displayed, press Exit.

  • edtclarke     edtclarke March 25, 2014 7:48AM
    Donald,
    I've got multiple schedulers up and running in 2.8 b1235 on our dev box and am logging to separate files but have noticed an error in both logs:

    ERROR: Unable to start legacy Generator service
    Network error
    A network error has occurred. Please check your connection and try again.

    Address already in use: JVM_Bind



    Unable to start legacy Generator service: Port 8301 unavailable for EntServer
    Should I be seeing this or have I got something wrong?

    Thanks,
    Ed
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  • edtclarke     edtclarke March 25, 2014 7:51AM
    I should probably add that the schedulers are both processing XML
    Atheon Analytics Ltd
    w: www.atheonanalytics.com
    e: ed.crawford@atheon.co.uk
    t: +44 8444 145501
    m: +44 7789 393 087
    s: edtclarke
  •     donald March 25, 2014 11:02AM
    Can you email us a copy of the script you are using to start the schedulers and the config.xml for both schedulers.
    We want to check that they are using different ports.

  •     donald March 25, 2014 3:05PM
    You can ignore this error message when manually running two schedulers with different config files that are correctly configured with different ports.

    The message is from the checks when running a single scheduler as a service to detect the console for managing the scheduler and is not applicable in this case.

    2014.03.25 18:45:21.216 ERROR: Unable to start legacy Generator service

    Network error
    A network error has occurred. Please check your connection and try again.
    Address already in use: JVM_Bind

    Unable to start legacy Generator service: Port 8301 unavailable for EntServer
  •     steve December 21, 2015 11:06AM
    Update: from Omniscope 2.9 Plus you can enable concurrent scheduler task execution and avoid needing to have the separate configs and BAT files described above.
    See http://forums.visokio.com/discussion/2867/scheduler-concurrent-task-execution

    Also, from 3.0, the BAT file to launch Omniscope Server with a parameterised config.xml location should be changed to use the EXE directly. This is a much shorter command. For example:

    SET CONF_DIR=%1
    "C:\Users\YOUR_NAME\AppData\Local\Visokio Omniscope app\OmniscopeEnterprise.exe" "/jvmarg=-DschedulerConfigLocation=C:\PATH\TO\FOLDER\%CONF_DIR%\config.xml" "/jvmarg2=-DserverLogFilename=C:\PATH\TO\SOME\OTHER\FOLDER\log_%CONF_DIR%.txt"