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 2021/01/19 10:33:12 UTC
[GitHub] [shardingsphere] YanlongMa opened a new issue #9091: How to use etcd as config center
YanlongMa opened a new issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091
## Question
How to use etcd as config center in springboot?
can you give me a pox.xml dependency
----------------------------------------------------------------
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] YanlongMa edited a comment on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa edited a comment on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763313950
5.0.0-alpha can use on product environment ?
----------------------------------------------------------------
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] YanlongMa commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763313950
5.0.0-alpha can use in product environment ?
----------------------------------------------------------------
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] dongzl edited a comment on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
dongzl edited a comment on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763253058
Hi @YanlongMa , can you provide more detail info?
which version do you use?
ShardingShpere-jdbc or ShardingShpere-proxy ?
----------------------------------------------------------------
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] YanlongMa commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763256441
zookeeper config center is success, but etcd config center is error, I dont‘not how to add dependency in pom, can you help me, 3Q.
pom.xml
```
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-orchestration-spring-boot-starter</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<version>0.5.0</version>
</dependency>
```
properties
```
spring.shardingsphere.datasource.names=master,slave0,slave1
# master
spring.shardingsphere.datasource.master.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://127.0.0.1:3306/master?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=123456
# slave0
spring.shardingsphere.datasource.slave0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave0.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave0?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave0.username=root
spring.shardingsphere.datasource.slave0.password=123456
# slave1
spring.shardingsphere.datasource.slave1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave1.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave1?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave1.username=root
spring.shardingsphere.datasource.slave1.password=123456
# round_robin/random
spring.shardingsphere.masterslave.name=kushu_taishan
spring.shardingsphere.masterslave.master-data-source-name=master
spring.shardingsphere.masterslave.slave-data-source-names=slave0,slave1
spring.shardingsphere.masterslave.load-balance-algorithm-type=round_robin
# 打印 sql
spring.shardingsphere.props.sql.show=true
# etcd
spring.shardingsphere.orchestration.name=basic
spring.shardingsphere.orchestration.overwrite=true
spring.shardingsphere.orchestration.registry.type=etcd
spring.shardingsphere.orchestration.registry.namespace=kushu_taishan
spring.shardingsphere.orchestration.registry.server-lists=127.0.0.1:2379
```
error info
```
Caused by: java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.apache.shardingsphere.spi.TypeBasedSPIServiceLoader.newService(TypeBasedSPIServiceLoader.java:50) ~[shardingsphere-spi-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.RegistryCenterServiceLoader.load(RegistryCenterServiceLoader.java:52) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.ShardingOrchestrationFacade.<init>(ShardingOrchestrationFacade.java:58) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.internal.datasource.OrchestrationMasterSlaveDataSource.<init>(OrchestrationMasterSlaveDataSource.java:70) ~[sharding-jdbc-orchestration-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration.masterSlaveDataSourceByLocal(OrchestrationSpringBootConfiguration.java:144) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.CGLIB$masterSlaveDataSourceByLocal$3(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac$$FastClassBySpringCGLIB$$812f0b91.invoke(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.masterSlaveDataSourceByLocal(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_231]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_231]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_231]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_231]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 77 common frames omitted
```
----------------------------------------------------------------
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] dongzl commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763281476
@YanlongMa , `Etcd` as config center, is not very stable at `4.0.0` version, so I recommend use `Zookeeper` instead of `Etcd`.
But at the `5.0.0-alpha` version, `Etcd` as config center is stable, you can try it.
----------------------------------------------------------------
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] YanlongMa closed issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa closed issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091
----------------------------------------------------------------
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] dongzl commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763253058
Hi @YanlongMa , can you provide more detail info?
which version do you use?
----------------------------------------------------------------
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] djession commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
djession commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763390924
@dongzl btw:when will 5.0.0-rc or stable be released?
----------------------------------------------------------------
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] YanlongMa edited a comment on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa edited a comment on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763256441
zookeeper config center is success, but etcd config center is error, I dont‘not how to add dependency in pom, can you help me, 3Q.
pom.xml
```
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-orchestration-spring-boot-starter</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<version>0.5.0</version>
</dependency>
```
properties
```
spring.shardingsphere.datasource.names=master,slave0,slave1
# master
spring.shardingsphere.datasource.master.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://127.0.0.1:3306/master?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=123456
# slave0
spring.shardingsphere.datasource.slave0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave0.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave0?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave0.username=root
spring.shardingsphere.datasource.slave0.password=123456
# slave1
spring.shardingsphere.datasource.slave1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave1.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave1?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave1.username=root
spring.shardingsphere.datasource.slave1.password=123456
# round_robin/random
spring.shardingsphere.masterslave.name=kushu_taishan
spring.shardingsphere.masterslave.master-data-source-name=master
spring.shardingsphere.masterslave.slave-data-source-names=slave0,slave1
spring.shardingsphere.masterslave.load-balance-algorithm-type=round_robin
# sql
spring.shardingsphere.props.sql.show=true
# etcd
spring.shardingsphere.orchestration.name=basic
spring.shardingsphere.orchestration.overwrite=true
spring.shardingsphere.orchestration.registry.type=etcd
spring.shardingsphere.orchestration.registry.namespace=kushu_taishan
spring.shardingsphere.orchestration.registry.server-lists=127.0.0.1:2379
```
error info
```
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'masterSlaveDataSourceByLocal' defined in class path resource [org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/OrchestrationSpringBootConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'masterSlaveDataSourceByLocal' threw exception; nested exception is java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:799) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:540) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1509) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 49 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'masterSlaveDataSourceByLocal' defined in class path resource [org/apache/shardingsphere/shardingjdbc/orchestration/spring/boot/OrchestrationSpringBootConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'masterSlaveDataSourceByLocal' threw exception; nested exception is java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:637) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:886) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:790) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 62 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'masterSlaveDataSourceByLocal' threw exception; nested exception is java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 76 common frames omitted
Caused by: java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.apache.shardingsphere.spi.TypeBasedSPIServiceLoader.newService(TypeBasedSPIServiceLoader.java:50) ~[shardingsphere-spi-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.RegistryCenterServiceLoader.load(RegistryCenterServiceLoader.java:52) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.ShardingOrchestrationFacade.<init>(ShardingOrchestrationFacade.java:58) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.internal.datasource.OrchestrationMasterSlaveDataSource.<init>(OrchestrationMasterSlaveDataSource.java:70) ~[sharding-jdbc-orchestration-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration.masterSlaveDataSourceByLocal(OrchestrationSpringBootConfiguration.java:144) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.CGLIB$masterSlaveDataSourceByLocal$3(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac$$FastClassBySpringCGLIB$$812f0b91.invoke(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.masterSlaveDataSourceByLocal(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_231]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_231]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_231]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_231]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 77 common frames omitted
Process finished with exit code 1
```
----------------------------------------------------------------
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] dongzl commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
dongzl commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763400537
> @dongzl btw:when will 5.0.0-rc or stable be released?
Hi @djession , There is not accurate time yet, but the `5.0.0-alpha` has been released, I think the `5.0.0-rc` will be soon.
----------------------------------------------------------------
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] YanlongMa edited a comment on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa edited a comment on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763256441
zookeeper config center is success, but etcd config center is error, I dont‘not how to add dependency in pom, can you help me, 3Q.
pom.xml
```
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>sharding-jdbc-orchestration-spring-boot-starter</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>io.etcd</groupId>
<artifactId>jetcd-core</artifactId>
<version>0.5.0</version>
</dependency>
```
properties
```
spring.shardingsphere.datasource.names=master,slave0,slave1
# master
spring.shardingsphere.datasource.master.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.master.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.master.jdbc-url=jdbc:mysql://127.0.0.1:3306/master?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.master.username=root
spring.shardingsphere.datasource.master.password=123456
# slave0
spring.shardingsphere.datasource.slave0.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave0.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave0.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave0?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave0.username=root
spring.shardingsphere.datasource.slave0.password=123456
# slave1
spring.shardingsphere.datasource.slave1.type=com.zaxxer.hikari.HikariDataSource
spring.shardingsphere.datasource.slave1.driver-class-name=com.mysql.cj.jdbc.Driver
spring.shardingsphere.datasource.slave1.jdbc-url=jdbc:mysql://127.0.0.1:3306/slave1?useUnicode=true&characterEncoding=utf8&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.shardingsphere.datasource.slave1.username=root
spring.shardingsphere.datasource.slave1.password=123456
# round_robin/random
spring.shardingsphere.masterslave.name=kushu_taishan
spring.shardingsphere.masterslave.master-data-source-name=master
spring.shardingsphere.masterslave.slave-data-source-names=slave0,slave1
spring.shardingsphere.masterslave.load-balance-algorithm-type=round_robin
# sql
spring.shardingsphere.props.sql.show=true
# etcd
spring.shardingsphere.orchestration.name=basic
spring.shardingsphere.orchestration.overwrite=true
spring.shardingsphere.orchestration.registry.type=etcd
spring.shardingsphere.orchestration.registry.namespace=kushu_taishan
spring.shardingsphere.orchestration.registry.server-lists=127.0.0.1:2379
```
error info
```
Caused by: java.lang.RuntimeException: Invalid `org.apache.shardingsphere.orchestration.reg.api.RegistryCenter` SPI type `etcd`.
at org.apache.shardingsphere.spi.TypeBasedSPIServiceLoader.newService(TypeBasedSPIServiceLoader.java:50) ~[shardingsphere-spi-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.RegistryCenterServiceLoader.load(RegistryCenterServiceLoader.java:52) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.orchestration.internal.registry.ShardingOrchestrationFacade.<init>(ShardingOrchestrationFacade.java:58) ~[sharding-orchestration-core-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.internal.datasource.OrchestrationMasterSlaveDataSource.<init>(OrchestrationMasterSlaveDataSource.java:70) ~[sharding-jdbc-orchestration-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration.masterSlaveDataSourceByLocal(OrchestrationSpringBootConfiguration.java:144) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.CGLIB$masterSlaveDataSourceByLocal$3(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac$$FastClassBySpringCGLIB$$812f0b91.invoke(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.apache.shardingsphere.shardingjdbc.orchestration.spring.boot.OrchestrationSpringBootConfiguration$$EnhancerBySpringCGLIB$$650690ac.masterSlaveDataSourceByLocal(<generated>) ~[sharding-jdbc-orchestration-spring-boot-starter-4.0.0.jar:4.0.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_231]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_231]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_231]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_231]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 77 common frames omitted
```
----------------------------------------------------------------
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] YanlongMa commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763344702
I want use master-slave 、etcd config center on product environment,
if use 5.0.0-alpha, I'm a little worried
----------------------------------------------------------------
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] YanlongMa closed issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
YanlongMa closed issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091
----------------------------------------------------------------
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] tristaZero commented on issue #9091: How to use etcd as config center
Posted by GitBox <gi...@apache.org>.
tristaZero commented on issue #9091:
URL: https://github.com/apache/shardingsphere/issues/9091#issuecomment-763338117
Hi @YanlongMa ,
5.0.0-alpha has a quite different configuration form with 4.0.0 and better SQL support. Plus, we will give 5.x release more great improvement in the future. I suggest you can have a try with 5.0.0-alpha.
----------------------------------------------------------------
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