Primary knowledge curator-instance must be started before calling this method

Source: Internet
Author: User

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 ().

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.