IBM InfoSphere Streams Version 4.1.0

streamtool addhost

The streamtool addhost command adds one or more resources to an instance.

Usage

Read syntax diagramSkip visual syntax diagram
addhost

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

>--+--------------------------------------------------------------+-->
   +- --hfile--host-file------------------------------------------+   
   | .----------------------------------------------------------. |   
   | V                                                          | |   
   +--- --numresources--number--+-----------+--+--------------+-+-+   
   |                            |   .-,---. |  '-sharing-mode-'   |   
   |                            |   V     | |                     |   
   |                            '-,---tag-+-'                     |   
   | .-+---+----.                                                 |   
   | | '-,-'    |                                                 |   
   | V          |                                                 |   
   '---hostname-+-------------------------------------------------'   

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

>--+---------------------+--+-----------------------+----------->
   '-+- -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 hosts instance object. By default, the DomainAdministrator and InstanceAdministrator roles have this authority. For more information about access control lists, see streamtool getacl.

Description

You can specify the resources to add by using --hfile or --numresources options, or by listing the host names or IP addresses and tags. The host name can be a simple or fully qualified domain name.

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.
By default, no tags are added to resources.
Note: The tags that you specify in this command must exist. For more information about creating tags, see streamtool man mktag.

If the instance is started, the appropriate InfoSphere Streams services are started on the resources. Otherwise, the services are started when you start the instance. If there are problems starting one or more services, the resource is added to the instance configuration but cannot be used until the services are started successfully.

You can use the streamtool rmhost or streamtool rmresourcespec commands to remove resources from the instance.

If you specify the --numresources option, InfoSphere Streams allocates new resources from the domain; it does not use existing resources in the instance to satisfy this specification.

If a host file contains host names or IP addresses that are already resources in the instance, the command returns a warning and that host specification is ignored.

A warning is generated if any hosts in a host file include service placement control specifications and the host's service placement control specifications are ignored.

Options and arguments

-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]
hostname
Specifies the host name or IP address for a host in the domain.
-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.

--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.
-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 example adds a resource specification to an instance:
[streamtool <bsmith@StreamsDomain.StreamsInstance>] addhost --numresources 1,application
CDISC0164I InfoSphere Streams is adding the following resource specification identifier to
the StreamsInstance instance: 3[1,application[shared]].
The instance is in the LCLDAP domain.
...