Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

从2.7.0升级到2.7.1发现的BUG #3770

Closed
2 tasks done
liunancun opened this issue Mar 29, 2019 · 10 comments
Closed
2 tasks done

从2.7.0升级到2.7.1发现的BUG #3770

liunancun opened this issue Mar 29, 2019 · 10 comments
Labels
type/bug Bugs to being fixed
Milestone

Comments

@liunancun
Copy link
Contributor

liunancun commented Mar 29, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.1
  • Operating System version: CentOS Linux release 7.6.1810 (Core)
  • Java version: 1.8

Steps to reproduce this issue

  1. yml配置文件
dubbo:
  application:
    name: bessky-boot-service
  protocol:
    name: dubbo
    port: 28300
  scan:
    basePackages: com.bessky
  registry:
    address: zookeeper://192.168.99.230:2181
  1. 测试接口
public interface HelloService {
	String hello(String name);
}
  1. 接口实现类
@Service
public class HelloServiceImpl implements HelloService {
	@Override
	public String hello(String name) {
		System.out.println(name);
		return "Hello, " + name;
	}
}

4.启动类

@SpringBootApplication
public class BesskyBootServiceApplication {
	public static void main(String[] args) {
		SpringApplication.run(BesskyBootServiceApplication.class, args);
	}
}

5.将Spring BOOT工程打包上传到CentOS服务器测试

问题1:注册到ZK上的地址变成了127.0.0.1,回退到Dubbo的2.7.0版本是能正确获取到网卡IP地址的。
执行hostname命令结果是localhost.localdomain
/etc/hosts文件内容是
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
这种配置在2.7.0上是可以正确获取到网卡IP地址的

问题2:注册到ZK上的服务都变成了静态服务

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

1、正常获取到网卡IP地址
2、动态服务

Actual Result

服务地址: dubbo://127.0.0.1:28300/com.bessky.hello.service.HelloService?anyhost=true&application=bessky-boot-service&bean.name=providers:dubbo:com.bessky.hello.service.HelloService&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.bessky.hello.service.HelloService&methods=hello&pid=181167®ister=true&release=2.7.1&side=provider×tamp=1553819455170
主机名: (localhost)127.0.0.1:28300
所属端: provider
方法列表: hello
release: 2.7.1
deprecated: false
Dubbo版本: 2.0.2
进程号: 181167
default.dynamic: false
接口名: com.bessky.hello.service.HelloService
generic: false
default.deprecated: false
应用名: bessky-boot-service
default.register: true
动态: false
绑定所有IP: true
bean.name: providers:dubbo:com.bessky.hello.service.HelloService
申请注册: true
时间戳: 2019-03-29 08:30:55 (1553819455170)
类型: 静态
状态: 已启用
检查: 警告

@lexburner
Copy link
Contributor

lexburner commented Apr 3, 2019

dubbo 2.7.1 add an ipv4 check to avoid local site address:

public boolean isSiteLocalAddress() {
        // refer to RFC 1918
        // 10/8 prefix
        // 172.16/12 prefix
        // 192.168/16 prefix
        int address = holder().getAddress();
        return (((address >>> 24) & 0xFF) == 10)
            || ((((address >>> 24) & 0xFF) == 172)
                && (((address >>> 16) & 0xF0) == 16))
            || ((((address >>> 24) & 0xFF) == 192)
                && (((address >>> 16) & 0xFF) == 168));
    }

I am not sure this change is suitable, but maybe this change bring your probelm.

@ylylc
Copy link

ylylc commented Apr 10, 2019

额我也遇到,只能退回去

@lovepoem lovepoem added the type/bug Bugs to being fixed label Apr 10, 2019
@wmlz
Copy link

wmlz commented Apr 11, 2019

我也遇到第二个问题,从2.7.0升级到2.7.1后,服务变成了静态,注册中心同样是zookeeper

@beiwei30 beiwei30 added this to the 2.7.2 milestone Apr 12, 2019
@CjqDy
Copy link

CjqDy commented Apr 12, 2019

原来版本 dubbo 2.6.5 + nacos 注册消费没有问题
注册地址为:dubbo://192.168.121.110:20880/com.orange.service.DemoService?XXX
192.168.121.110 为本机ip
换成dubbo 2.7.1后
注册地址改变
dubbo://169.254.121.227:20880/com.orange.service.DemoService?XXX
169.254.121.227为系统保留地址 注册失败

只有退回原来版本,。。。。。。。。

@chickenlj
Copy link
Contributor

I will try to figure out the potential problem.

@chickenlj chickenlj self-assigned this Apr 12, 2019
@beiwei30
Copy link
Member

dynamic: #3785
local address: #3802

@lovepoem
Copy link
Member

#3784

@byronzoz
Copy link

#3923

@cvictory
Copy link
Contributor

cvictory commented May 6, 2019

This issue is duplicated with #3785 and #3802 .

@beiwei30
Copy link
Member

beiwei30 commented May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

10 participants