Have you wondered how the experts use Streams? Are you sick of typing in your domain and instance names? Luckily, by intelligently using environment variables, you can significantly streamline your Streams life.

Give the interactive streamtool a try

Streams 4.0 has a great new feature called the interactive streamtool interface. Give this a try before resorting solely to using environment variables. For details, watch these short clips:

Stop typing your domain and instance names

Most of us work within one instance within one domain. If this is the case, you can forget your instance and domain names by exporting them to the Linux environment. My .bashrc file has these two lines that save me time every day:

export STREAMS_DOMAIN_ID=cooka_domain
export STREAMS_INSTANCE_ID=cooka_instance

Almost certainly, we only ever use one ZooKeeper ensemble. You can export that as well:

export STREAMS_ZKCONNECT=somehost1:2181,somehost2:2181,somehost3:2181

streamtool takes too long to type

Why not alias streamtool to something shorter? Aliasing ‘streamtool’ to ‘st’ reduces typing, as well as the chances of making a typo:

alias 'st'='streamtool'

Typing in my username and password for every command gets old

First, you need to run a genkey on your domain for your user. This will take care of the password.

Second, if your Streams user is an LDAP user different from your UNIX user, setting the STREAMS_USER_ID variable will take care of filling in your username. For example:

My UNIX user: cooka (Streams will try to pick this up as your default user id.)
My LDAP user: cooka_ldap

export STREAMS_USER_ID=cooka_ldap #now Streams knows to use my LDAP user as the default

 What do you do to make your Streams life easier?

Let us know what you do to make your Streams life easier by commenting below!

Do you have suggestions on how we could make your Streams life easier? Comment below and you might see it in the next release.

Did this help you? We would love to hear how!

Join The Discussion