apache / dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
https://dubbo.apache.org/
Apache License 2.0
40.48k stars 26.43k forks source link

升级到2.6.1版本后,是默认使用curator连接吗? #1753

Closed ghost closed 6 years ago

ghost commented 6 years ago

原来是使用dubbo的2.5.6的版本,用zkclient进行连接,是能正常启动及运行的,但是在文件上传的时候报rpc错误,看到2.6.1版本是支持kryo的序列化,升级后启动就出现以下问题,(如下面的问题),到了org.apache.curator.framework.state.ConnectionStateManager -State change: CONNECTED 这一行,就没办法继续往下走了,请问这个问题是怎么解决的?

2018-05-08 17:47:46.904 INFO  [RMI TCP Connection(3)-127.0.0.1]com.ueq.mq.core.rocketmq.listener.OnsListenerInit -*****************获取MQ配置数据开始**************************
2018-05-08 17:47:47.105 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.curator.framework.imps.CuratorFrameworkImpl -Starting
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:host.name=ueq-mhj
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.version=1.8.0_131
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.vendor=Oracle Corporation
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.home=E:\Program Files\Java\jdk1.8.0_131\jre
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.class.path=E:\ueq\deploy\apache-tomcat-8.5.15\bin\bootstrap.jar;E:\ueq\deploy\apache-tomcat-8.5.15\bin\tomcat-juli.jar;C:\Users\Administrator\AppData\Local\Temp\capture2332jars\debugger-agent.jar
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.library.path=E:\Program Files\Java\jdk1.8.0_131\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;D:\Program Files\Java\jdk1.7.0_79\bin;D:\Program Files\Java\jdk1.7.0_79\jre\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;E:\ueq\deploy\jboss-6.1.0.Final\bin;C:\Program Files\IDM Computer Solutions\UltraEdit;C:\Program Files (x86)\IDM Computer Solutions\UltraCompare\;.
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.io.tmpdir=E:\ueq\deploy\apache-tomcat-8.5.15\temp
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:java.compiler=<NA>
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:os.name=Windows 7
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:os.arch=amd64
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:os.version=6.1
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:user.name=Administrator
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:user.home=C:\Users\Administrator
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Client environment:user.dir=E:\ueq\deploy\apache-tomcat-8.5.15\bin
2018-05-08 17:47:47.120 INFO  [RMI TCP Connection(3)-127.0.0.1]org.apache.zookeeper.ZooKeeper -Initiating client connection, connectString=10.10.8.239:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@45c544de
2018-05-08 17:47:47.151 INFO  [RMI TCP Connection(10.10.8.239:2181)]org.apache.zookeeper.ClientCnxn -Opening socket connection to server 10.10.8.239/10.10.8.239:2181. Will not attempt to authenticate using SASL (unknown error)
2018-05-08 17:47:47.151 INFO  [RMI TCP Connection(10.10.8.239:2181)]org.apache.zookeeper.ClientCnxn -Socket connection established to 10.10.8.239/10.10.8.239:2181, initiating session
2018-05-08 17:47:47.167 INFO  [RMI TCP Connection(10.10.8.239:2181)]org.apache.zookeeper.ClientCnxn -Session establishment complete on server 10.10.8.239/10.10.8.239:2181, sessionid = 0x1633e81b37c001d, negotiated timeout = 40000
2018-05-08 17:47:47.183 INFO  [RMI TCP Connection(3)-127.0.0.1-EventThread]org.apache.curator.framework.state.ConnectionStateManager -State change: CONNECTED
ghost commented 6 years ago

dubbo的配置已改成

生产者配置是 <dubbo:service retries="2" interface="com.ueq.module.system.api.sysquerysql.SysQuerysqlService" ref="sysQuerysqlService" protocol="dubbo" cluster="failfast"/>

客户端配置是

ghost commented 6 years ago

我是使用spring-boot的加dubbo配置

dubbo的pom配置是

<dependencies>
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>dubbo</artifactId>
        <version>2.6.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>3.4.9</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
            <exclusion>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.20.0-GA</version>
    </dependency>

    <dependency>
        <groupId>org.jboss.netty</groupId>
        <artifactId>netty</artifactId>
        <version>3.2.5.Final</version>
    </dependency>

    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.0.35.Final</version>
        <scope>provided</scope>
    </dependency>
    <!-- 
    <dependency>
        <groupId>com.101tec</groupId>
        <artifactId>zkclient</artifactId>
        <version>0.2</version>
    </dependency>
    -->
    <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-framework</artifactId>
        <version>2.12.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.curator</groupId>
        <artifactId>curator-client</artifactId>
        <version>2.12.0</version>
    </dependency>

    <dependency>
        <groupId>com.esotericsoftware</groupId>
        <artifactId>kryo</artifactId>
        <version>4.0.2</version>
    </dependency>

    <dependency>
        <groupId>de.javakaffee</groupId>
        <artifactId>kryo-serializers</artifactId>
        <version>0.42</version>
    </dependency>

    <!--
    <dependency>
        <groupId>com.caucho</groupId>
        <artifactId>hessian</artifactId>
        <version>4.0.51</version>
    </dependency>
    -->

</dependencies>
ralf0131 commented 6 years ago

Are you still getting this error?

ralf0131 commented 6 years ago

I believe this issue has been solved.

ryuhi commented 6 years ago

是的,到2.6.1之前就改成默认Zookeeper客户端是Curator了。你可以看下Github上各个Release的说明,那上面有,不在文档里

polarisGitHub commented 4 years ago

这个问题我解决了。注意curator和zk的版本配合。我zk用3.4.x,curator使用2.13.0没有问题。再网上升级就是卡在ConnectionStateManager -State change: CONNECTED