Sike interview - Dubbo Basics 37 Q (must master)

As a JAVA engineer, project out to take 20kpay more, dubbo interview will definitely ask, even if you do not understand the role of dubbo on the project architecture, but also the basics of dubbo must master.

Finishing share some basic knowledge dubbo interview asked the Central Standing Committee, may give interviewing, preparing for interviews junior partner a little help.

1. What dubbo that?

dubbo is based on high-performance distributed services rpc Ali java open source framework, is now (2018) became the Apache Software Foundation incubator project

2, Why A dubbo (technology selection, when you consider how to use it)?

Ali because it is open-source projects, many domestic Internet are using. It has passed the test of a lot line. Internal use of Netty, Zookeeper ensure the high performance and high availability.
Use Dubbo can be extracted out of the core business, as an independent service, and gradually form a stable service center, can be used to improve service multiplexing flexibility to expand, front-end applications to more quickly respond to changing market demands.

3, Dubbo protocol (which is recommended by?)

dubbo (NIO recommended the use of a single long connection multiplexing, and concurrent processing thread pool requests, reducing handshake and concurrent increase efficiency, better performance (recommended)), http, redis, webservice, rmi, hessian, thrift, memcached , rest (tone you would say)

4, Dubbo WEB container need it?

No, If you insist on using it will only add complexity, it will be a waste of resources

5, Dubbo built several service container?

  • Spring Contaniner
  • Jetty Container
  • Log4j Container

Dubbo service container is a simple Main method, and load a simple Spring container for exposed services.

6, Dubbo there are several nodes which role?

Node Role Description

  • Service Provider exposed the service provider
  • Consumer invoke a remote service consumer services
  • Registry service registration and discovery registries
  • Monitor the number of calls and call time statistical services monitoring center run container Container Service

7, draw a picture service registration with the flow chart found?
Here Insert Picture Description

8, Dubbo what registry, there are other options use default it?

  • Recommended Zookeeper (Zookeeper is Apacahe Hadoop subprojects, is a tree of directory services to support change push for registry services as Dubbo, higher industrial strength, can be used in a production environment, and is recommended.) As a registration center
  • redis (internal Ali did not use Redis as a registration center, but the use of registry-based database of their own to achieve, namely: Redis
    registry does not guarantee the reliability of long-running internal Ali, only to realize this bridge open source Redis version provides, its reliability depends on the reliability of Redis itself) is not recommended

simple, mukticast (Multicast registry does not need to start any central node, as long as the broadcast address, you can find each other.) but not recommended

9, Dubbo, which has several configurations?

  • XML deployment
  • API configuration
  • Notes Configuration
  • Configuration Properties

10.Dubbo core configuration What?

Configuration instructions

  • dubbo: service Service Configuration
  • dubbo: method Method Configuration
  • dubbo: protocol protocol configuration
  • dubbo: provider provider configuration
  • dubbo: consumer consumer Configuration
  • dubbo: application application name
  • dubbo: reference reference configuration
  • dubbo: registry registry configuration
  • dubbo: argument parameter configuration
  • dubbo: mudule module configuration
  • dubbo: monitor configuration monitoring center

(What few are able to say the least commonly do not know necessarily unfamiliar)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.3.xsd http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd">  
    <!--服务名称-->
    <dubbo:application name="hello-world-app"  />  
     <!--注册中心地址配置-->
    <dubbo:registry address="multicast://224.5.6.7:1234" />  
     <!--协议配置-->
    <dubbo:protocol name="dubbo" port="20880" />  
     <!--服务配置-->
    <dubbo:service interface="com.alibaba.dubbo.demo.DemoService" ref="demoServiceLocal" />  
     <!--引用配置-->
    <dubbo:reference id="demoServiceRemote" interface="com.alibaba.dubbo.demo.DemoService" />  
</beans>

11, on the side of the property Consumer Provider can configure what?

Several key:

  • timeout: Timeout Method Invocation
  • retries: failure retry, retry the default 2
  • loadbalance: load balancing algorithm, the default random (random) (roundrobin, leastactive, ConsisitenHash, respectively: robin, least active call, consistent Hash)
  • actives: the consumer side, the maximum limit of concurrent calls
<dubbo:service interface="com.alibaba.hello.api.HelloService" version="1.0.0" ref="helloService"
   timeout="300" retry="2" loadbalance="random" actives="0" />
 
<dubbo:service interface="com.alibaba.hello.api.WorldService" version="1.0.0" ref="helloService"
    timeout="300" retry="2" loadbalance="random" actives="0" >
    <dubbo:method name="findAllPerson" timeout="10000" retries="9" loadbalance="leastactive" actives="5" />
<dubbo:service/>

12, when dependent Dubbo start if service is not available how do?

Dubbo default checks depend on the service is available at startup, will throw an exception is unavailable, stop Spring initialization is complete, the default check = "true", you can check by close examination = "false".

13, what serialization framework Dubbo recommended, you know What?

Hessian recommended serialization, which is based on the underlying Hessian, there 0Dubbo, fastJson, java own serialization

14, Dubbo default what communications framework, there are other options?

The default is the Netty framework, also recommended, as well as Mina ,, Grizzly

15, Dubbo, which has several fault-tolerant cluster scheme, the default is what?

Fault-tolerant cluster program narrative

  • Failover Cluster automatic switching fails, the other servers automatically retry (default)
  • Failfast Cluster fail-fast, error immediately, only to launch a call
  • When Failsafe Cluster security failure, abnormal, direct ignored
  • Failback Cluster automatic recovery fails, the failure record request, the retransmission timer
  • Failking Cluster Parallel call multiple servers, as long as a success and return
  • Failcast Cluster-by-call all broadcast providers, any one error is an error

16, Dubbo, which has several load balancing strategy, the default is what kinds?

As mentioned earlier, random (default), polling, a minimum number of active, consistent Hash

17, registered more with the same service, if it detects a certain specified services?

You can configure point-environmental direct, bypassing the registration center, will serve as the interface unit, ignoring the provider registry list.
Registered more with the same service, if it detects a certain specified services?

18, Dubbo multi-protocol support it?

Dubbo configure multiple protocol support, support in different services on different protocols or the same service supports multiple protocols.

19, when a service interface to achieve a variety of how to do?

Can be used to divide property group, service providers and consumers can be assigned to the same group.

20, service on the line how compatible with older versions?

You can use the version number (version) excessive number of different versions of the service registered to the registry, the version number of different services does not refer to each other. This grouping of concepts and similar services

21, Dubbo can cache the results?

Can, Dubbo provides declarative cache to accelerate popular data access speed, in order to reduce the workload of the user to load the cache

22, calls between Dubbo service is blocking it?

The default is to wait for the result of obstruction of synchronous, asynchronous invocation support.

23, Dubbo to support distributed transactions do?

Support (2018) but immature production environment can not be used

24, what Dubbo telnet command do?

Servicing governance

25, Dubbo Support Services downgrade it?

Dubbo2.2.0 more support

26, Dubbo how elegant downtime?

Dubbo is done elegantly down by shutDownHook jdk, so if using a Kill-9 PID and other compulsory closing command is not executed elegant downtime, but through the kill PID, will be performed.

27, the service providers can realize what failure is kicked out of principle?

Failure kicked out of the service node based on the principle of temporary Zookeeper

28, how to solve the problem of long-chain service call?

Dubbo can use Apache Skywalking Pinpoint and implementation of distributed service tracking

29, recommended reading and writing service fault-tolerant strategy is what?

Read recommended Failover failure automatic switching, fast write operation is recommended Failfst failure, and a failure to immediately call an error

30, Dubbo must rely on the package what?

Dubbo must rely JDK, other optional

31, what Dubbo management console can do?

Routing rules, dynamic configuration, service degradation, access control, weight adjustment, load balancing, and other management functions

32, Dubbo exposed service process?

Dubbo will be after the Spring instances finish of the bean, when the refresh container last step transmit ContextRefreshEvent event notification to achieve the export method ApplicationListener of serviceBean classes callback onApplicationEvent event methods, Dubbo calls ServiceBean parent ServiceConfig in this method, and this method truly publishing services

33, the difference between Dubbo and dubbox of?

Dubbox is the second stop Dubbo maintenance, Dangdang based dubbo do a application expansion

34, you have to find out about other distributed framework it?

springcloud,facebook的Thrift,teitter的finagle

35, Dubbo it can integrate Spring Cloud?

Possible

36, those problems encountered in use?

Dubbo designed to meet the high concurrent call rpc small amount of data, the performance in the big data is not good, it is recommended to use rmi or http protocol

37, do you think make good use Spring Cloud dubbo or good?

Not good or bad, only the fit I tend to Dubbo, Spring Cloud update too fast, too complicated to configure, not as good as one of us is always something alien things easily

Focus on micro-channel public number: [something] in the programmer, 2000G free access to learning materials, containing a selection of face questions, SSM, Spring family bucket, micro-services, MySQL, MyCat, clusters, distributed, middleware, Linux, network , multi-threaded, Jenkins, Nexus, Docker, ELK and so free learning videos, continuously updated!

Guess you like

Origin www.cnblogs.com/chengxy-nds/p/12217433.html