This is the 28th day of my participation in the August Challenge

I. Introduction:

Apache Dubbo (incubating) | ˈ d ʌ b goes ʊ | is a high-performance, lightweight open source Java RPC framework, it provides three main core competencies: an interface of remote method invocation (rmi), intelligent fault tolerance and load balancing, and automatic registration and discovery of services.

website

1. Basic concepts

Provider: A service Provider that exposes a service. At startup, the service Provider registers its services with the registry.

Service Consumer: the service Consumer who invokes the remote service. When the service Consumer starts up, it subscribes to the registry for the service it needs. The service Consumer selects one provider from the provider address list and invokes it based on the soft load balancing algorithm.

Registry: The Registry returns a list of service provider addresses to the consumer. If there are changes, the Registry pushes the change data to the consumer based on the long connection

Monitor: Service consumers and providers accumulate call times and call time in memory and regularly send statistics to the monitoring center once a minute

Call Relationship Description

  • The service container is responsible for starting, loading, and running the service provider.

  • At startup, service providers register their services with the registry.

  • At startup, service consumers subscribe to the registry for the services they need.

  • The registry returns a list of service provider addresses to the consumer, and if there are changes, the registry pushes the change data to the consumer based on the long connection.

  • The service consumer, from the provider address list, selects one provider to call based on the soft load balancing algorithm. If the call fails, selects another one to call.

  • Service consumers and providers accumulate calls and call times in memory and regularly send statistics to the monitoring center every minute.

Second, environment building

1. Install ZooKeeper

1. Download ZooKeeper

Url archive.apache.org/dist/zookee…

2. Decompress ZooKeeper

Run zkserver. CMD, the first run will report an error, there is no zoo. CFG configuration file

F: tools development toolszookeeper- 3.4.11 \zookeeper- 3.4.11 \bin>zkServer.cmd
Copy the code

Modify the zoo. CFG configuration file

CFG file in conf and rename it zoo_sample. CFG.

A few important points to note:

DataDir =./ Directory for temporary data store (writable relative path)

ClientPort =2181 Port number of ZooKeeper

After the modification, start ZooKeeper again

4, use zkcli. CMD test, the premise is to run zkserver.cmd

F: tools development toolszookeeper- 3.4.11 \zookeeper- 3.4.11 \bin>zkCli.cmd
Copy the code

Ls / : Lists all nodes saved under the ZooKeeper root

Create -e /atguigu 123: Creates an atguigu node with the value 123

Get/ATguigu: obtains the value of the /atguigu node

2. Install the Dubo-admin admin console

Dubbo itself is not a service. Zookeeper is a JAR package that allows your Java application to connect to ZooKeeper and use ZooKeeper to consume and provide services. So you don’t have to start a Dubbo service on Linux.

But to make it easier for users to manage and monitor the many Dubbo services, officials have provided a visual monitoring program that will not affect use even if it is not installed.

1. Download dubo-admin

Address: github.com/apache/dubb…

2. Modify the dubo-admin configuration if it meets the default configuration

Access directory address:.. \dubbo-admin-master\dubbo-admin-master\dubbo-admin\src\main\resources

Dubbo. Registry. Address = zookeeper: / / 127.0.0.1:2181Copy the code

3. Pack dubo-admin

In the path.. \dubbo-admin-master\ dubbo-master \dubbo-admin Enter CMD console:

MVN clean package -dmaven.test. skip=trueCopy the code

4, Go to the packaged target folder and run Dubo-admin (assuming zkserver.cmd is running).

F: tools development toolsdubbo-admin-master\dubbo-admin-master\dubbo-admin\target>java -jar dubbo-admin- 0.0.1 -SNAPSHOT.jar
Copy the code