Install zookeeper and Dubbo preliminary integration under windows

Zookeeper installation and configuration (stand-alone version):

1. Download the latest version of zookeeper, download address https://zookeeper.apache.org/ Select the latest release version. I downloaded zookeeper-3.4.10.tar.gz and it can be used directly by decompressing it

2. Enter the conf subdirectory under the zookeeper root directory and create zoo.cfg, the initial content is as follows

tickTime=2000    

dataDir=D:/apache-zookeeper/zookeeper-3.4.10/data    

dataLogDir=D:/apache-zookeeper/zookeeper-3.4.10/logs    

 

clientPort=2181

Parameter Description:

  • tickTime: The basic time unit used in zookeeper, in milliseconds.
  • dataDir: The data directory. Can be any directory.
  • dataLogDir: log directory, which can also be any directory. If this parameter is not set, the same settings as dataDir will be used.
  • clientPort: The port number that listens for client connections.

3. Enter the bin directory under zookeeper and execute zkServer.cmd to start the server. Next, execute zkCli.cmd -server localhost:2181 in the cmd window to see if you can connect.

 Deployment and construction of dubbox:

1. Get the dubbox source code from github    https://github.com/dangdangdotcom/dubbox/

2. Execute mvn install -Dmaven.test.skip=true in the dubbox directory from the checkout to try to compile the dubbox. I compiled it once (note that using mvn install directly cannot be successful)

3. Import the project into eclipse once, you can use eclipse to import the maven project, or directly execute mvn eclipse:eclipse in the root directory of dubbox and then import eclipse

4. Use maven install or maven generate-source directly in eclipse to build the dubbo-admin project, copy the built project directory to the tomcat webapp directory (note that it is better to use tomcat version 7.0 or above), and modify the dubbo.properties file under the project , dubbo.registry.address=zookeeper://127.0.0.1:2181 (the port number here is the same as the clientPort configured by zookeeper ), start tomcat to access the project, the username and password are root, and enter the dubbo management console

5. Run the DemoProvider in the /dubbo-demo/dubbo-demo-provider/…/test directory with the IDE to start the dubbo server. At present, he will start the dubbo protocol (including serialization with kryo and FST) and the REST protocol service respectively.

6. Run the DemoConsumer in the /dubbo-demo/dubbo-demo-consumer/…/test directory with IDE to start the dubbo client and call the above server, and look at the console output directly

7. Use the IDE to run the RestClient in the /dubbo-demo/dubbo-demo-consumer/…/test directory to start the rest client (simulate a non-dubbo rest client) to call the above server, and look directly at the console output.

Note: The project code should be utf-8. If the default is not utf-8, some projects may report errors and the above steps 5, 6, and 7 cannot be executed correctly.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326557036&siteId=291194637