Versions Compared

Key

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

...

Install and Update

Install Agent for Unix

Install or Update from Download

Code Block
languagepowershell
titleExample for use of Installation Script
#!/usr/bin/env pwsh

./Install-JS7Agent.ps1 `
    -HomeDir /opt/sos-berlin.com/js7/agentRelease 2.5.2 `
    -DataHomeDir /varhome/sos-berlin.com/js7/agent `
    -Tarball /mnt/releases/scheduler_setups/current/js7_agent_unix.2.5.2.tar.gz `
    -HttpPort 4445 `
    -ExecStart StartService `
    -ExecStop StopService `
    -MakeService `
    -JavaHome "/opt/java/jdk-11.0.2+9" `
    -MakeDirs

# Installs the Agent from the indicated tarball
# OperatesHttpPort 4445 `
    -MakeDirs

# downloads the release tarball from the SOS Web Site
# creates the home directory if it does not exist
# extracts the tarball to the Agent's home directory
# operates the Agent for HTTP port 4445 running in the current user account
# Specifies Java from the given location
# Creates the Agent's systemd service

Install Agent for Windows

Install or Update from Tarball

...

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
   Invoke-WebRequest -HomeDirUri "C:\Program Files\'https://download.sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445"/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball "C:\js7\downloads\/tmp/js7_agent_windowsunix.2.5.2.tar.zip"gz `
    -HttpPort 4445HomeDir /home/sos/agent `
    -ExecStartHttpPort StartService4445 `
    -ExecStop StopService `
    -MakeService `
    -ServiceCredentials ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList '.\sos', ( 'sos' | ConvertTo-SecureString -AsPlainText -Force) ) `
    -MakeDirs

# Installs the Agent from the indicated .zip archive
# Creates the Agent's Windows Service for the local account ".\sos" using the password "sos"
# There are alternative ways how to avoid passwords from being specified in plain text
# Stops the Agent's Windows Service before installation and starts the service after installation

Install Agent for HTTPS Connections

MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# creates the home directory if it does not exist
# extracts the tarball to the Agent's home directory
# operates the Agent for HTTP port 4445

Install or Update using separate Home and Data Directories

Code Block
titleExample for use of Agent Installation Script
linenumberstrue
./Install-JS7Agent.ps1 `
    -Release 2.5.2 `
    -HomeDir /opt/sos-berlin.com/js7/agent `
    -Data /var/sos-berlin.com/js7/agent `
    -HttpPort 4445 `
    -MakeDirs

# downloads the release tarball from the SOS Web Site  
# suggests use of separate home and data directories for configuration data, log data etc.
# creates the home and data directories if they do not exist
# extracts the tarball to the Agent's home directory
# populates the data directory from initial configuration files
# operates the Agent for HTTP port 4445

Install or Update and Stop/Start using systemd

Code Block
titleExample for use of Agent Installation Script
linenumberstrue
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1
Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445" `
    -Tarball "C:\js7\downloads\js7_agent_windows.2.5.2.zip" `
    -HttpPort localhost:4445 `
    -HttpsPort 44453 `
    -PrivateConf "C:\js7\templates\private.conf-template-agent" `
    -ControllerPrimaryCert "C:\js7\certs\wintest-primary-controller.crt"Tarball /tmp/js7_agent_unix.2.5.2.tar.gz `
    -Keystore "C:\js7\keys\https-keystore.pfx"HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -KeystorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force)ExecStart StartService `
    -KeyAlias "wintest-primary-agent"ExecStop StopService ` 
    -Truststore "C:\js7\certs\https-truststore.pfx"-MakeService `
    -TruststorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) ` 
    -ExecStart StartService `
    -ExecStop StopService `
    -MakeService `
    -MakeDirs

# Install the Agent from the indicated tarball
# Limits the HTTP port to the localhost network interface, make the HTTPS port available for any network interfaces
# Applies a template file for SSL/TLS related settings that is automatically updated from arguments to the installation script
# Specifies the server certificate location of the Controller to which the Agent is dedicated
# Makes use of a keystore in PKCS12 format with the given alias name and password and a truststore respectively

Find an example for a private.conf template file for download: private.conf-template-agent

Patch

Patch Agent for Linux

...

MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# creates the Agent's systemd service
# stops and starts the Agent's systemd service
# operates the Agent for HTTP port 4445

Install or Update and Stop/Start using Individual Commands

Code Block
titleExample for use of Agent Installation Script
linenumberstrue
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball /tmp/js7_agent_unix.2.5.2.tar.gz `
    -HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -ExecStart "/home/sos/agent/bin/agent_4445.sh start" `
    -ExecStop "/home/sos/agent/bin/agent_4445.sh stop" `
    -MakeService `
    -MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# creates the Agent's systemd service
# stops and starts the Agent by individual commands
# operates the Agent for HTTP port 4445

Install or Update and Stop/Start using Instance Start Script

Code Block
titleExample for use of Agent Installation Script
linenumberstrue
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball /tmp/js7_agent_unix.2.5.2.tar.gz `
    -HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -Restart `
    -MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# creates the Agent's systemd service
# stops and starts the Agent from its instance start script <home>/bin/agent_4445.sh
# operates the Agent for HTTP port 4445

Install or Update using Java Home and Java Options

Code Block
titleExample for use of Agent Installation Script
linenumberstrue
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball /tmp/js7_agent_unix.2.5.2.tar.gz `
    -HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -JavaHome /opt/java/jdk-11.0.2+9 `
    -JavaOptions "-Xmx512m -Xms256m" `
    -Restart `
    -MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# specifies the Java version and Java options to be used
# stops and starts the Agent from its instance start script <home>/bin/agent_4445.sh
# operates the Agent for HTTP port 4445

Install or Update and Apply Certificates for HTTPS Connections

Code Block
languagepowershell
titleExample for use of Installation Script
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -Outfile /tmp/js7_agent_unix.2.5.2.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball /tmp/js7_agent_unix.2.5.2.tar.gz `
    -HomeDir /home/sos/agent `
    -ControllerId controller `
    -HttpPort localhost:4445 `
    -HttpsPort batch.exaple.com:4445`
    -PrivateConf /home/sos/agent-deployment/private.conf `
    -ControllerPrimaryCert /home/sos/agent-deployment/centostest-primary.crt `
    -ControllerSecondaryCert /home/sos/agent-deployment/centostest-secondary.crt `
    -Keystore /home/sos/agent-deployment/https-keystore.p12 `
    -KeystorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) `
    -Truststore /home/sos/agent-deployment/https-truststore.p12 `
    -TruststorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) ` 
    -ExecStart StartService `
    -ExecStop StopService `
    -MakeService `
    -MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# specifies the Controller ID of the Controller to which the Agent is dedicated
# specifies HTTP port 4445 on the localhost network interface and the same HTTPS port on the server network interface
# specifies the paths to the Primary and Secondary Controller's server certificates if a Controller Cluster is used
#     for a Standalone Controller the -ControllerSecondaryCert argument is omitted
# deploys the Agent private configuration file which holds references to keystore and truststore
# deploys keystore and truststore files
# stops and starts the Agent's systemd service

Note:

  • For details about certificates and HTTPS connections see JS7 - Agent HTTPS Connections.
  • The private.conf configuration file holds references to the Controller's certificate in order to verify the connection from the Controller using HTTPS mutual authentication.
  • Users have a choice how to provide the required configuration:
    • The Agent Installation Script performs replacements of placeholders in the private.conf configuration file from option values, for details see chapter Replacements.
    • Users can manually adjust configuration items in the private.conf file that they specify for the Agent Installation Script., see JS7 - Controller Configuration Items.

Renew Certificates for HTTPS Connections

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -HomeDir /home/sos/agent `
    -ControllerId controller `
    -HttpPort localhost:4445 `
    -HttpsPort batch.exaple.com:4445`
    -PrivateConf /home/sos/agent-deployment/private.conf `
    -ControllerPrimaryCert /home/sos/agent-deployment/centostest-primary.crt `
    -ControllerSecondaryCert /home/sos/agent-deployment/centostest-secondary.crt `
    -Keystore /home/sos/agent-deployment/https-keystore.p12 `
    -KeystorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) `
    -Truststore /home/sos/agent-deployment/https-truststore.p12 `
    -TruststorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) ` 
    -ExecStart StartService `
    -ExecStop StopService `
    -NoInstall

# performs no installation but certificate renewal only
# specifies the Controller ID of the Controller to which the Agent is dedicated
# addresses an existing Agent operated for HTTP port 4445 on the localhost network interface and the same HTTPS port on the server network interface
# specifies the paths to the Primary and Secondary Controller's server certificates if a Controller Cluster is used
#     for a Standalone Controller the -controller-secondary-cert argument is omitted
# deploys the Agent private configuration file that holds references to keystore and truststore
# deploys keystore and truststore files
# stops and starts the Agent's systemd service

Install Agent for Windows

Install Agent for HTTP Connections

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445" `
    -Tarball "C:\js7\downloads\js7_agent_windows.2.5.2.zip" `
    -HttpPort 4445 `
    -ExecStart StartService `
    -ExecStop StopService `
    -MakeService `
    -ServiceCredentials ( New-Object -typename System.Management.Automation.PSCredential -ArgumentList '.\sos', ( 'sos' | ConvertTo-SecureString -AsPlainText -Force) ) `
    -MakeDirs

# Installs the Agent from the indicated .zip archive
# Creates the Agent's Windows Service for the local account ".\sos" using the password "sos"
# There are alternative ways how to avoid passwords from being specified in plain text
# Stops the Agent's Windows Service before installation and starts the service after installation

Install or Update and Apply Certificates for HTTPS Connections

Code Block
languagepowershell
titleExample for use of Installation Script
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_windows.2.5.2.zip' -Outfile /tmp/js7_agent_windows.2.5.2.zip

./Install-JS7Agent.ps1 `
    -Tarball "C:\tmp\js7_agent_windows.2.5.2.zip" `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445" `
    -ControllerId controller `
    -HttpPort localhost:4445 `
    -HttpsPort batch.example.com:4445 `
    -PrivateConf "C:\js7\agent-deployment\private.conf" `
    -ControllerPrimaryCert "C:\js7\agent-deployment\wintest-primary.crt" `
    -ControllerSecondaryCert "C:\js7\agent-deployment\wintest-secondary.crt" `
    -Keystore "C:\js7\agent-deployment\https-keystore.pfx" `
    -KeystorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) `
    -Truststore "C:\js7\agent-deployment\https-truststore.pfx" `
    -TruststorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) ` 
    -Restart `
    -MakeService `
    -MakeDirs

# downloads the release tarball from the SOS Web Site using Invoke-WebRequest
# extracts the tarball to the Agent's home directory
# specifies the Controller ID of the Controller to which the Agent is dedicated
# specifies HTTP port 4445 on the localhost network interface and the same HTTPS port on the server network interface
# specifies the paths to the Primary and Secondary Controller's server certificates if a Controller Cluster is used
#     for a Standalone Controller the -ControllerSecondaryCert argument is omitted
# deploys the Agent private configuration file which holds references to keystore and truststore
# deploys keystore and truststore files
# stops and starts the Agent's systemd service

Note:

  • For details about certificates and HTTPS connections see JS7 - Agent HTTPS Connections.
  • The private.conf configuration file holds references to the Controller's certificate in order to verify the connection from the Controller using HTTPS mutual authentication.
  • Users have a choice how to provide the required configuration:
    • The Agent Installation Script performs replacements of placeholders in the private.conf configuration file from option values, for details see chapter Replacements.
    • Users can manually adjust configuration items in the private.conf file that they specify for the Agent Installation Script., see JS7 - Controller Configuration Items.

Renew Certificates for HTTPS Connections

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445" `
    -ControllerId controller `
    -HttpPort localhost:4445 `
    -HttpsPort batch.example.com:4445 `
    -PrivateConf "C:\js7\agent-deployment\private.conf" `
    -ControllerPrimaryCert "C:\js7\agent-deployment\wintest-primary.crt" `
    -ControllerSecondaryCert "C:\js7\agent-deployment\wintest-secondary.crt" ` 
    -Keystore "C:\js7\agent-deployment\https-keystore.pfx" `
    -KeystorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) `
    -Truststore "C:\js7\agent-deployment\https-truststore.pfx" `
    -TruststorePassword ('jobscheduler' | ConvertTo-SecureString -AsPlainText -Force) ` 
    -Restart `
    -NoInstall

# performs no installation but certificate renewal only
# specifies the Controller ID of the Controller to which the Agent is dedicated
# addresses an existing Agent operated for HTTP port 4445 on the localhost network interface and the same HTTPS port on the server network interface
# specifies the paths to the Primary and Secondary Controller's server certificates if a Controller Cluster is used
#     for a Standalone Controller the -ControllerSecondaryCert argument is omitted
# deploys the Agent private configuration file that holds references to keystore and truststore
# deploys keystore and truststore files
# stops and starts the Agent's Windows service



Patch

Patch Agent for Linux

Patch Agent from Download

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -Release 2.2.3 `
    -Patch JS-1984 `
    -HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -ExecStart StartService `
    -ExecStop StopService
 
# downloads the patch tarball from the SOS Web Site
# extracts the patch tarball to the Agent's home directory
# stores the patch files to the Agent's <home>/lib/patches sub-directory
# stops and starts the Agent's systemd Service

Patch Agent from Tarball

Code Block
languagepowershell
titleExample for use of Installation Script
#!/usr/bin/env pwsh

./Install-JS7Agent.ps1 `
    -HomeDir /opt/Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.2/js7/agent `
    -HttpPort 4445 `
    -Release _agent_windows.2.2.3.JS-1984.tar.gz' -Outfile /tmp/js7_agent_unix.2.2.3 `
    -Patch JS-1984 `
    -Restart

# Patches the Agent by downloading the indicated patch for the given release from the SOS Web Site
# Restarts the systemd service

Patch Agent from Tarball

Code Block
languagepowershell
titleExample for use of Installation Script
#!/usr/bin/env pwsh

./Install-JS7Agent.ps1 `
    -HomeDir /opt/sos-berlin.com/js7/agent `
    -HttpPort 4445 `
    -Tarball /tmp/js7_agent_unix.2.2.3.JS-1984.tar.gz  `
    -Patch JS-1984 `
    -Restart

# Patches the Agent from a previously downloaded patch tarball
# Restarts the systemd service.JS-1984.tar.gz

./Install-JS7Agent.ps1 `
    -Tarball /tmp/js7_agent_unix.2.2.3.JS-1984.tar.gz  `
    -Patch JS-1984 `
    -HomeDir /home/sos/agent `
    -HttpPort 4445 `
    -ExecStart StartService `
    -ExecStop StopService

# downloads the patch tarball from the SOS Web Site using Invoke-WebRequest
# extracts the patch tarball to the Agent's home directory
# stores the patch files to the Agent's <home>\lib\patches sub-directory
# stops and starts the Agent's systemd Service

Patch Agent for Windows

Patch Agent from Download

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1.ps1 `
    -Release 2.2.3 `
    -Patch JS-1984 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -HttpPort 4445 `
    -Release 2.2.3 `
    -Patch JS-1984 `
    -Restart

# Patches the Agent by downloading the indicated patch for the given release from the SOS Web Site
# RestartsRestart

# downloads the patch tarball from the SOS Web Site
# extracts the patch tarball to the Agent's home directory
# stores the patch files to the Agent's <home>\lib\patches sub-directory
# stops and starts the Agent's Windows Service to apply the patch

Patch Agent from .zip Archive

Code Block
languagepowershell
titleExample for use of Installation ScriptExample for use of Installation Script
Invoke-WebRequest -Uri 'https://download.sos-berlin.com/JobScheduler.2.2/js7_agent_windows.2.2.3.JS-1984.zip' -Outfile C:\tmp\js7_agent_windows.2.2.3.JS-1984.zip

./Install-JS7Agent.ps1./Install-JS7Agent.ps1 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -HttpPort 4445 `
    -Tarball "C:\js7\downloadstmp\js7_agent_windows.2.2.3.JS-1984.JS-1984.zipzip" `
    -Patch JS-1984 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
      -PatchHttpPort JS-19844445 `
    -Restart

# downloads the patch tarball from the SOS Web Site using Invoke-WebRequest
# Patches the Agent using the previously downloaded .zip archive
# Restarts extracts the patch tarball to the Agent's home directory
# stores patch files to the Agent's <home>\lib\patches sub-directory
# stops and starts the Agent's Windows Service to apply the patch

Uninstall

Uninstall Agent for Linux

Code Block
languagepowershell
titleExample for use of Installation Script
#!/usr/bin/env pwsh

./Install-JS7Agent.ps1 `
    -HomeDir "/opt/sos-berlin.com/js7/agent" `
    -Data "/var/sos-berlin.com/js7/agent" `
    -HttpPort 4445 `
    -ExecStop "StopService" `
    -Uninstall

# Uninstalls the Agent using systemd to stop# stops the Agent's systemd service
# Removesremoves the Agent's systemd service
# Removesremoves the home directory and data directory

...

Code Block
languagepowershell
titleExample for use of Installation Script
./Install-JS7Agent.ps1 `
    -HomeDir "C:\Program Files\sos-berlin.com\js7\agent" `
    -Data "C:\ProgramData\sos-berlin.com\js7\agent_4445" `
    -HttpPort 4445 `
    -StopTimeoutExecStop 10StopService ` 
     -Uninstall

# Uninstallsstops the Agent's waiting for a maximum of 10s for the Agent to terminate before aborting the Agent
# Stops andWindows Service
# removes the Agent's Windows Service
# Removesremoves the home directory and data directory