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 2023/01/12 02:39:42 UTC

[GitHub] [shardingsphere] hua74ni opened a new issue, #23517: Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup register 10 JDBC worker

hua74ni opened a new issue, #23517:
URL: https://github.com/apache/shardingsphere/issues/23517

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   5.3.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   Hybrid Architecture, ShardingSphere-JDBC
   
   ### Expected behavior
   
   one ShardingSphere-JDBC startup and register **1** JDBC worker
   
   ### Actual behavior
   
   one ShardingSphere-JDBC startup and register **10** JDBC worker
   
   ### Reason analyze (If you can)
   
   There are doubts about the shardingSphere-JDBC startup initialization data source logic: datasource(tomcat) -> datasourcePool(tomcat,loop 10 times,Cause subsequent initialization and register for 10 times) -> Trigger shardingsphere driver (there is a cache in the middle logic that does not seem to meet the expected cache) -> register shardingSphere-JDBC worker(10 workers)
   
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   Hybrid Architecture of registry zookeeper, The configuration is on ShardingSphere-Proxy,  ShardingSphere-JDBC is configured in spring boot mode. document: https://shardingsphere.apache.org/document/5.3.0/cn/user-manual/shardingsphere-jdbc/yaml-config/jdbc-driver/spring-boot/
   
   
   ### Example codes for reproduce this issue (such as a github link).
   
   the ShardingSphere-JDBC configuration:
   
   **pom.xml**
   
   ![image](https://user-images.githubusercontent.com/27909365/211962337-ab40ac1a-6d23-4875-86bf-52055f6c4bd1.png)
   
   
   **Configure Spring Boot Properties**
   
   ```
   spring.datasource.driver-class-name=org.apache.shardingsphere.driver.ShardingSphereDriver
   spring.datasource.url=jdbc:shardingsphere:classpath:shardingsphere.yaml
   ```
   
   **shardingsphere.yaml**
   
   ```
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: governance
         server-lists: localhost:2181
   
   databaseName: database_name
   ```
   
   
   framework: Springboot 1.5.22 + Jpa
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

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


Re: [I] Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #23517:
URL: https://github.com/apache/shardingsphere/issues/23517#issuecomment-2267517994

   The issue involves other third-party dependencies, but our focus is solely on ShardingSphere itself. Since ShardingSphere implements the JDBC interface, standard applications should be functional. We wish to allocate more effort towards enhancing the current version, and therefore will no longer handle such issues. Please read the documentation or provide more effective information when submitting an 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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] hua74ni commented on issue #23517: Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers

Posted by GitBox <gi...@apache.org>.
hua74ni commented on issue #23517:
URL: https://github.com/apache/shardingsphere/issues/23517#issuecomment-1379742613

   ok, @zhaojinchao95 pom.xml:
   
   ```
   <properties>
           <shardingsphere.version>5.3.0</shardingsphere.version>
       </properties>
   
   <dependencies>
   
           <dependency>
               <groupId>com.netflix.hystrix</groupId>
               <artifactId>hystrix-javanica</artifactId>
               <version>1.5.12</version>
               <exclusions>
                   <exclusion>
                       <groupId>com.netflix.archaius</groupId>
                       <artifactId>archaius-core</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   
   
           <dependency>
               <groupId>com.xx</groupId>
               <artifactId>xx-apollo-starter</artifactId>
               <version>0.10.0</version>
               <exclusions>
                   <exclusion>
                       <groupId>org.yaml</groupId>
                       <artifactId>snakeyaml</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
           <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
           </dependency>
   
           <!--    spring    -->
           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-starter-zookeeper-config</artifactId>
               <exclusions>
                   <exclusion>
                       <groupId>org.apache.curator</groupId>
                       <artifactId>curator-recipes</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>org.apache.curator</groupId>
                       <artifactId>curator-framework</artifactId>
                   </exclusion>
                   <exclusion>
                       <groupId>org.apache.curator</groupId>
                       <artifactId>curator-client</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-data-jpa</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-web</artifactId>
           </dependency>
   
           <!-- test -->
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-test</artifactId>
               <scope>test</scope>
           </dependency>
           <dependency>
               <groupId>junit</groupId>
               <artifactId>junit</artifactId>
               <scope>test</scope>
           </dependency>
           <dependency>
               <groupId>org.apache.curator</groupId>
               <artifactId>curator-test</artifactId>
               <version>2.6.0</version>
               <scope>test</scope>
               <exclusions>
                   <exclusion>
                       <groupId>org.apache.zookeeper</groupId>
                       <artifactId>zookeeper</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   
           <dependency>
               <groupId>com.101tec</groupId>
               <artifactId>zkclient</artifactId>
               <version>0.10</version>
           </dependency>
   
           <!--    swagger    -->
           <dependency>
               <groupId>io.swagger</groupId>
               <artifactId>swagger-annotations</artifactId>
           </dependency>
           <dependency>
               <groupId>io.springfox</groupId>
               <artifactId>springfox-swagger2</artifactId>
           </dependency>
           <dependency>
               <groupId>io.springfox</groupId>
               <artifactId>springfox-swagger-ui</artifactId>
           </dependency>
           <dependency>
               <groupId>io.springfox</groupId>
               <artifactId>springfox-bean-validators</artifactId>
           </dependency>
   
           <!--    oauth2    -->
           <dependency>
               <groupId>org.springframework.security.oauth</groupId>
               <artifactId>spring-security-oauth2</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-security</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.security</groupId>
               <artifactId>spring-security-jwt</artifactId>
           </dependency>
           <dependency>
               <groupId>org.apache.commons</groupId>
               <artifactId>commons-text</artifactId>
               <version>1.6</version>
           </dependency>
           <dependency>
               <groupId>com.github.ben-manes.caffeine</groupId>
               <artifactId>caffeine</artifactId>
               <version>2.7.0</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>${shardingsphere.version}</version>
               <exclusions>
                   <exclusion>
                       <groupId>com.zaxxer</groupId>
                       <artifactId>HikariCP</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-cluster-mode-repository-zookeeper</artifactId>
               <version>${shardingsphere.version}</version>
           </dependency>
   
           <!--    引入 sharding-JDBC 版本依赖调整    -->
   
           <!--    引入 sharding-JDBC 依赖 guava 版本    -->
           <dependency>
               <groupId>com.google.guava</groupId>
               <artifactId>guava</artifactId>
               <version>30.0-jre</version>
           </dependency>
   
           <!--    引入 sharding-JDBC 依赖 snakeyaml 版本    -->
           <dependency>
               <groupId>org.yaml</groupId>
               <artifactId>snakeyaml</artifactId>
               <version>1.33</version>
           </dependency>
   
           <!--    引入 sharding-JDBC 依赖 zk、curator 版本    -->
           <dependency>
               <groupId>org.apache.curator</groupId>
               <artifactId>curator-recipes</artifactId>
               <version>5.1.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.curator</groupId>
               <artifactId>curator-framework</artifactId>
               <version>5.1.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.curator</groupId>
               <artifactId>curator-client</artifactId>
               <version>5.1.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.zookeeper</groupId>
               <artifactId>zookeeper</artifactId>
               <version>3.6.0</version>
           </dependency>
   
           <!--    HikariCP 线程池    -->
           <dependency>
               <groupId>com.zaxxer</groupId>
               <artifactId>HikariCP</artifactId>
               <version>3.4.2</version>
           </dependency>
   
           <!--    seata 分布式事物    -->
   <!--        <dependency>-->
   <!--            <groupId>org.apache.shardingsphere</groupId>-->
   <!--            <artifactId>shardingsphere-transaction-base-seata-at</artifactId>-->
   <!--            <version>5.2.1</version>-->
   <!--        </dependency>-->
   <!--        <dependency>-->
   <!--            <groupId>io.seata</groupId>-->
   <!--            <artifactId>seata-all</artifactId>-->
   <!--            <version>1.4.2</version>-->
   <!--        </dependency>-->
   
       </dependencies>
   ```


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


Re: [I] Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #23517: Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers
URL: https://github.com/apache/shardingsphere/issues/23517


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] hua74ni commented on issue #23517: Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers

Posted by GitBox <gi...@apache.org>.
hua74ni commented on issue #23517:
URL: https://github.com/apache/shardingsphere/issues/23517#issuecomment-1379853018

   It seems to be related to connection pool. There is no problem using **Hikari**, but there is a problem using the default **tomcat-jdbc** of spring boot 1.5.22. 


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #23517: Hybrid Architecture (version:5.3.0) one ShardingSphere-JDBC startup and register 10 JDBC workers

Posted by GitBox <gi...@apache.org>.
zhaojinchao95 commented on issue #23517:
URL: https://github.com/apache/shardingsphere/issues/23517#issuecomment-1379741165

   @hua74ni Can you show me your all maven `pom.xml` info?


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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