LGTM Enterprise 1.21

lgtm-config-gen.jar

Purpose

Use this Java tool to generate either of the following:

  • A cluster configuration file for a specified host machine.

  • Files used to deploy the system topology defined in a specified cluster configuration file.

You run this Java tool when you want to change the configuration of the LGTM cluster, for example, to add or remove LGTM workers, or change the URL at which LGTM is available. For more details, see Editing and deploying the cluster configuration.

Usage

java -jar <path>/lgtm-config-gen.jar <action> [--verbose] [--verbosity <level>] [--hostname <name>] [--external-url <URL>] [--output <path>] [--input <path>] [--manifest <path>] [--overwrite]

The lgtm-config-gen.jar file is located in the lgtm subdirectory of the release directory—for example, within <path>/lgtm-releases/lgtm-<release-number>/lgtm).

Actions

The action can be:

  • init—to create a simple cluster configuration file.
  • generate—to generate files relating to the LGTM Enterprise components specified in the cluster configuration file.
  • change-password—to change the password used to protect the manifest file. For information about the manifest file, see Changing or resetting a manifest password.

Flags

Flag Value Notes
--verbose

Optional. Output more detailed information about actions. This increases the verbosity to level 4.

Default (without a --verbose or --verbosity setting): level 3 verbosity

--verbosity Level

Optional. Specify how much detail you want to be included in the output. 0 suppresses all output and 6 outputs all available information. As an alternative, you can use the verbose flag as shorthand for --verbosity 4.

Default (without a --verbosity or --verbose setting): 3

--hostname Host name

For the init action only.

Optional. The host name that will be used for each component in the cluster configuration file that is created.

Default: localhost

--external-url URL

For the init action only.

Optional. The URL at which users will access LGTM Enterprise. This is written to the cluster configuration file.

Default: the value of --hostname

--output Path

If the action is init:

Optional. The path to the cluster configuration file that will be created.

Default: ../../state/lgtm-cluster-config.yml relative to the cluster-config-gen.jar file.

If the action is generate:

The path to a directory in which the configuration files for LGTM services will be generated. The directory will be created if it does not already exist.

Default: ../generated relative to the cluster-config-gen.jar file.

--input Path

For the generate and change-password actions only.

Optional. When the action is generate or change-password, this is the path of the cluster configuration file.

Default: ../../state/lgtm-cluster-config.yml relative to the cluster-config-gen.jar file.

--manifest Path

For the generate and change-password actions only.

Optional. The path to the manifest file.

Default: <path to directory containing cluster configuration file>/manifest.xml

--overwrite

For the generate action only.

Optional. Overwrite the existing output directory if it exists.

If you run lgtm-config-gen.jar from a script or from an Ansible role and you're prompted for the manifest password, you can use the LGTM_CREDENTIALS_PASSWORD environment variable to supply the password directly. For more information about this variable, see Environment variables.

Examples

Creating a basic cluster configuration

To create a simple cluster configuration file for the specified host machine, run this command:

java -jar lgtm/lgtm-config-gen.jar init --hostname "server-one.lgtm-testing.internal"

A basic lgtm-cluster-config.yml configuration file is created in the ../../state directory, relative to the cluster-config-gen.jar file.

Generating files for a cluster configuration

To generate the files required to deploy an LGTM configuration—based on an updated cluster configuration file—run this command:

java -jar lgtm/lgtm-config-gen.jar generate --overwrite

As an --input flag has not been used, this command assumes a ../../state/lgtm-cluster-config.yml file exists, relative to the location of the cluster-config-gen.jar file.

Setting or changing the manifest password

To set or change the manifest password, run this command:

java -jar lgtm/lgtm-config-gen.jar change-password

Again, without an --input flag, this command assumes a ../../state/lgtm-cluster-config.yml file exists, relative to the location of the cluster-config-gen.jar file.

If the manifest file is already protected by a password, you are prompted to enter the existing password. You are then asked to enter and confirm a new password.

Related topicsRelated topics