Sign inSign up

bmwilli1/streams-jmx-client

By bmwilli1

•Updated about 5 years ago

IBM Streams Command Line Interface using Streams JMX API and does not require local Streams install

Image
0

1.3K

bmwilli1/streams-jmx-client repository overview

⁠streams-jmx-client

This application provides a command-line interface to the IBM Streams - Stream Processing System. This program functions similar to the streamtool command that is included with IBM Streams, however, this application uses a pure JMX interface and can be run on any java platform and does not require the IBM Streams installation on the same host.

Reasons for using this application include

  • Interacting with IBM Streams from a lightweight container (e.g. Docker container)
  • Interacting with IBM Streams running inside of a continer hosting environment (e.g. Kubernetes)

The application supports an interactive mode (similar to streamtool interactive mode)

The initial set of commands focus on interacting with Streams in a container hosting environment.

Requests for additional commands are welcome and contributions are encouraged.

⁠Commands

CommandDescription
canceljobCancel Streams application
getdomainpropertyGet values of domain properties
getdomainstateGet the state of the Streams domain
getinstancestateGet the state of the Streams instance
getpropertyGet values of instance properties
gettagDisplay resource definition for a tag
helpDisplay commands or specific commands arguments
lsjobsGet a list of the jobs running in an instance
lspesReport health summary for each PE
lstagList tags defined for a domain
mktagCreate a resource tag in a domain with description and resource definition
rmtagRemove a resource tag from a domain
setdomainpropertySet one or more property values for a domain
setpropertySet one or more property values for an instance
snapshotjobsCapture a snapshot of jobs running in an instance
submitjobSubmit Streams application to run in a Streams instance
versionDisplay version information

⁠Running with Docker

The latest docker container is published to Docker Hub: https://hub.docker.com/r/bmwilli1/streams-jmx-client/⁠

  1. Create .env file:

The env file simplifies connectivity. IT is a file of key=value pairs. See the command usage options for the environment variables used to set each option.

The following example was used to connect to Streams 4.3 QuickStart for Docker running in Docker for Mac. The domain property jmx.httpPort was set to 8006 (A port exposed by default in the Streams 4.3 Docker instructions).

STREAMS_CLIENT_JMXCONNECT=service:jmx:jmxmp://172.17.0.2:9975
STREAMS_CLIENT_USERNAME=streamsadmin
STREAMS_CLIENT_PASSWORD=passw0rd
STREAMS_CLIENT_JMX_SSLOPTION=TLSv1.2
STREAMS_DOMAIN_ID=StreamsDomain
STREAMS_INSTANCE_ID=StreamsInstance

A complete documented sample one can be found here: https://github.com/IBMStreams/streamsx.jmxclients/blob/master/streams-jmx-client/docker/sample.env⁠

  1. Get the domain state
docker run --rm -it --env-file mydocker.env bmwilli1/streams-jmx-client:1.0.0 getdomainstate
  1. Submit a job (requires mounting the .sab file into the container)
docker run --rm -it --env-file mydocker.env -v ${PWD}/HelloWorld.sab:/opt/HelloWorld.sab bmwilli1/streams-jmx-client submitjob /opt/HelloWorld.sab
  1. Run interactive shell
docker run --rm -it --env-file mydocker.env bmwilli1/streams-jmx-client:1.0.0
Streams JMX Client INTERACTIVE MODE STARTED
streamsclient>

⁠Questions

For questions and issues, please contact:

Brian M Williams, IBM [email protected]⁠

⁠github

https://github.com/IBMStreams/streamsx.jmxclients/tree/develop/streams-jmx-client⁠

Tag summary

Content type

Image

Digest

Size

69.5 MB

Last updated

over 7 years ago

docker pull bmwilli1/streams-jmx-client