我已经使用以下命令启动了zookeeper和Kafka:
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
当我尝试获取Schema Registry兼容性设置(向后,向前,无)时,我在curl命令下运行:
curl -X GET http://localhost:8081/config
预期:
{"compatibility":"BACKWARD"}
结果:
curl: (7) Failed to connect to localhost port 8081: Connection refused
如何找出要使用的端口?
答案 0 :(得分:1)
似乎您只启动了Zookeeper和Kafka,但没有启动Schema Registry。
如果您确实启动了它,并在端口8081的终端输出中看到它正在监听,那么curl应该可以工作
您可以参考Schema Registry configuration来设置端口(或listeners
)