Connecting to MSK Serverless From Outside VPC

0

After setting up VPC peering, I tried connecting to MSK serverless via the Kafka Client,but the error is coming as address is not resolvable

./kafka-topics.sh --list --bootstrap-server boot-xxxxxx.x3.kafka-serverless.ap-southeast-1.amazonaws.com:9098 --command-config client.properties
[2023-07-17 05:09:43,153] WARN Couldn't resolve server boot-xxxxxx.x3.kafka-serverless.ap-southeast-1.amazonaws.com:9098 from bootstrap.servers as DNS resolution failed for boot-pkzowg6y.c3.kafka-serverless.ap-southeast-1.amazonaws.com (org.apache.kafka.clients.ClientUtils)
Exception in thread "main" org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient
	at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:540)
	at org.apache.kafka.clients.admin.Admin.create(Admin.java:134)
	at kafka.admin.TopicCommand$AdminClientTopicService$.createAdminClient(TopicCommand.scala:229)
	at kafka.admin.TopicCommand$AdminClientTopicService$.apply(TopicCommand.scala:233)
	at kafka.admin.TopicCommand$.main(TopicCommand.scala:58)
	at kafka.admin.TopicCommand.main(TopicCommand.scala)
Caused by: org.apache.kafka.common.config.ConfigException: No resolvable bootstrap urls given in bootstrap.servers
	at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:89)
	at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:48)
	at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:494)
	... 5 more

I have verified the working of VPC peering.

  1. what can be wrong here ?
  2. Is it possible to connect to MSK serverless offering outside VPC ? if yes, how can it be done.

Thanks.

1 Answer
0

Are "enableDnsHostnames" and "enableDnsSupport" enabled in the VPC where MSK Serverless is running?
I thought perhaps if this was not enabled, name resolution could not be performed on the DNS name and a connection could not be made.
https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames
https://docs.aws.amazon.com/ja_jp/msk/latest/developerguide/msk-connect-dns.html

profile picture
EXPERT
answered 10 months ago
  • yes, they both are enabled, I checked similar stuff for "Provisioned" MSK and that works

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions