How to connect to ksqldb cluster using bash command line

Hi Team,

As per my testing i have created a free confluent cloud ui and have connectors and ksqldb.

i want to access that ksqldb cluster in azure build pipelines (with basic command line task)

i have used curl command to install confluent platform.
but still unable to login to confluent cloud or connect to ksqldb.

Please help me in setting up this and connect to my ksqldb cluster.

Command line script:
curl -O http://packages.confluent.io/archive/7.0/confluent-7.0.1.tar.gz

tar -xzf confluent-7.0.1.tar.gz
rm confluent-7.0.1.tar.gz
echo “extracted package”

export CONFLUENT_HOME=./confluent-7.0.1
export PATH=$PATH:$CONFLUENT_HOME/bin

export CONFLUENT_CLOUD_EMAIL="cloudusername@gmail.com"
export CONFLUENT_CLOUD_PASSWORD=“cloudpassword”

sudo apt-get install -y expect

Write expect script

cat < login.exp
spawn confluent login --prompt
expect “Email:”
send “$CONFLUENT_CLOUD_EMAIL\n”
expect “Password:”
send “$CONFLUENT_CLOUD_PASSWORD\n”
interact
EOF

Execute the expect script

expect login.exp

sed -i 's/^bootstrap.servers=./bootstrap.servers=pkc-4j8dq.southeastasia.azure.confluent.cloud:9092:$(kafkabroker_port)/’ ./confluent/etc/ksqldb/ksql-#server.properties

sed -i ‘s/^listeners=0.0.0.0:8088/listeners=pkc-4j8dq.southeastasia.azure.confluent.cloud/lkc-zj3p53:8088/’ ./confluent*/etc/ksqldb/ksql-server.properties

$CONFLUENT_HOME/bin/ksql -u -p Restendpoint << EOF
show streams;
EOF

Please help me asap,
Thanks.

This topic was automatically closed after 30 days. New replies are no longer allowed.