Start learning curator Zookeeper Open source client. Since the zookeeper native client is relatively low-level and inconvenient to use, Netflix has closed the Zookeeper client API, providing a framework that can replace the native zookeeper client--curator, just learning curator, is trying to use curator to write Znode node of the increase, delete, change, check, it is all the beginning difficult, the execution of the example error: Java.lang.IllegalStateException:instance must be started before Calling this method,curator gave me a flying start.
Maybe I was too novice to meet this problem-this error online information is not much. Now that the problem is solved, or the solution is recorded, in the case of a novice like me also encountered this problem, there are a number of ways to help.
Workaround:
1, using Curatorframework's factory function to generate the client;
2, before the operation of ZK, remember to perform start () to the client, start the client instance;
3, after the operation ZK completes, closes the client--close ().