简体   繁体   English

在Java中启动独立的Zookeeper服务器

[英]start standalone zookeeper server in java

I am not able to figure out how to start zookeeper standalone server in java ? 我不知道如何在Java中启动Zookeeper独立服务器? I know how to start the server with command line. 我知道如何使用命令行启动服务器。 I looked into the documentation of zookeeper but couldn't able to find anything related to this. 我查看了zookeeper的文档,但找不到与此相关的任何内容。

Nice to read that somebody is trying to implement a highly reliable application using Apache Zookeeper. 很高兴听到有人试图使用Apache Zookeeper实现高度可靠的应用程序。

If you've worked with Sockets (Java networking) before, you shouldn't have problems. 如果您以前使用过Sockets(Java网络),那么应该不会有问题。 If in any case, you can find many samples on Internet. 无论如何,您都可以在Internet上找到许多示例。 A very basic one I can provide you as an example is this one: 我可以为您提供一个非常基本的示例:

http://www.tutorialspoint.com/java/java_networking.htm http://www.tutorialspoint.com/java/java_networking.htm

If you already known Java Networking programming, there should not be any problems to you to adapt server and client to a Zookeeper environment. 如果您已经知道Java Networking编程,那么将服务器和客户端适应Zookeeper环境应该不会有任何问题。 It is like adding "a plugin". 就像添加“插件”一样。

I implemented an application based on zookeeper sometime ago, it is better when you "wrap" zookeeper, many known Web Systems (such Netflix) uses this framework but they "wrap" it instead of using it pure. 之前我实现了一个基于Zookeeper的应用程序,当您“包装” Zookeeper时会更好,许多已知的Web系统(例如Netflix)都使用此框架,但是他们“包装”而不是单纯地使用它。 Anyway, when zookeeper appeared as a requirement, this tutorial helped me a lot: 无论如何,当Zookeeper成为必需品时,本教程对我有很大帮助:

http://sleeplessinslc.blogspot.com/2012/01/apache-zookeeper-maven-example.html http://sleeplessinslc.blogspot.com/2012/01/apache-zookeeper-maven-example.html

All the information and bases you need to know about zookeeper, for sure, you know, can find it in the Web Page: 您需要了解的有关Zookeeper的所有信息和基础,可以肯定的是,可以在以下网页中找到它们:

http://zookeeper.apache.org/doc/trunk/ http://zookeeper.apache.org/doc/trunk/

I also obtained many useful information from that documentation. 我还从该文档中获得了许多有用的信息。 For sure, the application I implemented almost a year ago is running perfectly and it is very fast and reliable. 当然,我将近一年前实现的应用程序运行良好,并且非常快速,可靠。

There are many examples on the web, many tutorials, even when REST Service providers. Web上有很多示例,即使REST服务提供者也有很多教程。 But for me, these work the best and were very useful during the time I was implementing that zookeeper based application. 但是对我来说,这些工作效果最好,并且在我实施基于Zookeeper的应用程序时非常有用。

Hope, somehow, I was able to help you. 希望以某种方式,我能够为您提供帮助。

Best regards and happy coding. 最好的问候和愉快的编码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM