Page History
Table of Contents |
---|
Introduction
- JOC Cockpit comes preinstalled from a container image.
- Before installing running the JOC Cockpit container the following requirements should be met:
- A database is Either the embedded H2® database can be used or an external database should be made available and is accessible , - see the JS7 - Database.
Info title Database Support Database support currently is limited to MySQL® and H2®. The upcoming prerelease of JS7 can be used with any supported database, see JS7 - Roadmap.
- Volumes are created for Docker volumes are created with persistent JOC Cockpit configuration data and log files.
- A Docker container network or similar mechanism is made available to enable network access for between JOC Cockpit, Controller instance(s) and Agents.
- Starting the JOC Cockpit container.
- Execution of a script inside the container to create database objects.
- A database is Either the embedded H2® database can be used or an external database should be made available and is accessible , - see the JS7 - Database.
- Initial operation for JOC Cockpit includes:
- specification ofthe registering the Controller instance(s) and Agents that are used in the job scheduling environment.
- optional specification of optionally registering a JS7 Controller cluster.
As an alternative to the instructions from this article users can consider the JS7 - JOC Cockpit Installation using Docker Compose article.
Installation Video
This video explains the installation of JOC Cockpit from container images.
Widget Connector | ||
---|---|---|
|
Prerequisites
Check that 20.10 or newer is operated..
Pulling the JOC Cockpit Image
Pull the version of the JOC Cockpit image that corresponds to the JS7 release in use, for example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
docker image pull sosberlin/js7:joc-2-0-0-SNAPSHOT5-0 |
Note: Current releases should be applied as available from https://hub.docker.com/r/sosberlin/js7
Running the JOC Cockpit Container
After pulling the JOC Cockpit image you users can run the container with a number of options like thissuch as:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/sh docker run -dit --rm \ --hostname=js7-joc-primary \ --network=js7 \ --publish=17446:4446 \ --env="RUN_JS_JAVA_OPTIONS=-Xmx256m" \ --env="RUN_JS_USER_ID=$(id -u $USER):$(id -g $USER)" \ --mount="type=volume,src=js7-joc-primary-config,dst=/var/sos-berlin.com/js7/joc/resources/joc" \ --mount="type=volume,src=js7-joc-primary-logs,dst=/var/log/sos-berlin.com/js7/joc" \ --name js7-joc-primary \ sosberlin/js7:joc-2-05-0-SNAPSHOT |
Explanation:
--network
The above example makes use of a Docker container network - created e.g. with the command , for example, using thedocker network create js7
command - to allow network sharing between containers. Note that any inside ports used by Docker containers are visible within a Docker container network. Therefore a JOC a JOC Cockpit instance running for the inside port4446
is accessible can be accessed with the container's hostname and the same port within the Docker container network.--publish
The JOC Cockpit is prepared has been configured to listen to the HTTP port4446
. An outside port of the Docker host can be container's host is mapped to the JOC the JOC Cockpit inside HTTP port. This mapping is not required for use with a Docker network, see--network
, however, it will required to allow direct access to the JOC the JOC Cockpit user interface from the Docker host by its outside port .--env=RUN_JS_JAVA_OPTIONS
This allows to inject any Java options to be injected into the JOC Cockpit container. Preferably this is used to specify memory requirements of the JOC Cockpit, e.g. for example, with-Xmx256m
. For details see JS7 - FAQ - Which Java Options are recommended--env=RUN_JS_USER_ID
Inside the container the JOC Cockpit is operated running for thejobscheduler
user accountjobscheduler
. In order to access e.g. , for example, log files created by the JOC Cockpit that , which are mounted to the Docker container's host, it is recommended that you users map the account that is starting starts the container to thejobscheduler
account inside the container. TheRUN_JS_USER_ID
environment environment variable accepts the user User ID and group Group ID of the account that will be mapped. The example above example makes use of the current user, for details see JS7 - Running Containers for User Accounts.--mount
The following volume mounts are suggested:config
: The optional configuration folder allows to specify specification of individual settings for JOC Cockpit operation , - see the sections below chapters and the JS7 - JOC Cockpit Configuration Items article. Without this folder the default settings are used. This includes specifying the connection to the JS7 - Database. In addition users can store their versions of the following files in the volume for the configuration directory.hibernate.cfg.xml
: used for the database connection, see next section.joc.properties
: holds general settings, see JS7 - JOC Cockpit Configuration Items.log4j2.xml
: log configuration, see JS7 - Logging.start.ini
: Jetty start-up configuration, see JS7 - JOC Cockpit Configuration Items.*.p12
: keystore and truststore files for JS7 - JOC Cockpit HTTPS Connections.
logs
: In order to have JOC make JOC Cockpit log files persisted persistent they have to be written to a volume that is mounted for the container. Feel Users are free to adjust the volume name from thesrc
attribute, however. However, the value of thedst
attribute should not be changed as it reflects the directory hierarchy inside the container.Docker offers Containers offer a number of ways how to mount or to bind volumes to containers that include e.g. to create of mounting or binding volumes including, for example, creation of local directories and to bind binding them to volumes like this:
Code Block language bash title Example how to create Docker volumes linenumbers true # example to map volumes to directories on the Dockercontainer's host prior to running the JOC Cockpit container mkdir -p /home/sos/js7/js7-joc-primary/config /home/sos/js7/js7-joc-primary/logs docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/config" js7-joc-primary-config docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/logs" js7-joc-primary-logs
There are alternative ways how to achieve of achieving this. As a result you should users have a access to the directories
/var/sos-berlin.com/js7/joc/resources/joc
and/var/log/sos-berlin.com/js7/joc
inside the container and data in both locations should be persistedpersistent. If volumes are not created before running the container then they will be mounted automatically mounted. However, you users should have access to data in the volumes, e.g. by access to/var/lib/docker/volumes/js7-joc-primary-config
etc.
Installing Database Objects
JOC Cockpit requires a database connection, see JS7 - Database.
The database connection is should be configured after before the initial start of the JOC Cockpit container.
The following sections can be skipped when using the H2® embedded database to evaluate JS7. Here it is sufficient to have the Hibernate configuration ready as this database runs in pre-configured mode inside the container.
Check the JDBC Driver
JS7 ships with a number of JDBC Drivers.
- For JDBC Drivers for use with H2®, MariaDB®, MySQL®, Oracle®, PostgreSQL® JDBC Drivers are included with JS7.
- For details about JDBC Driver versions see versions see the JS7 - Database article.
- Should you users have good reason reasons to use a different version of a JDBC Driver then you they can apply the JDBC Driver version of your their choice.
- For details about JDBC Driver versions see versions see the JS7 - Database article.
- For use with H2®
- The version of H2® successfully tested by SOS is
h2-1.4.200.jar
. At the time of writing later versions do not provide decent compatibility with MySQL to be applicable for JS7.
- The version of H2® successfully tested by SOS is
- For use with Microsoft SQL Server®
- it is required to download the JDBC Driver The JDBC Driver has to be downloaded by the user as it cannot be bundled with open source software due to license conflicts.
- You Users can download the JDBC Driver Drivers from the vendor's site sites and store the resulting *.jar file(s) with in the following location:
Status | ||||
---|---|---|---|---|
|
- Location in the container:
/var/sos-berlin.com/js7/joc/resources/joc/lib
- Consider accessing this directory from the volume that is mounted when running the container, for example, from a local folder
/home/sos/js7/js7-joc-primary/config/lib
. - Refer to the JS7 - Database article for details about the procedure.
- Location in the container:
Configure the Database Connection
In a first step users have to create a database schema and account for JS7. The database schema has to support the Unicode character set.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# add database
CREATE DATABASE js7 CHARACTER SET utf8 COLLATE utf8_general_ci;
# add account
CREATE USER 'jobscheduler'@'%' IDENTIFIED BY 'jobscheduler';
GRANT ALL ON js7.* TO 'jobscheduler'@'%'; |
- For examples how to set up the database see the JS7 - Database article.
In a second step the database connection has to be The database connection is specified from a Hibernate configuration file:
- Location in the container:
/var/sos-berlin.com/js7/joc/resources/joc/hibernate.cfg.xml
- Consider to access accessing the configuration file from the volume that is mounted when running the container, e.g. , for example, from a local folder
/home/sos/js7/js7-joc-primary/config
. - For modification Information about use of the Hibernate *
hibernate.cfg.xml
file consider explanations for your DBMS product available with the respective DBMS can be found in the JS7 - Database article.
Create Database Objects
When the Hibernate configuration file hibernate.cfg.xml
is ready then a script has to be executed that creates required objects in the database and that populates database tables.Database objects are created by executing the following script inside the container::
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# create database objects docker exec -ti js7-joc-primary /bin/sh -c /opt/sos-berlin.com/js7/joc/install/joc_install_tables.sh |
...
docker exec -ti
is the command that connects to the JOC Cockpit containerjs7-joc-primary
.js7-joc-primary
is the name of the JOC Cockpit container as specified with in the abovedocker run
command mentioned above./bin/sh -c
runs a shell inside the container and executes a script to install and populate the database objects required for operation of JOC Cockpit.
Performing Initial Operation
For initial operation, the JOC Cockpit GUI is used to make Controller instances and Agent instances known to your job scheduling environment.
Access JOC Cockpit from your Browser
Explanatios:
- For the JOC Cockpit URL: in most situations you can use the host name of the Docker host and the port that was specified when starting the container.
- From the above example this could be
http://centostest_primary.sos17446
ifcentostest_primary.sos
were your Docker host and17446
were the outside HTTP port of the container. - Note that the Docker host has to allow incoming traffic to the port specified This might require adjustment of the port or to create firewall rules.
- From the above example this could be
- By default JOC Cockpit ships with the following credentials:
- account:
root
- password:
root
- account:
Register Controller and Agents
After login a dialog window pops up that asks to register a Controller. You will find the same dialog later on from the User -> Manage Controllers/Agents menu.
You have a choice of registering a Standalone Controller or registering a Controller Cluster for high availability (requires JS7 - Licensing).
Register Standalone Controller
This registration dialog allows specification of a Standalone Controller or a Controller Cluster.
Use of the Standalone Controller is in the scope of the JS7 open source license.
Explanation:
- You can add a title to the Controller instance that will become visible with the JS7 - Dashboard View.
- The URL of the Controller instance has to match the hostname and port that the Controller instance is operated for.
- Should you use a Docker network then all containers will "see" each other and all inside container ports will be accessible within the network.
- In the above example a Docker network
js7
was used and the Controller container was started with the hostnamejs7-controller-primary
. - The port
4444
is the inside HTTP port of the Controller that is visible in the Docker network.
- In the above example a Docker network
- Should you not use a Docker network then it is up to you to decide how to map hostnames:
- The Controller container could be accessible from the Docker host, i.e. you would specify the hostname of the Docker host.
- The outside HTTP port of the Controller container has to be used that is specified with the
--publish
option when starting the Controller container.
- Should you use a Docker network then all containers will "see" each other and all inside container ports will be accessible within the network.
Register Controller Cluster
A Controller cluster implements high availability for automated fail-over should a Controller instance be terminated or become unavailable.
Note that the high availability feature of clustering is subject to JS7 - Licensing. Without a license fail-over/switch-over will not take place between Controller cluster members.
Info | ||
---|---|---|
| ||
The JS7 pre-release does not support role assignment for Primary and Secondary Controller instances by JOC Cockpit. Instead, for the Secondary Controller instance follow the steps explained from the JS7 - Controller Configuration for Docker Containers article before starting the container and before performing registration. |
Explanation:
- This dialog allows the specify of the Primary Controller instance, Secondary Controller instance and .Agent Cluster Watcher.
- You can add a title for each Controller instance that will become visible with the JS7 - Dashboard View.
- Primary and Secondary Controller require a URL as seen from JOC Cockpit.
- In addition, each Controller instance can be added a URL from which it is accessible by its partner cluster member.
- Typically the URL is the same as the URL for JOC Cockpit.
- Should you operate e.g. a proxy server between Primary and Secondary Controller instances then the URL for a given Controller instance to access its partner cluster member might be different from the URL used by JOC Cockpit.
- The URL of the Controller instance has to match the hostname and port that the Controller instance is operated for.
- Should you use a Docker network then all containers will "see" each other and all inside container ports are accessible within the network.
- In the above example a Docker network
js7
was used and the Primary Controller container was started with the hostnamejs7-controller-primary
. The Secondary Controller was started with the hostnamejs7-controller-secondary
. - The port
4444
is the inside HTTP port of the Controller instance that is visible in the Docker network.
- In the above example a Docker network
- Should you not use a Docker network then it is up to you how decide how to map hostnames:
- The Controller container could be accessible from the Docker host, i.e. you would specify the hostname of the Docker host.
- The outside HTTP port of the Controller instane has to be used that was specified with the
--publish
option when starting the Controller container.
- Should you use a Docker network then all containers will "see" each other and all inside container ports are accessible within the network.
- The Agent Cluster Watcher is required for operation of a Controller cluster. The Agent is contacted by Controller cluster members to verify the cluster status should no direct connection between Controller cluster members be available.
- Note that the example above makes use of an Agent that by default is configured for use with HTTP connections.
- For use of the Agent's hostname and port the same applies as for Controller instances.
Register Agents
After the connection between JOC Cockpit and the Controller is established you can add Agents like this:
Explanation:
- For each Agent a unique identifier is specified, the Agent ID. The identifier remains in place for the lifetime of an Agent and cannot be modified.
- You can add a name for the Agent that will be used when assigning jobs to be executed with this Agent. The Agent name can be modified later on.
- In addition you can add alias names to make the same Agent available with different names.
Further Resources
- Note that there is no harm in re-running the script a number of times as it will not remove existing data from the database.
- Note that the script has to be executed once for any newer JOC Cockpit releases that are used from images provided by SOS.
Time Service
It is necessary that a time service is operated on the container's host which runs the JOC Cockpit in order to synchronize the system clock's time.
...
Log Files
Access to log files is essential to identify problems during installation and operation of JOC Cockpitcontainers.
When By mounting a volume for log files as explained above you should users have access to the files indicated with in the JS7 - Log Files and Locations article.
- The
jetty.log
file reports about initial start up of the servlet container. - The
joc.log
file includes e.g. information about database access.
Anchor | ||||
---|---|---|---|---|
|
For initial operation, the JOC Cockpit is used to make Controller instance(s) and Agent instances known to the job scheduling environment.
...
For use of JOC Cockpit with the Open Source license and with the commercial JS7 - License the following information applies:
- JS7 - Initial Operation for Standalone Controller
- JS7 - Management of Standalone Controllers
- JS7 - Management of Standalone Agents
If the JS7 is used for high availability in a JS7 - JOC Cockpit Cluster, JS7 - Controller Cluster or JS7 - Agent Cluster using the commercial JS7 - License the following information applies:
- JS7 - Initial Operation for JOC Cockpit Cluster
- JS7 - Initial Operation for Controller Cluster
- JS7 - Management of Controller Clusters
- JS7 - Management of Agent Clusters
Further Resources
Configuring
...
the JOC Cockpit
Note that it is not necesary necessary to configure the JOC Cockpit - it runs out-of-the-box. The default configuration specifies that: HTTP connections are used which expose unencrypted communication between clients and JOC Cockpit. Authentication is performed by hashed passwords.
Users who intend to operate a compliant and secure job scheduling environment or who wish to operate JOC Cockpit as a cluster for high availability are suggested recommended to familiarize themselves with the JS7 - JOC Cockpit Configuration for Docker Containers article series.
Build the JOC Cockpit Image
User who wish to create individual their own images of the JOC Cockpit can find instructions with in the JS7 - JOC Cockpit Build for Docker of Container Image article.