Versions Compared

Key

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

Table of Contents

Introduction

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

...

  • to hold the script environment for JS7 - Automated Installation and Update and for JS7 - Deployment Packaging,
  • to hold the configuration files and optionally certificates for deployment of JS7 components,
  • to hold the JS7 installations per JS7 release and component such as JOC Cockpit, Controller, Agent,
  • to hold the archive of Deployment Packages per JS7 releases and target host,

As a prerequisite to managing Deployment Packages the Deployment Area has to be in place, see JS7 - Deployment - Setting up the Deployment Area.

Managing Deployment Packages

Management of Deployment Packages includes the following steps:

  • Deployment Packages are specified from a JS7 - Deployment Descriptor that holds the information which JS7 components should be installed, on which hosts to install the components and what configuration items should be used.
  • Deployment Packages are created from a script available with JS7 - Deployment Packaging.
  • Deployment Packages are transferred and extracted to target hosts. 

Creating Deployment Descriptors

The Deployment Descriptor is specified from a .json file.

Users find examples in the desc sub-directory of the Deployment Area:

Deployment Descriptors for use with Controller and JOC Cockpit Standalone Instances

Deployment Descriptors in this section are used with Standalone instances of Controller and JOC Cockpit.

...

  • js7.deploy
    • desc
      • standalone
        • standalone-agent-http-2022-12-04.json
        • standalone-agent-https-2022-12-04.json
        • standalone-controller-http-2022-12-04.json
        • standalone-controller-https-2022-12-04.json
        • standalone-joc-http-2022-12-04.json
        • standalone-joc-https-2022-12-04.json
        • standalone-joc-controller-agent-https-2022-12-04.json

Deployment Descriptors for use with Controller and JOC Cockpit Cluster Instances

Deployment Descriptors in this section are used with Cluster instances of Controller and JOC Cockpit that are subject to the JS7 - License

...

  • js7.deploy
    • desc
      • cluster
        • cluster-agent-http-2022-12-04.json
        • cluster-agent-https-2022-12-04.json
        • cluster-controller-http-2022-12-04.json
        • cluster-controller-https-2022-12-04.json
        • cluster-joc-http-2022-12-04.json
        • cluster-joc-https-2022-12-04.json
        • cluster-joc-controller-agent-https-2022-12-04.json

Adjusting the Deployment Descriptor

For starters it is recommended to use the standalone-agent-http-2022-12-04.json Deployment Descriptor that looks similar to this:

...

  • The descriptor.descriptorId element identifies the descriptor. The identifier is similarly used as the name of the Deployment Package. Identifiers can be made up from lowercase and uppercase letters, can include digits, underscores and hyphens. The file name of the Deployment Descriptor is not relevant.
  • The agents.agent_001 element specifies the unique Agent name agent_001.
    • Agent names can be made up from lowercase and uppercase letters, can include digits, underscores and hyphens. Users are free to choose Agent names, for example from the hostname or FQDN that the Agent is operated for, for example using element names such as agents.centostest-primary, agents.centostest-secondary.sos etc.
    • Any number of Agents can be specified in a Deployment Descriptor. 
  • The target section specifies the connection and authentication details for the target host to which the Agent should be deployed.
    • Deployment is performed using scp and ssh commands that will use the indicated SSH host and port.
    • Authentication makes use of public/private key specifying the user account and the location of the private keyFile. This setting can be omitted if the private key file matches one of the known names such as id_rsa.
    • For automated deployment It is required that the deployment user account can connect to the target host without use of a password but with a private key only.
    • The packageLocation element specifies the location where the Deployment Package tarball will be stored.
  • The media section specifies the release number and the location of the JS7 installation tarball for the Agent. The DEP_RELEASE environment variable from the env.sh script can be used to specify the directory in which the installation tarball is available.
  • The installation section specifies installation options for the Agent:
    • The Agent's home directory has to be specified. A data directory can optionally be specified, if it is omitted then <home>var_<http-port> is assumed. Consider that the target.user account has permissions to create the directories.
    • By default the directories and files of the extracted Deployment Package are owned by the deployment account specified with the target.user element. Should a different account be used on the target host then
      • the owner account of the home directory can be specified with the installation.homeOwner element.
      • the owner account of the data directory can be specified with the installation.dataOwner element.
      • the run-time account of the Agent's service/daemon can be specified with the installation.runUser element.
    • The Agent's HTTP port can be specified that defaults to port 4445.
    • The location of the Java JDK on the target host can be specified with the javaHome element.
      • The location of Java will be added to the Agent's Start Script in <home>/bin/agent_<http-port>.sh and to the systemd service file in <home>/bin/agent_<http-port>.service.
      • If this setting is omitted, then the Java location is determined by the run-time account, for example from its OS profile settings.

Creating the Deployment Package

With the Deployment Descriptor being available the Deployment Package can be created from a script. The Deployment Package will be stored to the js7.deploy/archive directory.

...

  • install the JS7 components according to the Deployment Descriptor
  • create a deployment tarball of the installed files. If different home and data directories are used then a tarball for each directory will be created.
  • create a Deployment Script that will transfer and extract the deployment tarball on the target host.

Running the Deployment Packaging Script

The Deployment Packaging Script is available from the js7.deploy/bin directory.

...

  • Use of the Deployment Script from the command line is applicable if a smaller number of JS7 components should be installed and if no JS7 scheduling environment is yet available.
  • If a JS7 scheduling environment is set up then it is preferable to import the js7_import.tar.gz tarball to JOC Cockpit that adds a workflow and schedule for parallel deployment of JS7 components. For details see JS7 - Deployment Workflow.

Performing Deployment

Deployment can be performed by

...

  • When connecting to the target host the script will stop the Agent's systemd service provided that the Deployment Descriptor specifies the target.execPre element with a value StopService.
  • For each tarball that holds the Agent's installation directory and configuration directory the script will
    • transfer the tarball to the target host and location indicated with the Deployment Descriptor (target.packageLocation),
    • extract the tarball to the respective installation or configuration directory as indicated with the Deployment Descriptor (installation.home, installation.data),
    • change ownership of the extracted directories provided that the Deployment Descriptor specifies the installation.homeOwner and installation.dataOwner elements.
  • After transfer and extraction of tarballs the script will start the Agent's systemd service provided that the Deployment Descriptor specifies the target.execPost element with a value StartService.

Resources

...