Versions Compared

Key

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

...

Code Block
languagebash
titleExample for use of Agent Installation Script
./js7_install_agent.sh \
    --release=2.5.2 \ 
    --home=/opt/sos-berlin.com/js7/agent \
    --data=/var/sos-berlin.com/js7/agent \
    --http-port=4445 \
    --make-dirs

# 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

...

side-by-side Agent

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarballhome=/tmp/opt/sos-berlin.com/js7_agent_unix.2.5.2.tar.gz/agent \
    --homedata=/homevar/sos-berlin.com/js7/agent_44445 \
      --http-port=444544445 \
 
     --exec-start=StartService make-dirs \
    --exec-stop=StopService \
    --make-service \
    --make-dirs

# downloads the release tarball from the SOS Web Site using curl
# extracts the tarball to the Agent's home directory
# creates the Agent's systemd service
# stops and starts the Agent's systemd serviceuse-install

# makes use of an existing Agent installation in the home directory
# creates the data directory if it does not exist
# populates the data directory from initial configuration files
# operates the Agent for HTTP port 444544445

Install or Update and Stop/Start using

...

systemd

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
     --home=/home/sos/agent \
      --http-port=4445 \ 
      --exec-start="/home/sos/agent/bin/agent_4445.sh start"StartService \
    --exec-stop=StopService \
    --exec-stop="/home/sos/agent/bin/agent_4445.sh stop"make-service \
    --make-dirs

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

Install or Update and Stop/Start using

...

Individual Commands

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
     --home=/home/sos/agent \
    --http-port=4445 \
     --restartexec-start="/home/sos/agent/bin/agent_4445.sh start" \
    --make-dirs

# exec-stop="/home/sos/agent/bin/agent_4445.sh stop" \
    --make-dirs

# downloads the release tarball from the SOS Web Site using curl
# extracts the tarball to the Agent's home directory
# stops and starts the Agent fromby its instance start script <home>/bin/agent_4445.shindividual commands
# operates the Agent for HTTP port 4445

Install or Update

...

and Stop/Start using Instance Start Script

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
      --home=/home/sos/agent \
    --http-port=4445 \
     --java-home=/opt/java/jdk-11.0.2+9 \
    --java-options="-Xmx512m -Xms256m" \
    --restart \
    --make-dirs

# downloads the release tarball from the SOS Web Site using curl
# extracts the tarball to the Agent's home directory
# stops specifiesand starts the JavaAgent versionfrom andits Javainstance optionsstart to be used
# stops and starts the Agent from its instance start script <home>script <home>/bin/agent_4445.sh
# operates the Agent for HTTP port 4445

Install or Update

...

using Java Home and Java Options

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz
retval=/tmp/js7_install_agent.$$.tmp

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
      --home=/home/sos/agent \
    --http-port=4445 \
    --backupjava-dirhome=/opt/tmp/backupsjava/jdk-11.0.2+9 \
    --logjava-dir=/tmp/logsoptions="-Xmx512m -Xms256m" \
    --return-values=$retvalrestart \
    --exec-start=StartService \
    --exec-stop=StopService \
    --make-service \
    --make-dirs

log_file=$(cat $retval | grep "log_file" | cut -d'=' -f2)
backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)

# downloads the release tarball from the SOS Web Site using curl
# creates a backup archive and log file
# extracts the tarball to the Agent's home directory
# stops and starts the Agent from its systemd service
# provides return values from a temporary file which includes the path to the log file and to the backup archive
# operates the Agent make-dirs

# downloads the release tarball from the SOS Web Site using curl
# 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 with

...

Return Values

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz
retval=/tmp/js7_install_agent.$$.tmp

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
    --home=/home/sos/agent \
    --http-port=4445 \
      --backup-dir=/tmp/backups \
    --log-dir=/tmp/logs \
    --return-values=$retval \
    --restartexec-start=StartService \
    --showexec-logsstop=StopService \
    --make-dirsservice \
 || ( backup  --make-dirs

log_file=$(cat $retval | grep "backuplog_file" | cut -d'=' -f2 ) \
      && ( test -e "$backup" ) && \
      ./js7_install_agent.sh \
          --tarball=$backup \
          --home=/home/sos/agent \
          --http-port=4445 \
          --log-dir=/tmp/logs \
          --restart \
          --show-logs )

log_file=$(cat $retval | grep "log_file" | cut -d'=' -f2)
backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)

# downloads the release tarball from the SOS Web Site using curl
# creates a backup archive and log file
# extracts the tarball to the Agent's home directory
# reverts the installation from a backup archive in case of failure
# stops and starts the Agent from its instance start script <home>/bin/agent_4445.sh
# displays log output on termination of the script

Install or Update and Apply Certificates for HTTPS Connections


backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)

# downloads the release tarball from the SOS Web Site using curl
# creates a backup archive and log file
# extracts the tarball to the Agent's home directory
# stops and starts the Agent from its systemd service
# provides return values from a temporary file which includes the path to the log file and to the backup archive
# operates the Agent for HTTP port 4445

Install or Update with Fallback

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz
retval=/tmp/js7_install_agent.$$.tmp

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz \
    --home=/home/sos/agent \
    --http-port=4445 \
    --backup-dir=/tmp/backups \
    --log-dir=/tmp/logs \
    --return-values=$retval \
    --restart \
    --show-logs \
    --make-dirs
 || ( backup=$(cat $retval | grep "backup_file" | cut -d'=' -f2 ) \
      && ( test -e "$backup" ) && \
      ./js7_install_agent.sh \
          --tarball=$backup \
      
Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz
    --home=/home/sos/agent \
      --controller-id=controller \
      --http-port=localhost:4445 \
     --https-port=batch.example.com:4445 \
    --privatelog-confdir=/home/sos/agent-deployment/private.conftmp/logs \
       --controller-primary-cert=/home/sos/agent-deployment/centostest-primary.crt   --restart \
      --controller-secondary-cert=/home/sos/agent-deployment/centostest-secondary.crt \
    --keystore=/home/sos/agent-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/agent-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start=StartService \
    --exec-stop=StopService \
    --make-service \
    --make-dirs

show-logs )

log_file=$(cat $retval | grep "log_file" | cut -d'=' -f2)
backup_file=$(cat $retval | grep "backup_file" | cut -d'=' -f2)

# downloads the release tarball from the SOS Web Site using curl
# creates a backup archive and log file
# extracts the tarball to the Agent's home directory
# specifiesreverts the Controllerinstallation IDfrom ofa thebackup Controllerarchive toin whichcase the Agent is dedicated
of failure
# specifiesstops HTTPand portstarts 4445the onAgent thefrom localhostits networkinstance interfacestart and the same HTTPS portscript <home>/bin/agent_4445.sh
# displays log output on thetermination 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 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.

...

of the script

Install or Update and Apply Certificates for HTTPS Connections

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.2.tar.gz' -o /tmp/js7_agent_unix.2.5.2.tar.gz

./js7_install_agent.sh \
    --tarball=/tmp/js7_agent_unix.2.5.2.tar.gz
    --home=/home/sos/agent \
    --controller-id=controller \
    --http-port=localhost:4445 \
    --https-port=batch.example.com:4445 \
    --private-conf=/home/sos/agent-deployment/private.conf \
    --controller-primary-cert=/home/sos/agent-deployment/centostest-primary.crt \
    --controller-secondary-cert=/home/sos/agent-deployment/centostest-secondary.crt \
    --keystore=/home/sos/agent-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/agent-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start=StartService \
    --exec-stop=StopService \
    --make-service \
    --make-dirs

# downloads the release tarball from the SOS Web Site using curl
# 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 --controller-secondary-cert 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
languagebash
titleExample for use of Agent Installation Script
./js7_install_agent.sh \
    --home=/home/sos/agent \
    --controller-id=controller \
    --http-port=localhost:4445 \
    --https-port=batch.example.com:4445 \
    --private-conf=/home/sos/agent-deployment/private.conf \
    --controller-primary-cert=/home/sos/agent-deployment/centostest-primary.crt \
    --controller-secondary-cert=/home/sos/agent-deployment/centostest-secondary.crt \ 
    --keystore=/home/sos/agent-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/agent-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start=StartService \
    --exec-stop=StopService \
    --no-install

# 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

Patch from Download

Code Block
languagebash
titleExample for use of Agent Installation Script
./js7_install_agent.sh \
    --home=/home/sos/agent \
    --controller-id=controller \
    --http-port=localhost:4445 \
    --https-port=batch.example.com:4445release=2.2.3 \
    --private-conf=/home/sos/agent-deployment/private.confpatch=JS-1984 \
    --controller-primary-certhome=/home/sos/agent-deployment/centostest-primary.crt \
    --http-port=4445 \
    --controllerexec-secondary-cert=/home/sos/agent-deployment/centostest-secondary.crt \ start=StartService \
    --exec-keystore=/home/sos/agent-deployment/https-keystore.p12 \
    --keystore-password="jobscheduler" \
    --truststore=/home/sos/agent-deployment/https-truststore.p12 \
    --truststore-password="jobscheduler" \
    --exec-start=StartService stop=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 from Tarball

Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.2/js7_agent_unix.2.2.3.JS-1984.tar.gz' -o /tmp/js7_agent_unix.2.2.3.JS-1984.tar.gz

./js7_install_agent.sh \
    --exec-stop=StopService \
    --no-install

# 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 filestarball=/tmp/js7_agent_unix.2.2.3.JS-1984.tar.gz \
    --patch=JS-1984 \
    --home=/home/sos/agent \
    --http-port=4445 \
    --exec-start=StartService \
    --exec-stop=StopService

# downloads the patch tarball from the SOS Web Site using curl
# 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 systemd service

...

Uninstall

Code Block
languagebash
titleExample for use of Agent Installation Script
./js7_install_agent.sh \
    --release=2.2.3 \
    --patch=JS-1984 \
    --home=/home/sos/agent \
    --http-port=4445 \
    --exec-start=StartService \
    --exec-stop=StopService
 
# downloads the patch tarball from the SOS Web Site 
# extracts the patch tarball to \
    --uninstall

# stops the Agent's homesystemd directoryservice
# storesremoves the patch files to the Agent's <home>/lib/patches sub-directorysystemd service
# stops and startsremoves the Agent's systemd service

Patch from Tarball

home and data directories

Uninstall and Preserve Home Directory

Code Block
languagebash
titleExample for use of Agent Installation Script
Code Block
languagebash
titleExample for use of Agent Installation Script
curl 'https://download.sos-berlin.com/JobScheduler.2.2/js7_agent_unix.2.2.3.JS-1984.tar.gz' -o /tmp/js7_agent_unix.2.2.3.JS-1984.tar.gz

./js7_install_agent.sh \
    --tarballhome=/tmp/opt/sos-berlin.com/js7_agent_unix.2.2.3.JS-1984.tar.gz/agent \
    --patch=JS-1984 \
    --homedata=/homevar/sos-berlin.com/js7/agent \
      --http-port=4445 \
    --exec-startstop=StartServiceStopService \
    --execuninstall-stop=StopServicedata

# downloadsstops the patchAgent's tarball from the SOS Web Site using curlsystemd service
# extractsremoves the Agent's patchsystemd tarballservice
# toremoves the Agent's homedata directory
# stores patch files to preserves the Agent's <home>/lib/patches sub-directory
# stops and starts the Agent's systemd service

...

home directory that might be used by additional Agents installed side-by-side

Uninstall and Preserve Data Directory

Code Block
languagebash
titleExample for use of Agent Installation Script
./js7_install_agent.sh \
    --home=/homeopt/sos-berlin.com/js7/agent \
    --data=/var/sos-berlin.com/js7/agent \
    --http-port=4445 \
    --exec-stop=StopService \
    --uninstall-home

# stops the Agent's systemd service
# uninstallsremoves the Agent and's systemd service
# removes the Agent's home and directory
# preserves the Agent's data directoriesdirectory

Anchor
replacements
replacements
Replacements

...