Code Block |
---|
usage: topo <subcommand> <options> |
This command is used to register containers in STR and to create, update, remove, and view pico configurations.
Note |
---|
Note! This command is valid only for the MZ_HOME owner. |
...
You can use the following subcommands with topo:
activate
container
convert
diff
env
get
hash
help
migrate
open
rebase-configs
register
reset
set
setupremote
show
unset
The option --allow-disconnected
is available for all subcommands except for setupremote
. You should only include this option when the Platform is unreachable and you want to use cached data.
activate
Code Block |
---|
Usage: topo activate [--dry-run] [-v, --verbose] |
Use topo activate
to move staged changes in the master registry to the active registry.
Option | Description |
---|---|
[--dry-run] | Use this option to validate the staged changes without performing the activation. |
[–hash <hash value>] | Compare the provided hash value with the actual hash that represents the current state of active registry. The activation fails if the values are not equal. For further information, see hash below, |
[-v, --verbose] | Use this option for detailed information about the changes. |
Insert excerpt |
---|
...
|
...
|
container
Code Block |
---|
Usage: topo container |
Use topo container
to display the name of the current container.
Option | Description |
---|---|
[--allow-disconnected] | Use this option when the Platform is unreachable and you want to operate on cached data. |
convert
Code Block |
---|
Usage: topo convert [-c, --container <container>] [-g, --container-group <container group>] [--dry-run] [-f, --file <filename>] |
Use topo convert
to move the configuration of a specific XML file to STR.
Option | Description |
---|---|
[-c, |
...
--container |
...
<container>] | Use this option to specify a target container. |
[-g, |
...
--container-group |
...
<container |
...
group>] | Use this option to specify a target container group. |
[--dry-run] | Use this option to validate that the conversion and display the result of the conversion without updating the STR. |
[-f, |
...
--file |
...
<filename> | Use this option to specify the source XML file. |
Info |
---|
...
Example - Converting an XML file
|
diff
Code Block |
---|
Usage: topo diff [-e, --show-entries] [-f, --from <registry>] [-q, --brief] |
Use topo diff
to view differences between the master repository and the active repository in the STR.
Option | Description | |
---|---|---|
[-e, --show-entries] | Use this option for viewing differences in an easy-to-read format. By default, the output from the command displays
|
...
| ||||||
[ -f, --from] <registry> | Use this option when you want to compare the active registry with the backup registry | |||||
[-q, --brief] | Use this option to only view the names of the updated registry files. The default value is false. |
Info |
---|
...
Example - Comparing registry files Run the following command to view the differences between the active registry and the master registry.
or
Run the following command to view the differences between the active registry and the backup registry.
|
...
env
Code Block |
---|
Usage: topo env [-e, --effective] [--update-java-home <value>] [--update-mz-container <value>] [--update-mz-home <value>]
[--update-mz-platform <value>] |
Use topo env
to display or set environment variables that are used my the mzsh command. These variables are written to the script file MZ_HOME/bin/mzsh
.
Option | Description |
---|---|
[-e, --effective] | Use this option to read the environment parameters in runtime, i e the "effective values" after accounting for overrides. The default behaviour is to read the values as they are defineds in the mzsh script file, not accounting for the possibility to override these values with environment variables. |
[--update-java-home <value>] | Use this option to update the value of JAVA_HOME |
[ --update-mz-container <value>] | Use this option to |
...
update the value of MZ_CONTAINER. | |
[--update-mz-home <value> ] | Use this option to |
...
update the value of MZ_HOME. | |
[--update-mz-platform <value> ] | Use this option to |
...
update the mzsh value of MZ_PLATFORM. |
Info |
---|
...
Example - Reading the environment variables
|
Info |
---|
...
Example - Setting the environment variable JAVA_HOME
|
get
Code Block |
---|
Usage: topo get [--default-val <value>] [ --exclude-dynamic] [--format <full | data-only>] [-l, --local] [-p, --perspective] <target path>] |
Use topo get
to retrieve pico configurations in the target path from STR.
Paths in STR are structured as follows:
Code Block | ||||
---|---|---|---|---|
| ||||
topo://container:<container>/pico:<pico>/val:<attribute> |
Option | Description | |
---|---|---|
[--default-val <value>] | Use this option to replace a missing value in the target path with a default value.
|
|
| ||||
[ --exclude-dynamic] | Use this option to exclude non-static data in the output e g | |||
[--format <full|data-only>] | Use this option to exclude metadata from the command output.
Default: | |||
[-l, --local] | Use this option to select the local container, unless another container is specified in the target path. Default: | |||
[-p, --perspective <resolve | default>] | Use this option to retrieve the attributes of templates instead of the template names.
Default: |
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Example - Viewing pico configurations Run the following command to view one or more pico configurations.
You can view multiple pico configurations by replacing the full path with a regular expression.
|
Info | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
title | Example - Viewing pico attributes Run the following command to view a specific attribute in a pico configuration.
You can retrieve the attributes of multiple pico processes by replacing the full path with a regular expression.
|
...
Use topo hash
to retrieve a value that represents the current state of the active registry. This is useful when you need to handle concurrent changes of the STR. For instance, an application may need to retrieve a pico configuration to evaluate the required changes. In the meantime, a second application or a user may update the same configuration
Info | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
title | Example - Using hash values
| Eclipse |
$ mzsh topo hash
"3a2e373fa1653c7f0e757e2682c70317-2028777631" |
Application 1 retrieves the properties of ec1.
Code Block | ||
---|---|---|
|
$ mzsh topo get -l pico:ec1/obj:config.properties
Application 1 updates a property but does not call
topo activate
. The hash is specified to ensure that changes by other users are not activated inadvertently later on.Code Block language text
$ mzsh topo set -l --no-activation --hash 3a2e373fa1653c7f0e757e2682c70317-2028777631 \ topo://pico:ec1/val:config.properties.ec.httpd.port 9090
Application 2 updates the properties of ec1. The hash value is updated.
Code Block language text
$ mzsh topo set -l topo://pico:ec1/val:config.properties.ec.httpd.port 9090
Application 1 calls
topo activate
with hash value retrieved in step 1.Code Block language text
$ mzsh topo activate --hash 3a2e373fa1653c7f0e757e2682c70317-2028777631
The activation fails since the hash values do not match.
Code Block Specified hash does not match transaction id: d9cd38f3793647028bd7e5d64c354ad5-2055434210 != 3a2e373fa1653c7f0e757e2682c70317-2028777631) This may indicate concurrent modification of registry: Operation aborted!
Application 1 resets the master registry, retrieves a new hash and starts over.
Code Block language text
$ mzsh topo reset $ mzsh topo hash
help
Code Block |
---|
Usage: topo help [<subcommand>] |
...
Use topo migrate
to move pico configurations from MZ_HOME to STR. The upgrader runs this command during upgrade to 8to 8.0.
open
Code Block |
---|
Usage: topo open [-n, --no-activation] <target path> |
Use topo open
to open a cell, container- or pico configuration file in a text editor. When you save and close the editor, the command will call topo activate
to move the staged changes in the master registry to the active registry.
Option | Description |
---|---|
[-n, --no-activation] | Use this option to skip activation after changes in master registry. |
Run the following command to open a cell configuration:
Code Block | ||
---|---|---|
| ||
$ mzsh topo open cell:<cell> |
Info | |||||
---|---|---|---|---|---|
Example - Opening a cell configuration
|
...
Code Block | ||
---|---|---|
| ||
$ mzsh topo open <container> |
Info | ||||||
---|---|---|---|---|---|---|
title | Example - Opening a container configuration
|
...
Code Block | ||
---|---|---|
| ||
$ mzsh topo open <pico> |
Info | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Example - Opening a pico configuration
or
|
If the pico name is not unique in the system, you will be prompted to specify the container.
Info | |||||
---|---|---|---|---|---|
Example - Multiple pico configuration sharing the same name
|
...
Code Block | ||
---|---|---|
| ||
$ mzsh topo open services:<custom|standard> |
Info | ||||||
---|---|---|---|---|---|---|
title | Example - Opening a service configuration
|
Tip | |
---|---|
title | Hint! When you save the configuration, |
By default, the command opens the vi editor. To use a different editor set the environment variable EDITOR
.
Info | |||
---|---|---|---|
title | Example - Setting nano as the default editor
|
...
Use topo rebase
to inset a standard template in a pico configuration and remove attributes that are identical to attributes in the template. The command automatically detects the pico configuration type and applies one of the following templates:
mz.standard-platform.conf
mz.standard-ec.conf
mz.standard-ecsa
mz.standard-sc
This command is useful to reduce the size of the pico configurations and thereby facilitate maintenance.
...
For further information about templates, see /wiki/spaces/MD82/pages/3778560 in the /wiki/spaces/MD82/pages/3778529see STR File Structure.
Option | Description |
---|---|
[-a, --activate] | Use this option to immediately activate after changes in master registry. |
Info | ||||
---|---|---|---|---|
Example - Rebasing an EC configuration
or
|
...
When you install an execution container, and the Platform is running, it is automatically registered in the Platform Container. If the platform is not running during the installation, use topo register
to register the Execution Container manually.
Option | Description |
---|---|
[-a, --address <ip/host>] | Use this when you need to set a different host address for the container than the one that is specified in the common property |
[-c, --container <container>] | Use this option when you need to change the existing container name. This option is typically used together with the |
[-g, --container-group <container group>] | Use this option when you need to change the existing container group. This option is typically used together with the |
[--mz-home <path>] | Use this option when you need to set a different home directory for the container than the one that is specified in the environment variable MZ_HOME, which is the default value. |
[-u] | Use this option to allow updates of an already registered container. By default, updates are not allowed and the command will attempt to register a new container. |
reset
Code Block |
---|
Usage: topo reset |
...
Use topo set
to create and update pico configurations in the specified target-path of STR.
Option | Description |
---|---|
[-l, --local ] | Use this option to select the local container, unless another container is specified in the target path. |
[--no-activation, -n] | Use this option to skip activation after changes in master registry. |
[-s, |
--strict-json] | Use this option when you want to specify the configuration in JSON format instead of HOCON format. |
Run the following command to create a new pico configuration.
Code Block | ||||
---|---|---|---|---|
| ||||
$ mzsh topo set topo://container:<container>/pico:<pico> <config> |
The <config>
argument may contain a key-value pair that specifies a template or a pico configuration in HOCON format.
Info | |||||
---|---|---|---|---|---|
Example - Creating a new pico configuration based on a template
|
Info | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
title | Example | . - Creating pico configuration When you specify a pico configuration that consists of multiple attributes, it is recommended that you use multi-line strings. HOCON Format:
JSON Format:
|
...
Add the pico group setting by using the following |
...
topo command
|
...
|
...
|
...
title | Example - Updating a pico attribute |
---|
Code Block | ||
---|---|---|
| ||
$ mzsh topo set topo://container:main1/pico:ec2/val:ec_type ecsa |
Run the following command to add or update an object that contains one or more attributes.
Code Block | ||||
---|---|---|---|---|
| ||||
$ mzsh topo set topo://container:<container>/pico:<pico>/obj:<object name> '<config>' |
The <config>
argument may contain a pico configuration in HOCON format.
...
title | Example - Updating a pico object |
---|
This command adds the properties value1
and value2
:
Code Block | ||
---|---|---|
| ||
$ mzsh topo set topo://container:main1/pico:ec2/obj:config.properties.example_object '{
value1=1
value2=2
}' |
The following commands does not overwrite the properties value1
and value2
in example_object
but adds value3
:
Code Block |
---|
$ mzsh topo set topo://container:main1/pico:ec2/obj:config.properties.example_object '{
value3=3
}' |
setupremote
Code Block |
---|
Usage: topo setupremote [-c, --container <container>] [-g, --container-group <container group>] [--host-key <path>] [--javahome <path>] [--no-authorized-key] [--no-host-key] [-- no-ssh-details] [--ssh-address <ip/host>] [--ssh-port <port>] [--ssh-username <username>] |
Use the command topo setupremote
to enable remote access via SSH to an Execution Container, e g from the Platform container.
...
[-c, --container <container>]
...
Use this option to specify a different container than the local one, which is the default value.
...
By default, the topo setupremote
command will obtain a public authorization key from the user home directory on the Platform Container host and store it in the STR, i e the file mz.conf
. Use the option --no-authorized-key
to skip this operation.
...
By default, the topo setupremote
command will store the public host key of the Execution Container in the STR, i e the file mz.conf
. Use the option --no-host-key
to skip this operation.
...
show
Use topo show to retrieve various types of information about pico instances that are defined in the STR.
Code Block | ||
---|---|---|
| ||
Usage: topo show [ --exclude-dynamic] [--format <format>] [-l, --local] [--timeout-seconds <time>] <view> |
...
Set the format of the returned data:
- csv
json
table (default)
...
Use this option to view pico instances in the local container only. By default, all containers are included.
...
[--timeout-seconds <time>]
Use this option to limit the time for retrieving dynamic information, e g _status
.The default value is 10 seconds.
The following views are available:
...
Info | ||||
---|---|---|---|---|
| ||||
This command makes the Execution context "EC1" a member of the "ec1" and "ec2" groups. This is the HOCON example format adding in ECs to a pico group.
|
Run the following command to add or update an attribute of a pico configuration.
mzsh topo set topo://container:<container>/pico:<pico>/val:<attribute> <attribute value>
Info | |||||
---|---|---|---|---|---|
Example - Updating a pico attribute
|
Run the following command to add or update an object that contains one or more attributes.
Code Block | ||
---|---|---|
| ||
$ mzsh topo set topo://container:<container>/pico:<pico>/obj:<object name> '<config>' |
The <config>
argument may contain a pico configuration in HOCON format.
Info | |||||||
---|---|---|---|---|---|---|---|
Example - Updating a pico object This command adds the properties
The following commands does not overwrite the properties
|
setupremote
Code Block |
---|
Usage: topo setupremote [-c, --container <container>] [-g, --container-group <container group>] [--host-key <path>] [--javahome <path>] [--no-authorized-key] [--no-host-key] [-- no-ssh-details] [--ssh-address <ip/host>] [--ssh-port <port>] [--ssh-username <username>] |
Use the command topo setupremote
to enable remote access via SSH to an Execution Container, e g from the Platform container.
Option | Description |
---|---|
[-c, --container <container>] | Use this option to specify a different container than the local one, which is the default value. |
[-g, --container-group <container group>] | Use this option to setup remote access to a container in specific container group. This is useful when you have multiple containers with identical names in different containers groups. |
[--host-key <path>] | Use this option to use a pre-generated host key instead of the one that is generated when you run |
[--java-home <path>] | Use this option when the target container is located on a different host. The default value is specified by the environment variable JAVA_HOME in the current shell. |
[--no-authorized-key] | By default, the |
[--no-host-key] | By default, the |
[--no-ssh-details] | Use this option to exclude |
[--ssh-address <ip/host>] | Use this option when the target container is located on a different host or when you want to bind to a specific IP address or hostname. The default value is specified by the |
[--ssh-port <port>] | Use this option when you want to use a different port than 22 for SSH. |
[--ssh-username <username>] | Use this option when the target container is located on a different host or when a specific username is required for SSH. The default SSH user is the OS user that runs the |
show
Use topo show to retrieve various types of information about pico instances that are defined in the STR.
Code Block | ||
---|---|---|
| ||
Usage: topo show [ --exclude-dynamic] [--format <format>] [-l, --local] [--timeout-seconds <time>] <view> |
Option | Description |
---|---|
[ --exclude-dynamic] | Exclude non-static data in the output e g |
[ --format <format>] | Set the format of the returned data:
|
[ -l, --local ] | Use this option to view pico instances in the local container only. By default, all containers are included. |
[--timeout-seconds <time>] | Use this option to limit the time for retrieving dynamic information, e g |
The following views are available:
jvm-args
- Displays the JVM arguments that are used by the pico instances in the system. JVM arguments that are set in templates are included.status
- Displays the container name, pico name, pico type and running state.status-sc
- Displays similar view asstatus
but only includes SCs.status-ec
- Displays similar view asstatus
but only includes ECs.status-long
- Displays similar view asstatus
but also includes the status of replication between Platform Container and Execution Containers.pico-view
- Displays similar view asstatus
but also includes memory usage and the pico response time.pico-view2
- Displays similar view aspico-view
but also includes uptime.ports
- Displays the ports that are used by the pico instances in the system. Ports that are set in templates and on cell- and container levels, are included. If both webserver and httpd ports are displayed, then webserver ports take precedence.
Info | ||||||
---|---|---|---|---|---|---|
Example - Views
|
unset
Code Block |
---|
Usage: topo unset [-l, --local] [-n, --no-activation] <target path> |
Use topo unset
to remove pico configurations in the specified target-path of STR.
Option | Description |
---|---|
[-l, --local] | Use this option to select the local container, unless another container is specified in the target path. |
[-n, --no-activation] | Use this option to skip activation after changes in master registry. |
Run the following command to remove a pico configuration.
mzsh topo unset topo://container:<container>/pico:<pico>
Info | ||||||
---|---|---|---|---|---|---|
title | Example - Removing a pico configuration
|
Info |
---|
...
Example - Removing a pico attribute
|
...
|
Excerpt | |
---|---|
File Paths in AttributesWhen you enter a path that is relative to MZ_HOME in the value of an attribute, it is recommend that you use In the following example MZ_HOME will be resolved to its current value e g
|
...
|
...
...
The next example uses a path that is always relative to MZ_HOME.
|
...
|
...
|
...
title | Note! |
---|
|
...
Conflicting AttributesThe name of an attribute may contain the full name of another attribute. For instance, In this case you must ensure that the name of both properties are surrounded by quotes, or one of the properties will be overwritten at |
...
title | Example - Handling conflicting attributes, manual editing |
---|
Code Block |
---|
common : {
"pico.rcp.tls.keystore" : "home/mz/keys",
"pico.rcp.tls.keystore.password" : "..."
} |
When there are conflicting properties and you are using the mzsh topo command, also add single quotes, surrounding the target path (topo://..).
...
title | Example - Handling conflicting attributes, scripted editing |
---|
...
activation.
When there are conflicting properties and you are using the mzsh topo command, also add single quotes, surrounding the target path (topo://..).
|
Updating IP, Hostname, and Ports in JDBC URL
You can update the IP address, hostname, and ports int he JDBC URL using the mzsh topo get
and mzsh topo set
commands as shown in the examples below.
Info | |||||
---|---|---|---|---|---|
Example - Get current config
|
Info | |||||
---|---|---|---|---|---|
Example - Update URL with set
|
Note |
---|
Caution! When you have set the new JDBC URL, run shutdown and startup on the platform to ensure that your changes take effect properly. |
Return Codes
Listed below are the different return codes for the topo commandtopo command:
Code | Description |
---|---|
0 | Will be returned if the command is successful. |
1 | Will be returned if the argument count is incorrect or argument(s) are invalid. |
3 | Will be returned if the target path argument for the subcommand |