Versions Compared

Key

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

Table of Contents

Introduction

For JS7 - Automated Deployment On Premises use of a Deployment Area is recommended.

...

  • archive (holds Deployment Packages)
    • <deployment-descriptor> (specifies the Deployment Descriptor)
      • agents (holds Agent Deployment Packages)
        • <agent-id>(directory for a specific Agent identified by its Agent ID)
          • js7_deploy_agent_unix.<agent-id>.<release>.config.tar.gz (tarball for the Agent's configuration directory)
          • js7_deploy_agent_unix.<agent-id>.<release>.install.tar.gz (tarball for the Agent's installation directory)
          • run_deploy_agent.sh (Deployment Script for execution on the target host)
          • run_install_agent.sh (wrapper script for the parameterized call to the js7_install_agent.sh Installer Script)
          • run_rollout_agent.sh (Rollout Script for transfer of tarballs and Deployment Script to the target host)
        • <agent-id>(directory for a specific Agent identified by its Agent ID)
        • ...
      • controllers (holds Controller Deployment Packages)
        • <controller-id> (directory for a specific Controller identified by its Controller ID)
          • <instance-type> (specifies the type of the Controller instance which is primary or secondary
            • js7_deploy_controller_unix.<controller-id>.<instance-type>.<release>.config.tar.gz (tarball for the Controller instance's configuration directory)
            • js7_deploy_controller_unix.<controller-id>.<instance-type>.<release>.install.tar.gz (tarball for the Controller instance's installation directory)
            • run_deploy_controller.sh (Deployment Script for execution on the target host)
            • run_install_controller.sh (Wrapper Script for the parameterized call to the js7_install_controller.sh Installer Script)
            • run_rollout_controller.sh (Rollout Script for transfer of tarballs and Deployment Script to the target host)
          • <instance-type> (specifies the type of the Controller instance which is primary or secondary
        • <controller-id> (directory for a specific Controller identified by its Controller ID)
        • ...
      • joc (holds JOC Cockpit Deployment Packages)
        • <joc-id>(directory for a specific JOC Cockpit identified by its Cockpit ID)
          • <instance-type> (specifies the type of the JOC Cockpit instance which is primary or secondary
            • js7_deploy_joc_linux.<joc-id>.<instance-type>.<release>.config.tar.gz (tarball for the JOC Cockpit instance's configuration directory)
            • js7_deploy_joc_linux.<joc-id>.<instance-type>.<release>.install.tar.gz (tarball for the JOC Cockpit instance's installation directory)
            • run_deploy_joc.sh (Deployment Script for execution on the target host)
            • run_install_joc.sh (Wrapper Script for the parameterized call to the js7_install_joc.sh Installer Script.
            • run_rollout_joc.sh (Rollout Script for transfer of tarballs and Deployment Script to the target host)
          • <instance-type> (specifies the type of the JOC Cockpit instance which is primary or secondary
        • <joc-id>(directory for a specific JOC Cockpit identified by its JOC Cockpit ID)
        • ...
      • js7_import_tar.gz (holds the Deployment Workflow for import to JS7 JOC Cockpit, see JS7 - Deployment Workflow)
      • run_deploy.sh (Wrapper Script to run all run_deploy_*.sh Deployment Scripts for Agent, Controller and JOC Cockpit instances in the same Deployment Descriptor)
    • <deployment-descriptor> (specifies the Deployment Descriptor)
    • ...
  • bin (holds executable files, preferably individual scripts, Deployment Scripts and Installer Scripts available from JS7 - Download)
  • ca  (holds the Certificate Authority as explained from  JS7 - How to create self-signed Certificates, not used if an external Certificate Authority is in place)
    • certs (holds self-signed certificates)
    • csr (holds Certificate Signing Requests)
    • private (holds Private Keys)
  • config (holds configuration files)
    • agents (holds Agent configuration files)
      • instances (holds configuration files specific for an Agent in a user environment)
        • <agent-id>(specifies the Agent ID for directories and files that are specific to an Agent)
          • config (general configuration)
            • private (specific configuration)
              • https-keystore.p12 (default location and file name of a PKCS12 keystore holding the Agent's private key and certificate)
              • https-truststore.p12 (default location and file name of a PKCS12 truststore holding the Root CA Certificate)
        • <agent-id>(specifies the Agent ID for directories and files that are specific to an Agent)
        • ...
      • templates (holds configuration files that ship as templates for a number of Agents)
        • <template-name> (an arbitrary directory name for templates can be used)
        • <template-name> (an arbitrary directory name for templates can be used)
        • ...
    • controllers (holds Controller configuration files)
      • instances (holds configuration files specific for Controller instances in a user environment)
        • <controller-id>.<controller-type>(specifies the Controller ID for directories and files that are specific to a Controller instance with the instance type being primary or secondary)
          • config (general configuration)
            • private (specific configuration)
              • <controller-cert> (the Controller instance's server authentication certificate)
              • https-keystore.p12 (default location and file name of a PKCS12 keystore holding the Controller instance's private key and certificate)
              • https-truststore.p12 (default location and file name of a PKCS12 truststore holding the Root CA Certificate)
        • <controller-id>.<controller-type>(specifies the Controller ID for directories and files that are specific to a Controller)
        • ...
      • templates (holds configuration files that ship as templates for a number of Controllers)
        • <template-name> (an arbitrary directory name for templates can be used)
        • <template-name> (an arbitrary directory name for templates can be used)
        • ...
    • joc  (holds JOC Cockpit configuration files)
      • instances (holds configuration files that are specific for JOC Cockpit instance in a user environment)
        • <joc-id>.<instance-type> (holds configuration files for a JOC Cockpit instance with the instance type being primary or secondary)
          • resources (optionally holds configuration files such as the joc.properties file, keystore, truststore files etc.)
          • response (optionally holds response files, mainly the joc_install.xml response file, that will be copied to the JOC Cockpit's setup directory)
        • <joc-id>.<instance-type> (holds configuration files for a JOC Cockpit instance with the instance type being primary or secondary)
        • ...
      • templates (holds configuration files that ship as templates for a number of JOC Cockpit instances)
        • dbms (holds sample response files per supported DBMS, mainly the joc_install.xml response file and hibernate.cfg.xml file that will be copied to the JOC Cockpit's setup directory)
          • h2 (H2®)
          • mariadb (MariaDB®)
          • mssql (SQL Server®)
          • mysql (MySQL®)
          • oracle (Oracle®)
          • pgsql (PostgreSQL®)
        • http (holds sample configuration files for use with HTTP connections)
          • resources (holds configuration files such as the joc.properties file)
          • start.d (holds configuration files such as http.ini, https.ini, ssl.ini)
        • https (holds sample configuration files for use with HTTPS connections)
          • resources (holds configuration files such as the joc.properties file with keystore and truststore settings)
          • start.d (holds configuration files such as http.ini, https.ini, ssl.ini)
        • <template-name> (an arbitrary directory name for templates can be used)
        • ...
    • licenses (optionally holds files related to JS7 licenses in a user environment)
  • desc (holds Deployment Descriptors)
    • standalone (holds sample files related to Standalone instances of JS7 Agents, Controller, JOC Cockpit)
    • cluster (holds sample files related to Cluster instances of JS7 Agents, Controller, JOC Cockpit)
    • <deployment-descriptor>.json (Deployment Descriptor .json file specific for a user environment)
    • <deployment-descriptor>.json (Deployment Descriptor .json file specific for a user environment)
    • ...
  • logs (optionally holds log files)
    • deployment_package.<deployment-descriptor>.<host>.<timestamp>.log (Packaging Script log files)
    • install_js7_agent.<host>.<timestamp>.log (Agent Installer log files)
    • install_js7_controller.<host>.<timestamp>.log (Controller Installer log files)
    • install_js7_joc.<host>.<timestamp>.log (JOC Cockpit Installer log files)
  • release  (holds the installation tarballs of JS7 releases)
    • ... (users can apply an arbitrary directory hierarchy at this level)
      • js7_agent_unix.<release>.tar.gz (JS7 Agent installation tarball as download from the SOS Web Site)
      • js7_controller_unix.<release>.tar.gz (JS7 Controller installation tarball as download from the SOS Web Site)
      • js7_joc_linux.<release>.tar.gz (JS7 JOC Cockpit installation tarball as download from the SOS Web Site)
  • work (the working area is preferably used to perform installation of JS7 components during packaging)
    • agents (directory for Agent installation during packaging)
      • <agent-id>(specifies the Agent ID for directories and files that are specific to an Agent)
        • ... (sub-directories used for Agent installation)
      • <agent-id>(specifies the Agent ID for directories and files that are specific to an Agent)
      • ...
    • controllers (directory for Controller installation during packaging)
      • <controller-id>(specifies the Controller ID for directories and files that are specific to a Controller)
        • ... (sub-directories used for Controller installation)
      • <controller-id>(specifies the Controller ID for directories and files that are specific to a Controller)
      • ...
    • tmp (temporary files are written to this directory, if the --keep-work switch is used when invoking the JS7 - Deployment Packaging then files will remain in this directory which suggests cleanup by the user)
  • env.sh (Environment Script, see next chapter)

...

The Installer Wrapper Scripts are created by the JS7 - Deployment Packaging Script to parameterize calls to the Installer Scripts. The scripts are generated by the Packaging Script.

An example of a Wrapper Script for installation of an Agent using HTTPS connections looks like this:

...

Anchor
deployment_scripts
deployment_scripts
Deployment Scripts: run_deploy_agent.sh, run_deploy_controller.sh, run_deploy_joc.sh

The Deployment Scripts are created by the JS7 - Deployment Packaging Script. The scripts are called by Rollout Scripts on target hosts to extract the respective tarballs. The parameterization is created from the Deployment Descriptor.

Code Block
titleExample for Deployment Script run_deploy_agent.sh
linenumberstrue
collapsetrue
#!/bin/sh

set -e

force_sudo="0"
if [ $(id -u) -eq 0 ]
then
    use_sudo=""
else
    use_sudo="sudo"
fi

systemd_service_dir="/usr/lib/systemd/system"
systemd_service_name="js7_agent_31445.service"

...

Log  Log ".. executing pre-extraction command: StopService"
StopService

if [ -d "/opt/sos-berlin.com/js7/agent-primary" ]
then
    Log ".. removing home directory: /opt/sos-berlin.com/js7/agent-primary"
    if [ "${force_sudo}" -eq 0 ] && [ -w "/opt/sos-berlin.com/js7/agent-primary" ]
    then
        rm -f -r "/opt/sos-berlin.com/js7/agent-primary"
    else
        ${use_sudo} rm -f -r "/opt/sos-berlin.com/js7/agent-primary"
    fi
fi

if [ ! -d "/opt/sos-berlin.com/js7" ]
then
    Log ".. creating parent home directory: /opt/sos-berlin.com/js7"
    if [ "${force_sudo}" -eq 0 ] && [ -w "/opt/sos-berlin.com" ]
    then
        mkdir -p "/opt/sos-berlin.com/js7"
    else
        ${use_sudo} mkdir -p "/opt/sos-berlin.com/js7"
    fi

    if [ "${force_sudo}" -eq 1 ] || [ ! -w "/opt/sos-berlin.com" ]
    then
        Log ".. owning parent home directory to: sos"
        ${use_sudo} chown -R sos "/opt/sos-berlin.com/js7"
    fi
fi

Log ".. extracting tarball into home directory: /opt/sos-berlin.com/js7"
cd "/opt/sos-berlin.com/js7" > /dev/null

Log ".. extracting tarball: js7_deploy_agent_unix.agent_001.2.5.1.install.tar.gz"
test -if [ "${force_sudo}" -eq 1 ]
then
    test -e "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.install.tar.gz" && gzip -c -d < "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.install.tar.gz" | ${use_sudo} tar -xf -
rc=$?
cd - > /dev/null

if [ ! -d "/var/sos-berlin.com/js7" ]
then
    Log ".. creating parent data directory: /var/sos-berlin.com/js7"
    if [ -w "/var/sos-berlin.com" ]
    then
        mkdir -pelse
    test -e "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.install.tar.gz" && gzip -c -d < "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.install.tar.gz" | tar -xf -
fi
rc=$?
cd - > /dev/null

if [ ! -d "/var/sos-berlin.com/js7"
    else ]
then
    Log ".. creating  ${use_sudo} mkdir -p "parent data directory: /var/sos-berlin.com/js7"
    fi

    if [ ! if [ "${force_sudo}" -eq 0 ] && [ -w "/var/sos-berlin.com" ]
    then
        mkdir Log-p ".. owning parent data directory to: sos"/var/sos-berlin.com/js7"
    else
        ${use_sudo} chownmkdir -Rp sos "/var/sos-berlin.com/js7"
    fi
else
    if [ -d "/var/sos-berlin.com/js7/agent-primary" ]
    then
        if  "${force_sudo}" -eq 1 ] || [ ! -w "/var/sos-berlin.com/js7/agent-primary" ]
    then
    then
             Log ".. owning parent data directory to: sos"
            ${use_sudo} chown -R sos "/var/sos-berlin.com/js7/agent-primary"
        fi
    fi
fi

Log ".. extracting tarball in data directory: else
    if [ -d "/var/sos-berlin.com/js7/agent-primary" ]
    then
        if [ "${force_sudo}" -eq 1 ] || [ ! -w "/var/sos-berlin.com/js7/agent-primary" ]
        then
            Log ".. owning data directory to: sos"
            ${use_sudo} chown -R sos "/var/sos-berlin.com/js7/agent-primary"
        fi
    fi
fi

Log ".. extracting tarball to data directory: /var/sos-berlin.com/js7"
cd "/var/sos-berlin.com/js7" > /dev/null

Log ".. extracting tarball: js7_deploy_agent_unix.agent_001.2.5.1.config.tar.gz"
if [ "${force_sudo}" -eq 1 ]
then
    test -e "/var/sos-berlin.com/js7" > /dev/null

Log ".. extracting tarball: tmp/js7_deploy_agent_unix.agent_001.2.5.1.config.tar.gz" && gzip -c -d < "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.config.tar.gz" | ${use_sudo} tar -xf -
else
    test -e "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.config.tar.gz" && gzip -c -d < "/tmp/js7_deploy_agent_unix.agent_001.2.5.1.config.tar.gz" | tar -xf -
fi
rc=$?
cd - > /dev/null

if [ "${rc}" -eq 0 ]
then
    Log ".. owning home directory to: sos1:sos1"
    ${use_sudo} chown -R sos1:sos1 "/opt/sos-berlin.com/js7/agent-primary"
    rc=$?
fi

if [ "${rc}" -eq 0 ]
then
    Log ".. owning data directory to: sos2:sos2"
    ${use_sudo} chown -R sos2:sos2 "/var/sos-berlin.com/js7/agent-primary"
    rc=$?
fi

if [ "${rc}" -eq 0 ]
then
    Log ".. creating systemd service: js7_agent_31445.service"
    MakeService "/opt/sos-berlin.com/js7/agent-primary/bin/agent_31445.service"
    rc=$?
fi

Log ".. executing post-extraction command: StartService"
StartService

Log ".. deployment completed, return code: ${rc}"
exit ${rc}

...

...