Setup Kafka CLI Helper Scripts - theryanwatson/confluent-kafka-scripts GitHub Wiki
To use the k-* Kafka Helper Scripts:
- Run this command to copy the latest
__k-functionsandk-*scripts to your~/binfolder.mkdir -p "${HOME}/bin/"; \ for SCRIPT in __k-functions k-avro-console-consumer k-avro-console-producer k-console-consumer k-console-producer k-consumer-groups k-copy-schema k-topics; do \ rm -f "${HOME}/bin/${SCRIPT}"; \ wget "https://raw.githubusercontent.com/theryanwatson/confluent-kafka-helpers/main/bin/${SCRIPT}" -P "${HOME}/bin/"; \ chmod +x "${HOME}/bin/${SCRIPT}"; \ done; - If not already added, add your home bin path to your
~/.profile(and restart or source the file, as needed)# set PATH so it includes user's private bin if it exists if [ -d "${HOME}/bin" ] ; then PATH="${HOME}/bin:$PATH" fi - Setup your Local Confluent Platform, including adding the
${CONFLUENT_HOME}environment variable and Confluent Bin to your~/.profile. - Create
~/.ccloud/{{ env-prefix }}.configfiles for each environment you wish to use, according to the Confluent CLI Tools Config. e.g.qa.config,qa2.config,prod.config, etc. For example:ssl.endpoint.identification.algorithm=https security.protocol=SASL_SSL sasl.mechanism=PLAIN request.timeout.ms=20000 retry.backoff.ms=500 sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username\="{{ username }}" password\="{{ password }}"; bootstrap.servers={{ host }}.us-east-1.aws.confluent.cloud\:9092 #schema.registry=http://{{ path }}- NOTE the addition of the commented out
schema.registry=URL. This is used by the k-avro-console-consumer and k-avro-console-producer wrappers.
- NOTE the addition of the commented out