Failed to bind NettyServer on /169.254.116.120:20880, cause: Failed to bind to: /0.0.0.0:20880解决方案

Yesterday when building dubbo + zookeeper project, twice with the same port 20880 as a provider, the result is the port number is occupied.

There was a lot of online solutions:

Scheme 1: is a change in the port number 20880 dubboprovider.xml changed to another port, such as 20,881

Scenario 2: 20880 port services provided directly off before that reuse 20880

Scenario 3: Modify the tomcat server.xml in the property

<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">修改为:

<Host appBase="webapps" autoDeploy="false" deployOnStartup="false" name="localhost" unpackWARs="true">


But the above options are not to my satisfaction, then went dubbo official website to find a solution, or find a relatively elegant solution:

Posted a screenshot for thought:

 

 So the next goal has been very clear - there will provider.xml port = 20880 modified property value is -1

<dubbo:protocol name="dubbo" port="-1"></dubbo:protocol>

 This will solve the problem with a port number occupied, and there will be no repeat, again a rendering:

 

You can see the port number from 20880 increments indeed, but there is little need to think, is so multi-port auto-generated, how to maintain. If you have a better view, please add >>>

Guess you like

Origin www.cnblogs.com/timingstarts/p/12591397.html