Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
linenumberstrue
PS > $js = Connect-JS -Url http://localhost:4446 -AskForCredentials -Id some-jobscheduler-id
PS > $js.Masters | Where-Object { $_.jobschedulerId -eq $js.JobSchedulerId -and $_.state.severity -eq 0 }Get-JSMasterCluster -Active

clusterType    : @{_type=PASSIVE; precedence=0}
host           : apmacwin
jobschedulerId : apmacwin_4444
port           : 40444
startedAt      : 06.08.2020 06:19:45
state          : @{_text=RUNNING; severity=0}
surveyDate     : 10.08.2020 17:05:22
url            : http://apmacwin:40444

...

  • Line 1: The Connect-JS cmdlet connects to JOC Cockpit at the given URL and pre-selects the Master cluster specified with the value of the -Id parameter.
  • Line 2: The return value of the Connect-JS cmdlet includes an array of Master instances that are connected to the given JOC Cockpit instance. This return value is piped to the Where-Object cmdlet to identify the currently active MasterGet-JSMasterCluster cmdlet is used with the -Active parameter to return the currently active instance only. The result object includes information such as the URL and state of the active Master.The output of line 2 includes the active Master that is identified by the same JobScheduler ID that was specified for Connect-JS and by the attribute severity=0.