Dubbo official website address:

dubbo.apache.org/en-us/

Dubbo user Documentation:

Dubbo.apache.org/en-us/docs/…

Zookeeper

zookeeper.apache.org/

Introduction to the

Dubbo(ʌbə) is an open source high-performance service framework of Alibaba, enabling applications to achieve the output and input functions of services through high-performance RPC, which can be seamlessly integrated with the Spring framework.

Dubbo is a high-performance, lightweight, open source Java RPC framework that provides three core capabilities: interface-oriented remote method invocation, intelligent fault tolerance and load balancing, and automatic service registration and discovery.

ZooKeeper is a distributed, open source distributed application coordination service. It is an open source implementation of Google’s Chubby and an important component of Hadoop and Hbase. It provides consistency services for distributed applications, including configuration and maintenance, domain name service, distributed synchronization, and group service.

Reference: Baidu Encyclopedia

Zookeeper download

Apache ZooKeeper 3.4.14 Apache ZooKeeper 3.4.14 Apache ZooKeeper 3.4.14 Apache ZooKeeper 3.4.14

Visit the official website and click Download under Getting Started

1. Download and decompress ZooKeeper-3.4.14.tar. gz

2. Double-click zkserver. CMD in the bin directory (zkserver.sh in Linux).

3. We will find a flash during the operation, indicating that the startup error

4. Use an editing tool to open the zkserver. CMD file and add pause at the end

5. Double-click zkserver. CMD to view error information

Conf file zoo. CFG not found.

2020-09-07 15:19:44.974 [myid:] -error [main:QuorumPeerMain@88] -invalid config, exiting abnormally org.apache.zookeeper.server.quorum.QuorumPeerConfig$ConfigException: Error processing C: \ Users \ \ Desktop \ zookeeper 12583-3.4.14 \ zookeeper - 3.4.14 \ bin \.. \conf\zoo.cfgCopy the code

6. Find the conf directory:

CFG file zoo_sample. CFG, this is a demo file, zookeeper official meaning, this is a demo configuration file, we can customize the configuration, so directly change zoo_sample. CFG to zoo.cfg;

7. Restart the zkserver. CMD file in the bin directory

Startup successful!

Dubbo uses the local service Spring configuration

local.xml:

<bean ID = "xxxService" class= "com.xxx.XxxServiceImpl" /> <bean ID = "xxxAction" class= "com.xx.xxxAction" > <property Name = "xxxService ref =" xxxService "/" > < / bean >Copy the code

Remote service Spring configuration

On the basis of the local service, only a simple configuration is required to complete the remote:

Split the local.xml configuration above into two parts, placing the service definition part on the service provider remote-provider.xml and the service reference part on the service consumer remote-consumer.xml.

Add exposed service configuration on the provider and reference service configuration on the consumer.

remote-provider.xml:

<! <bean id= "xxxService" class= "com.xxx.XxxServiceImpl" /> <! <dubbo:service interface= "com.xxx.xxxService" ref= "XxxService" />Copy the code

remote-consumer.xml:

<! <dubbo:reference ID = "xxxService" interface= "com.xxx.xxxService" /> <! Class = "com.xxx.xxxAction" > <property name= "xxxService" ref= "xxxService" /> </bean>Copy the code

Focus, don’t get lost

If you think the article is good, please pay attention to it, like it, and save it. Your support is the motivation for my creation. Thank you all.

If there is a problem with the article, please don’t be stingy, welcome to point out the message, I will check and modify in time.

If you want to know more about me, you can follow me by searching “The Way of Java Little White Counterattack” on wechat. Reply “benefits” to get 2000 GIGABytes of Java from the beginning to the god of dry goods. Push technical articles every day, so that your commute is not lonely, and there are monthly book activities to help you improve your hard power!