Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1655

Housekeeping Job scheduler_rotate_log does not work on JobScheduler Classic Agent

    XMLWordPrintable

Details

    • Fix
    • Status: Known Issue (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 1.7.4, 1.9.11
    • 1.9.12
    • JS Classic Agent
    • None

    Description

      Current Situation

      • JobScheduler's housekeeping job /sos/housekeeping/scheduler_rotate_log does not work on JobScheduler Classic Agent properly.
        • main logs older than the parameter file_age will be compressed on the JobScheduler Classis Agent
        • main logs older than the parameter delete_file_age will be removed on the JobScheduler Classis Agent
        • the ./logs/scheduler.log will be rotated on the JobScheduler Master instead on the JobScheduler Classis Agent

      Desired Situation

      • JobScheduler's Classic Agent's main-log and debug-log should be rotated from JobScheduler Master.

      Maintainer Note

      • The job /sos/housekeeping/scheduler_rotate_log calls the api method spooler.log().start_new_file(); which is always processed on the JobScheduler Master
      • Now, the job /sos/housekeeping/scheduler_rotate_log calls this api method only if the job doesn't have a process class in which an Agent is defined such as
            <process_classes >
                <process_class  max_processes="10" remote_scheduler="classicAgentHost:classicAgentPort"/>
            </process_classes>
        
      • If the job has been assigned to such a process class then the job does the same like on the JobScheduler Master except rotating the ./logs/scheduler.log.
      • A new command <modify_spooler cmd='rotate_logs'/> is introduced to rotate the ./logs/scheduler.log on the JobScheduler Classic Agent.
      • For this command a new job should be created
        job example to rotate scheduler.log with command on Windows
        <?xml version="1.0" encoding="ISO-8859-1"?>
        <job>
            <params >
                <param  name="agent_host" value=""/>
                <param  name="agent_port" value=""/>
            </params>
            <script  language="shell">
                <![CDATA[
        if not defined SCHEDULER_PARAM_AGENT_HOST (
            echo Parameter 'agent_host' is undefined
            exit 1
        )  
        if not defined SCHEDULER_PARAM_AGENT_PORT (
            echo Parameter 'agent_port' is undefined
            exit 1
        ) 
        set STARTSCRIPT="%SCHEDULER_HOME%\bin\jobscheduler.cmd"
        %STARTSCRIPT:/=\% command "<modify_spooler cmd='rotate_logs'/>" -ip-address=%SCHEDULER_PARAM_AGENT_HOST% -port=%SCHEDULER_PARAM_AGENT_PORT%
                ]]>
            </script>
            <run_time />
        </job>
        
        job example to rotate scheduler.log with command on Linux
        <?xml version="1.0" encoding="ISO-8859-1"?>
        <job>
            <params >
                <param  name="agent_host" value=""/>
                <param  name="agent_port" value=""/>
            </params>
            <script  language="shell">
                <![CDATA[
        if [ -z $SCHEDULER_PARAM_AGENT_HOST ]
        then
            echo "Parameter 'agent_host' is undefined"
            exit 1
        fi
        if [ -z $SCHEDULER_PARAM_AGENT_PORT ]
        then
            echo "Parameter 'agent_port' is undefined"
            exit 1
        fi
        "$SCHEDULER_HOME/bin/jobscheduler.sh" command "<modify_spooler cmd='rotate_logs'/>" -ip-address=$SCHEDULER_PARAM_AGENT_HOST -port=$SCHEDULER_PARAM_AGENT_PORT
                ]]>
            </script>
            <run_time />
        </job>
        

      Workaround

      • Download attached job depending upon your operating system, rotateSchedulerLogOnClassicAgentForLinux.job.xml.zip for Linux JobScheudler Classic Agent or rotateSchedulerLogOnClassicAgentForWindows.job.xml.zip for windows JobScheudler Classic Agent.
      • Deploy the job on JobScheduler master in /sos/housekeeping/ folder, to execut the job on JobScheduler Classic Agent configure the job parameters, host and port parameters where host/port are corresponding host and port of the JobScheduler Classic Agent.
      • To execute the rotateSchedulerLogOnClassicAgentFor Job, periodically configure a run_time in the job. The Job will be deployed on the JobScheduler Master but

      Attachments

        Activity

          People

            jz Joacim Zschimmer
            mp Mahendra Patidar
            Mahendra Patidar Mahendra Patidar
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: