Hey,
To create an Ephemeral Znode, add -e flag as shown below:-
Syntax:-
create -e /path /data
Sample:-
create -e /SecondZnode “Ephemeral-data”
Output:-
[zk: localhost:2181(CONNECTED) 2] create -e /SecondZnode “Ephemeral-data”
Created /SecondZnode
Remember when a client connection is lost, the ephemeral znode will be deleted. You can try it by quitting the ZooKeeper CLI and then re-opening the CLI.