[ 
https://issues.apache.org/jira/browse/KAFKA-6851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17063259#comment-17063259
 ] 

Sönke Liebau commented on KAFKA-6851:
-------------------------------------

Hi [~peter.gergely.horv...@gmail.com] are you doing any work on this feature 
behind the scenes? Otherwise, I'd be willing to adopt this and create a KIP for 
it.

> Kafka CLI commands should support specifying the servers in environment 
> variables
> ---------------------------------------------------------------------------------
>
>                 Key: KAFKA-6851
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6851
>             Project: Kafka
>          Issue Type: Improvement
>          Components: clients
>    Affects Versions: 1.0.0, 1.0.1, 1.1.0
>         Environment: ALL
>            Reporter: Peter Horvath
>            Priority: Major
>
> Currently, different Kafka CLI commands require specifying different servers 
> as argument (--broker-list, --bootstrap-server and --zookeeper).
>  
> This is kind of tedious as different CLI commands require specifying 
> different servers, which is especially painful if the host names are *long*, 
> and *only slightly different* (e.g. naming scheme for AWS: 
> ec2-12-34-56-2.region-x.compute.amazonaws.com). 
>  
> I know I could simply export shell variables for each type of endpoint and 
> refer that in the command, but that still only eases the pain:
> export 
> KAFKA_ZK=[ec2-12-34-56-2.region-x.compute.amazonaws.com|http://ec2-12-34-56-2.region-x.compute.amazonaws.com/]
> bin/kafka-topics.sh --list --zookeeper ${KAFKA_ZK}
>  
> According to [some conversation on the Kafka mailing 
> list|http://mail-archives.apache.org/mod_mbox/kafka-users/201804.mbox/%3cca+usspag21mwufr146_hlvdyftuzjm4zfn1c5tnfjugjxag...@mail.gmail.com%3E]
>  (started by me), people usually resort to some kind of non-standardised 
> work-arounds (see replies to thread _Using Kafka CLI without specifying the 
> URLs every single time?_)
>  
>  
> When dealing with Kafka client CLI, it would be huge relief / productivity 
> boost if the CLI could pick up the servers from the user's environment 
> variables.
> For example, instead of using --broker-list, --bootstrap-server or 
> --zookeeper, the Kafka client commands could check if there is an environment 
> variable and use that in case the argument is missing. (allowing the 
> environment-defined server to still be overridden with an *explicit* 
> argument).
>  
> I propose introducing some kind of specific environment variables that would 
> allow the user to omit the explicit specification of the --broker-list, 
> --bootstrap-server and --zookeeper argument every single time a CLI command 
> is called. This would make using Kafka CLI much easier. 
>  
> ||CLI argument||Proposed environment variable name||
> |--broker-list|KAFKA_CLIENT_BROKER_LIST|
> |--bootstrap-server|KAFKA_CLIENT_BOOTSTRAP_SERVER|
> |--zookeeper|KAFKA_CLIENT_ZOOKEEPER|
> It should be possible to implement this solely at the wrapper shell script 
> level, with some checks being done that test if the variable is defined or 
> not.
>  
>  
>  
>  
>  
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to