【Zk】Zk创建空节点 不带数据的

在这里插入图片描述

1.背景

[zk: localhost:2181(CONNECTED) 9] create /scram
[zk: localhost:2181(CONNECTED) 10] ls  /scram
Node does not exist: /scram

这样操作不报错,也不会创建节点,可以使用 ls / 命令去查看;

原因是需要设置节点的值,如果节点的值为空,则命令为 create /test ""

双引号不能省略;

[zk: localhost:2181(CONNECTED) 18] create /scram ""
Created /scram
[zk: localhost:2181(CONNECTED) 19] ls /
[cluster, cheetah-server-job-1.0, brokers, zookeeper, kafka-acl, kafka-acl-changes, admin, isr_change_notification, dubbo, log_dir_event_notification, scram, controller_epoch, kafka_cluster_local, consumers, latest_producer_id_block, config]
[zk: localhost:2181(CONNECTED) 20]

猜你喜欢

转载自blog.csdn.net/qq_21383435/article/details/107857404
zk
今日推荐