You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/12/16 05:49:59 UTC

[GitHub] [shardingsphere-elasticjob] AwordArrive opened a new issue #1779: Zookeeper connection failed

AwordArrive opened a new issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779


   ## 依赖
   		<dependency>
   			<groupId>org.apache.shardingsphere.elasticjob</groupId>
   			<artifactId>elasticjob-lite-spring-boot-starter</artifactId>
   			<version>3.0.0-alpha</version>
   		</dependency>
   ## zookeeper version
   3.6.2
   ## Exception description
   ![图片](https://user-images.githubusercontent.com/52400896/102310197-7cbf5600-3fa5-11eb-9015-9da0751a61d2.png)
   
   org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'zookeeperRegistryCenter' defined in class path resource [org/apache/shardingsphere/elasticjob/lite/spring/boot/reg/ElasticJobRegistryCenterConfiguration.class]: Invocation of init method failed; nested exception is org.apache.shardingsphere.elasticjob.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.8.RELEASE.jar:5.2.8.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   	at com.example.elasticjob.ElasticjobApplication.main(ElasticjobApplication.java:10) [classes/:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181]
   	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.3.3.RELEASE.jar:2.3.3.RELEASE]
   Caused by: org.apache.shardingsphere.elasticjob.reg.exception.RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-745785015


   Make sure your Zookeeper cluster is available. Consider specifying `connectionTimeout` and other parameter.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN closed issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN closed issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] AwordArrive commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
AwordArrive commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-751307407


   > 
   > 
   > I meet totally the same problem.how can i fix it? o(╥﹏╥)o
   
   > Did you configure jobs? After I configured jobs, there was no problem


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-749291952


   This issue seems not our problem. You may Google it or ask on StackOverflow.
   I found something may help.
   https://blog.csdn.net/dfsgwe1231/article/details/107264264


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN edited a comment on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN edited a comment on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-745785015


   Make sure your Zookeeper cluster is available. Consider specifying `connectionTimeout` and other parameters.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] lizanle521 commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
lizanle521 commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-748985721


   public class ConfigRegistryCenterFactory {
   
       private static final Map<HashCode, CoordinatorRegistryCenter> REG_CENTER_REGISTRY = new ConcurrentHashMap<>();
   
       /**
        * Create a {@link CoordinatorRegistryCenter} or return the existing one if there is one set up with the same {@code connectionString}, {@code namespace} and {@code digest} already.
        *
        * @param connectString registry center connect string
        * @param namespace registry center namespace
        * @param digest registry center digest
        * @return registry center
        */
       public static CoordinatorRegistryCenter createCoordinatorRegistryCenter(final String connectString, final String namespace, final String digest) {
           Hasher hasher = Hashing.sha256().newHasher().putString(connectString, StandardCharsets.UTF_8).putString(namespace, StandardCharsets.UTF_8);
           if (!Strings.isNullOrEmpty(digest)) {
               hasher.putString(digest, StandardCharsets.UTF_8);
           }
           HashCode hashCode = hasher.hash();
           return REG_CENTER_REGISTRY.computeIfAbsent(hashCode, unused -> {
               CoordinatorRegistryCenter result = newCoordinatorRegistryCenter(connectString, namespace, digest);
               result.init();
               return result;
           });
       }
   
       private static CoordinatorRegistryCenter newCoordinatorRegistryCenter(final String connectString,
                                                                             final String namespace,
                                                                             final String digest) {
           final ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(connectString, namespace);
           if (!Strings.isNullOrEmpty(digest)) {
               zkConfig.setDigest(digest);
           }
           
           // connect to zk cluster slowly can cause this problem, set MaxSleepTimeMilliseconds can solve it 
           zkConfig.setMaxSleepTimeMilliseconds(30000);
           return new ZookeeperRegistryCenter(zkConfig);
       }
   }


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] lsiuf commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
lsiuf commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-746010535


   elasticjob version: 3.0.0-beta
   zookeeper version: 3.6.2
   curator version: 5.1.0
   
   I also encountered the same problem, now increase the following configuration value temporarily to solve this problem.
   `elasticjob.reg-center.max-retries: 10`


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] qaqLjj commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
qaqLjj commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-751254483


   I meet totally the same problem.how can i fix it?    o(╥﹏╥)o


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] lizanle521 commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
lizanle521 commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-748920118


   i also encontered the same problem .but problem still exist after have  add the configuration elasticjob.reg-center.max-retries: 10
   
    in yaml file. my test program work correctly 
   DEBUG] 19:12:12.182 [http-nio-8088-exec-7-SendThread(10.136.143.77:8181)] org.apache.zookeeper.ClientCnxn - Got auth session id: 0x1008aba465105dd
   [DEBUG] 19:12:12.182 [http-nio-8088-exec-7-SendThread(10.136.143.77:8181)] org.apache.zookeeper.ClientCnxn - Got auth session id: 0x1008aba465105dd
   [DEBUG] 19:12:12.182 [http-nio-8088-exec-7-SendThread(10.136.143.77:8181)] org.apache.zookeeper.ClientCnxn - Reading reply session id: 0x1008aba465105dd, packet:: clientPath:null serverPath:null finished:false header:: 1,-11  replyHeader:: 1,12885156709,0  request:: null response:: null
   [DEBUG] 19:12:12.183 [http-nio-8088-exec-7] org.apache.zookeeper.ClientCnxn - Disconnecting client for session: 0x1008aba465105dd
   [WARN ] 19:12:12.183 [http-nio-8088-exec-7-SendThread(10.136.143.77:8181)] org.apache.zookeeper.ClientCnxn - An exception was thrown while closing send thread for session 0x1008aba465105dd.
   org.apache.zookeeper.ClientCnxn$EndOfStreamException: Unable to read additional data from server sessionid 0x1008aba465105dd, likely server has closed socket
   	at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:77)
   	at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
   	at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1275)
   [INFO ] 19:12:12.286 [http-nio-8088-exec-7] org.apache.zookeeper.ZooKeeper - Session: 0x1008aba465105dd closed


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-749275751


   Try configure `connectionTimeout` like
   ```yaml
   elasticjob:
     regCenter:
       connection-timeout-milliseconds: 10000
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] AwordArrive edited a comment on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
AwordArrive edited a comment on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-745794876


   There is no problem with Zookeeper, and the test program to connect to Zookeeper can be connected.
   
   ## Zookeeper配置
   ![图片](https://user-images.githubusercontent.com/52400896/102312856-74b5e500-3faa-11eb-8333-ac9cc34917d1.png)
   
   ## yml配置
   
   ![图片](https://user-images.githubusercontent.com/52400896/102313072-dd9d5d00-3faa-11eb-858d-bed251502e75.png)
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] AwordArrive edited a comment on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
AwordArrive edited a comment on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-745794876


   There is no problem with Zookeeper, and the test program to connect to Zookeeper can be connected.
   
   ## Zookeeper配置
   ![图片](https://user-images.githubusercontent.com/52400896/102312856-74b5e500-3faa-11eb-8333-ac9cc34917d1.png)
   
   `# The number of milliseconds of each tick
   tickTime=4000
   # The number of ticks that the initial 
   # synchronization phase can take
   initLimit=10
   # The number of ticks that can pass between 
   # sending a request and getting an acknowledgement
   syncLimit=5
   # the directory where the snapshot is stored.
   # do not use /tmp for storage, /tmp here is just 
   # example sakes.
   dataDir=/tmp/zookeeper
   # the port at which the clients will connect
   clientPort=2181`
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-755921041


   It seems this issue has already done, I'm closing this issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] AwordArrive commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
AwordArrive commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-745794876


   There is no problem with Zookeeper, and the test program to connect to Zookeeper can be connected.
   
   ## Zookeeper配置
   ![图片](https://user-images.githubusercontent.com/52400896/102312856-74b5e500-3faa-11eb-8333-ac9cc34917d1.png)
   
   # The number of milliseconds of each tick
   tickTime=4000
   # The number of ticks that the initial 
   # synchronization phase can take
   initLimit=10
   # The number of ticks that can pass between 
   # sending a request and getting an acknowledgement
   syncLimit=5
   # the directory where the snapshot is stored.
   # do not use /tmp for storage, /tmp here is just 
   # example sakes.
   dataDir=/tmp/zookeeper
   # the port at which the clients will connect
   clientPort=2181
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] qaqLjj commented on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
qaqLjj commented on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-751455268


   > > I meet totally the same problem.how can i fix it? o(╥﹏╥)o
   > 
   > > Did you configure jobs? After I configured jobs, there was no problem
   
   I finally find the problem. It is my ZK's version too old! my dear company is using 3.5.x !


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere-elasticjob] TeslaCN removed a comment on issue #1779: Zookeeper connection failed

Posted by GitBox <gi...@apache.org>.
TeslaCN removed a comment on issue #1779:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/1779#issuecomment-749275751


   Try configure `connectionTimeout` like
   ```yaml
   elasticjob:
     regCenter:
       connection-timeout-milliseconds: 10000
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org