--bootstrap-server must be specified for --all
时间: 2024-09-12 17:06:16 浏览: 264
当在使用`kafka-topics.sh` 或其他Kafka CLI工具时,看到`--bootstrap-server must be specified for --all`这样的错误,它意味着你没有提供`--bootstrap-server`或`-b`选项,而这个选项是必需的,尤其是在执行需要连接到整个Kafka集群的操作,比如创建主题、管理配置或查看集群状态时。
`--bootstrap-server`或`-b`选项用于指定Kafka集群的元数据服务地址,也就是ZooKeeper的地址,ZooKeeper负责维护集群的配置信息。如果你想要对整个集群进行操作,需要明确告诉工具去哪里查找集群节点。
例如,一个完整的命令行示例可能是:
```sh
kafka-topics.sh --create --topic my-topic --partitions 1 --replication-factor 1 -b localhost:9092 --zookeeper localhost:2181
```
这里,`localhost:9092`就是`--bootstrap-server`值,`localhost:2181`则是`--bootstrap-server`,工具就无法知道如何找到实际的Kafka服务器来进行操作。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![.zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![.zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)