streamtool addhost
Usage
addhost [-d,--domain-id <did>] [-i,--instance-id
<instance>] {[--hfile <host-file>] | [--numresources
<number[,tag,...]["[exclusive]" | "[shared]"] where number >
0>] ... | [<hostname> ... | <hostname>,...]}
[-U,--User <user>] [-h,--help] [--trace <level>]
[-v,--verbose <level>] [--zkconnect
{<host>:<port>},... | --embeddedzk] [<hostname>
... | <hostname>,...]
The streamtool addhost command adds one or more static Streams resources to an instance.
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 static Streams host 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. This command does not apply to resources that are obtained from an external resource manager.
Tags can affect the selection of static and dynamic resources at instance creation time and when resources are added to an instance.
Streams defines the following tags:
- application
- Specifies that the resource can run 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 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.
Adding an asterisk (*) to the tag name indicates that you want a resource with the tag restricted.
By default, no tags are added to resources.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 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, 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
- -d,--domain-id <did>
- Specifies the domain identifier.
If you do not specify this option, 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, Streams uses the ZooKeeper connection that is associated with the active domain or the domain that is specified in the --domain-id option. 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 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
This syntax differs from the syntax in previous releases of 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. 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.
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]
- -i,--instance-id <instance>
- Specifies the instance identifier.
If you do not specify this option, 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,...]["[exclusive]" | "[shared]"] where number > 0>
- Specifies to get the designated number of available resources
from the domain. You can also specify optional resource selection
criteria.
The --numresources specification syntax is:
number-of-resources,optional-selection-tags optional TagRestriction marker[optional-sharing-mode]
where number-of-resources is a number greater than 0, optional-selection-tags is',tag,...'
, optional TagRestriction marker is * (asterisk), 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*
, which is a shared request for one host with the 'ingest' tag and a TagRestriction between the new resource and this 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 specification can indicate a restriction between a tag and a resource. An asterisk (*) on the tag name provides the marker for this TagRestriction.
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
off
. - -U,--User <user>
- Specifies an Streams user ID that has authority to run the command.
- -v,--verbose <level>
- Specifies to provide more detailed command output. The
verbosity level can be
0
-3
, where0
disables detailed reporting and 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, Streams tries to use:
- The --embeddedzk option
- The value from the STREAMS_ZKCONNECT environment variable
- A ZooKeeper connection string that is derived from cached information about the current domain.
Arguments
- hostname
- Specifies the host name or IP address for a host in the 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. ...