IBM InfoSphere Streams Version 4.1.1

streamtool mkinstance

The streamtool mkinstance command creates an instance in the domain.

Usage

Read syntax diagramSkip visual syntax diagram
mkinst, mkinstance

>>-+---------------------------------------------+-------------->
   '- --admin-grp--group--+--------------------+-'   
                          '- --user-grp--group-'     

>--+-----------------------+--+---------+----------------------->
   '-+- -d----------+--did-'  +- -h-----+   
     '- --domain-id-'         '- --help-'   

>--+---------------------+--+--------------------+-------------->
   '- --hfile--host-file-'  |           .-,----. |   
                            |           V      | |   
                            '- --hosts----host-+-'   

>--+-------------------------+---------------------------------->
   '-+- -i------------+--iid-'   
     '- --instance-id-'          

   .--------------------------------------------------------------.   
   V                                                              |   
>----+----------------------------------------------------------+-+-->
     '- --numresources--number--+-----------+--+--------------+-'     
                                |   .-,---. |  '-sharing-mode-'       
                                |   V     | |                         
                                '-,---tag-+-'                         

   .-----------------------------.   
   V                             |   
>----+-------------------------+-+------------------------------>
     '- --property--name=value-'     

>--+----------------------------+--+-----------------+---------->
   '- --propfile--property-file-'  '- --trace--level-'   

>--+---------------------+--+-----------------------+----------->
   '-+- -U-----+--userid-'  '-+- -v--------+--level-'   
     '- --User-'              '- --verbose-'            

>--| Non-interactive tool options |----------------------------><

Non-interactive tool options

    (1)                                    
|--------+-----------------------------+------------------------|
         +- --embeddedzk---------------+   
         |               .-,---------. |   
         |               V           | |   
         '- --zkconnect----host:port-+-'   

Notes:
  1. The non-interactive tool options are not supported in the interactive streamtool interface.

Authority

You must have add authority for the instances domain object. By default, the DomainAdministrator role has this authority. For more information about access control lists, see streamtool getdomainacl.

Description

The following command is an example of the simplest mkinstance command:
streamtool mkinstance -d domainA --zkconnect host1:1234
The instance identifier must satisfy the following requirements:
  • The name must be unique among the instances that are defined by you, the instance owner, within the domain.
  • The name must contain alphanumeric characters. You cannot use the following alphanumeric characters: ^!#$%&'*+,/;<>=?@[]`{|}~(). You also cannot use the following Unicode and hexadecimal characters: u0000; u0001-u001F; u007F-u009F; ud800-uF8FF; uFFF0-uFFFF; x{10000}-x{10FFFF}.
  • The name cannot be zookeeper.
  • The maximum length for the name is 255 bytes.

By default, members of the InstanceAdministrator role can administer the instance and members of the InstanceUser role can use the instance. The group that is specified in the --admin-grp option is added to the InstanceAdministrator role. The group that is specified in the --user-grp option is added to the InstanceUser role.

You can associate hosts (also known as resources) with the instance by using the --hfile, --hosts, and --numresources options. If you do not specify one of those options, the following resource specification is added when the instance starts: --numresources 1. You can also associate resources with an instance by using the streamtool addhost command.

Tags can affect dynamic resource selection at instance creation time and when resources are added to an instance.

InfoSphere® Streams defines the following tags:
application
Specifies that the resource can run InfoSphere Streams applications.
audit
Specifies that the resource can run the logging service.
authentication
Specifies that the resource can run the authentication and authorization service.
jmx
Specifies that the resource can run the management API service.
management
Specifies that the resource can run any of the InfoSphere Streams domain and instance management services.
sws
Specifies that the resource can run the web management service.
view
Specifies that the resource can run the view service.
You can define extra tags that meet your needs.

When InfoSphere Streams assigns management services to the resources, the resources are considered in the order in which they are stated by the resource identification options. When the --hfile option is used, resources that are explicitly specified in the file are considered before resources that are specified in --numresources options.

If you have a long list of command options and instance properties, you can use the --propfile option. This option is also helpful if you want to use the same set of options or properties in multiple streamtool mkinstance commands.

After you create an instance, by default only the instance owner can change the configured resources and properties. The instance owner can also start and stop the instance. You can authorize more users to configure and administer the instance by using the Streams Console or the streamtool setacl command.

Options and arguments

--admin-grp group
Specifies a group whose members can administer the instance. This group is added to the InstanceAdministrator role. If this option is not specified, only the following users can administer the instance:
  • Users that have the DomainAdministrator or InstanceAdministrator roles.
  • The user that ran the streamtool mkinstance command, or the user that is specified in the -U or --User option.
-d, --domain-id did
Specifies the domain identifier.

If you do not specify this option, InfoSphere Streams uses the domain name that is set in the STREAMS_DOMAIN_ID environment variable. By default, that domain name is StreamsDomain. If you are using the interactive streamtool interface, it uses the name of the active domain for the current streamtool session or else it prompts you for the domain name.

The active domain for the current streamtool session is set every time that you successfully run a streamtool command with a -d or --domain-id option. Alternatively, you can run the streamtool domain command in the interactive interface.

--embeddedzk

Specifies to use the embedded copy of ZooKeeper. This option is not supported within the interactive streamtool interface.

If you are not using the interactive streamtool interface and you do not specify either this option or the --zkconnect option, InfoSphere Streams uses the ZooKeeper connection that is associated with the active domain or the domain that is specified in the --domain-id option. InfoSphere Streams determines which connection maps to the domain by using cached information about the domains. In this scenario, if the domain identifier is not unique in the InfoSphere Streams configuration cache, the command fails.

-h, --help
Specifies to show the command syntax.
--hfile host-file
Specifies the path to a file, which can contain host identifiers and --numresources specifications.
A host identifier can be a host name or IP address. The host name can be a simple or fully qualified domain name.Each host identifier must be on a separate line in the file. The host specification syntax is:
hostname
Note: This syntax differs from the syntax in previous releases of InfoSphere Streams, where you could specify tags with the host names. If you use the old syntax, the command returns an error.

You can use the --numresources option to specify the number of resources without having to specify host identifiers. InfoSphere Streams selects the specified number of resources from a list of available resources.

Explicit hosts are added to the instance immediately. When the instance starts, resources that were specified in a --numresources specification are assigned to the instance based on their tags.

Hosts that are identified by host specifications in a host file are treated as 'exclusive' in the sense that they cannot be used to satisfy --numresources specifications.

The file can also contain comment lines (blank lines or lines where the first non-whitespace character is a '#').

For example:
host1
1.3.45.6
--numresources 1,authentication[exclusive]
--hosts host
Specifies one or more host identifiers. A host identifier can be a host name or IP address.
-i, --instance-id iid
Specifies the instance identifier.

If you do not specify this option, InfoSphere Streams uses the instance identifier that is set in the STREAMS_INSTANCE_ID environment variable. By default, that instance identifier is StreamsInstance. If you are using the interactive streamtool interface, it tries to use an instance ID that you specified in a previous command. If no such value is found, the command uses the STREAMS_INSTANCE_ID environment variable. Alternatively, you can run the streamtool instance command in the interactive interface.

--numresources number,tag sharing-mode
Specifies to get the designated number of available resources from the domain. You can also specify optional host selection criteria. Valid values for sharing-mode include [exclusive] and [shared].
The --numresources specification syntax is:
<number-of-resources><optional-selection-tags><optional-sharing-mode>
where <number-of-resources> is a number greater than 0, <optional-selection-tags> is ',tag,...' and <optional-sharing-mode> is [shared] or [exclusive].
Examples of --numresources specifications are:
  • --numresources 2, which is a shared request for two hosts with the 'execution' or no tags.
  • --numresources 2[exclusive], which is an exclusive request.
  • --numresources 1,ingest, which is a shared request for one host with the 'ingest' tag.
  • --numresources 1,ingest[exclusive], which is an exclusive request.

The specification can indicate a sharing mode: [shared] or [exclusive]. Specifications are shared by default. Resources that are selected by a shared specification can be used to satisfy other shared specifications.When an instance adds a resource by using an exclusive specification, the resource cannot be used by other instances in the domain.

The resource selection processing strives to select the least number of available resources that satisfy all of the --numresources specifications.

--property name=value
Specifies a property name and value pair to add to the configuration. This option can be specified multiple times and has an additive effect.
--propfile property-file
Specifies the path for a file that contains a list of instance properties and command options, each on a separate line. You can specify:
  • Command options and their values. For example: admin-grp=myGrp
    Note:
    • You must use the long version of the command option.
    • If the list includes domain-id, instance-id, or zkconnect options, they are ignored.
    • Options that you specify at the command line override values that were specified in this property file.
  • Instance properties and their values. For example: property.1=instanceTrace.defaultLevel=warn
    Note: The property statements must each have a unique number.
    For a list of instance properties, see streamtool man properties.
If the command options or values are invalid, or are not relevant to this command, they are ignored. If the properties are domain or boot properties, or they are instance properties but have invalid values, the command fails.
--trace level
Specifies the trace setting. The following valid levels are listed in order of increasing verbosity, which is to say that the first level in the list generates the least amount of information:
  • off
  • error
  • warn
  • info
  • debug
  • trace
The default value is off.
-U, --User userid
Specifies an InfoSphere Streams user ID that has authority to run the command.
--user-grp group
Specifies a group whose members can use the instance. This group is added to the InstanceUser role. If this option is not specified, only the following users can use the instance:
  • Users that have the InstanceUser role.
  • The user that ran the streamtool mkinstance command, or the user that is specified in the -U or --User option.
-v,--verbose level
Specifies to provide more detailed command output. The vebosity level can be from 0 to 3 where each increment provides more detailed output.
--zkconnect host:port

The name of one or more host and port pairs that specify the configured ZooKeeper servers. This option is not supported within the interactive streamtool interface.

If you are not using the interactive streamtool interface and you do not specify this option, InfoSphere Streams tries to use:
  1. The --embeddedzk option
  2. The value from the STREAMS_ZKCONNECT environment variable
  3. A ZooKeeper connection string that is derived from cached information about the current domain.

Examples

The following command creates an instance that is called myInstance and allocates hostA and hostB to the instance:
streamtool mkinstance -i myInstance --hosts hostA,hostB --numresources 1,management
When the instance is started, a resource that is tagged as "management" is also assigned to the instance.