Creating Pico Configurations

Creating Pico Configurations

Create new pico configurations by manually creating a new configuration file in the container (<pico name>.conf) or using the mzsh topo set command.

Run the following commands to create a new pico configuration.

$ mzsh topo set topo://container:<container>/pico:<pico> <conf>

The <config> argument may contain a key-value pair that specifies a template or a Pico configuration in HOCON format.

Example - Creating a new pico configuration based on a template

$ mzsh topo set topo://container:main1/pico:ec2 template:mz.standard-ec

When the target container is in the local MZ_HOME, you can add the local flag and omit the container name.

Example. Creating a new pico configuration in the local container

$ mzsh topo set --local pico:ec2 template:mz.standard-ec

When you specify a pico configuration with multiple attributes, it is recommended that you use multi-line strings. 

Example - Creating pico configuration in HOCON format

$ mzsh topo set --local pico:ec2 '{ template:mz.standard-ec config { properties { ec.webserver.port : 9092 } classpath { jars=["lib/picostart.jar"] } } }'

If you do not specify a template, you need to ensure that the pico type is specified in the configuration:

mzsh topo set --local pico:ec2 '{ type:ec config { properties { ec.webserver.port : 9092 } classpath { jars=["lib/picostart.jar"] } } }'

Note!
It is possible to create identical pico configurations with the same name in multiple containers. However, only one of these can run at a time.

To set the value of a property so that it is shared by all Pico instances in a container, set it on the container level. If the value should be shared by all pico instances in all containers, set properties on the cell level. 

Example - Setting a property in a container

$ mzsh topo set topo://container:<container>/val:common.pico.tmpdir '${mz.home}/"tmp"'

Example - Setting a property in a cell

$ mzsh topo set topo://cell:default/val:common.pico.rcp.platform.host examplehost

Note!

  • Properties in the pico configuration override properties on the container level.

  • Properties that are set on the container level override properties on the cell level.

For further information about setting properties on containers and cell levels, see Updating Pico Configurations.