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 2022/01/05 02:28:42 UTC

[GitHub] [shardingsphere] zjcnb opened a new issue #14520: Just load remote datasources when use cluster mode overwrite is false.

zjcnb opened a new issue #14520:
URL: https://github.com/apache/shardingsphere/issues/14520


   ### Which version of ShardingSphere did you use?
   
   `master`
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   `ShardingSphere-JDBC`
   
   ### Expected behavior
   
   Just load remote datasources when use cluster mode overwrite is false.
   
   ### Actual behavior
   
   load remote datasources and local datasource when use cluster mode overwrite is false.
   
   ### Configuration
   
   ```
   spring.shardingsphere.props.sql-show=true
   spring.shardingsphere.datasource.ds-0.jdbc-url = jdbc:mysql://community:1231/demo_primary_ds?serverTimezone=UTC&useSSL=false
   spring.shardingsphere.datasource.ds-0.username=root
   spring.shardingsphere.datasource.ds-0.password=123456
   spring.shardingsphere.datasource.ds-0.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.ds-1.jdbc-url = jdbc:mysql://community:1232/demo_primary_ds?serverTimezone=UTC&useSSL=false
   spring.shardingsphere.datasource.ds-1.username=root
   spring.shardingsphere.datasource.ds-1.password=123456
   spring.shardingsphere.datasource.ds-1.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.ds-2.jdbc-url = jdbc:mysql://community:1233/demo_primary_ds?serverTimezone=UTC&useSSL=false
   spring.shardingsphere.datasource.ds-2.username=root
   spring.shardingsphere.datasource.ds-2.password=123456
   spring.shardingsphere.datasource.ds-2.type=com.zaxxer.hikari.HikariDataSource
   spring.shardingsphere.datasource.ds-2.driver-class-name=com.mysql.cj.jdbc.Driver
   
   spring.shardingsphere.datasource.names=ds-0,ds-1,ds-2
   
   spring.shardingsphere.rules.readwrite-splitting.data-sources.rd_rs.auto-aware-data-source-name=pr_ds
   
   spring.shardingsphere.rules.database-discovery.data-sources.pr_ds.data-source-names=ds-0, ds-1, ds-2
   spring.shardingsphere.rules.database-discovery.data-sources.pr_ds.discovery-heartbeat-name=mgr-heartbeat
   spring.shardingsphere.rules.database-discovery.data-sources.pr_ds.discovery-type-name=mgr
   
   spring.shardingsphere.rules.database-discovery.discovery-heartbeats.mgr-heartbeat.props.keep-alive-cron=0/5 * * * * ?
   spring.shardingsphere.rules.database-discovery.discovery-types.mgr.type=MGR
   spring.shardingsphere.rules.database-discovery.discovery-types.mgr.props.group-name=b13df29e-90b6-11e8-8d1b-525400fc3996
   
   spring.shardingsphere.mode.type=Cluster
   spring.shardingsphere.mode.repository.type=Zookeeper
   spring.shardingsphere.mode.repository.props.namespace=governance_ds
   spring.shardingsphere.mode.repository.props.server-lists=localhost:2181
   spring.shardingsphere.mode.overwrite=false
   ```
   
   ### Step
   
   First step, change datasources count is two, set overwrite = true. And then start up the app aplication, the dataSources configuration persist zk. It 's OK.
   
   Second step, change datasource count is three, set overwrite = false. And then start up the application, the init datasource not right.
   
   ```
   2022-01-05 10:10:16.017  INFO 28660 --- [ain-EventThread] o.a.c.framework.imps.EnsembleTracker     : New config event received: {}
   2022-01-05 10:10:16.017  INFO 28660 --- [ain-EventThread] o.a.c.framework.imps.EnsembleTracker     : New config event received: {}
   2022-01-05 10:10:16.116  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
   2022-01-05 10:10:17.695  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
   2022-01-05 10:10:17.707  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Starting...
   2022-01-05 10:10:17.884  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Start completed.
   2022-01-05 10:10:17.884  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Starting...
   2022-01-05 10:10:18.034  INFO 28660 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-3 - Start completed.
   2022-01-05 10:10:18.237  INFO 28660 --- [           main] org.quartz.impl.StdSchedulerFactory      : Using default implementation for ThreadExecutor
   2022-01-05 10:10:18.246  INFO 28660 --- [           main] org.quartz.core.SchedulerSignalerImpl    : Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
   2022-01-05 10:10:18.246  INFO 28660 --- [           main] org.quartz.core.QuartzScheduler          : Quartz Scheduler v.2.3.2 created.
   2022-01-05 10:10:18.246  INFO 28660 --- [           main] o.a.s.e.l.i.s.JobShutdownHookPlugin      : Registering Quartz shutdown hook. MGR-pr_ds
   2022-01-05 10:10:18.247  INFO 28660 --- [           main] org.quartz.simpl.RAMJobStore             : RAMJobStore initialized.
   2022-01-05 10:10:18.247  INFO 28660 --- [           main] org.quartz.core.QuartzScheduler          : Scheduler meta-data: Quartz Scheduler (v2.3.2) 'MGR-pr_ds' with instanceId 'NON_CLUSTERED'
   ```
   
   I think it not right, because rule configuration used remote configuration, it's not use local configuration. 
   


-- 
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] menghaoranss closed issue #14520: Just load remote datasources when use cluster mode overwrite is false.

Posted by GitBox <gi...@apache.org>.
menghaoranss closed issue #14520:
URL: https://github.com/apache/shardingsphere/issues/14520


   


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