-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupport using Etcd as the registry in shardingsphere proxy #33565
Comments
my configuratioin authority: props: |
my use version is ShardingSphere-Proxy:5.5.1 |
How to reproduce it? |
An error was reported while I was loading the following configuration file in cluster mode. global.yaml `mode: authority: user: root@% |
It is only the log. |
hello,Here's how i do it. my imagei use docker start proxys,and this image written myself.The image contains some third-party packages, such as mysql connection、grpc ... my global.yaml`mode: authority: props: my database-sharding.yamldatabaseName: sharding_db dataSources: server_order1: rules:
operational processI started multiple proxies
|
I feel very strange,It actually reports the error that Etcd is not supported,But there is no official documentation supporting Etcd. |
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-grpc</artifactId>
<version>4.5.1</version>
</dependency>
|
oh,Sorry, this is my first time using issue. |
It's an error message that you can copy and put in a text editor |
The team I'm on uses golang, so it uses proxy, and the registry leans toward Etcd |
??? |
|
At this time, the company Intranet, you need to change to your own etcd |
You start with my image and global configuration file, then start multiple proxy nodes, and then close any one of them, and you'll see the error I mentioned。 |
I think it is caused by the following reasons:
|
git clone [email protected]:linghengqian/shardingsphere-proxy-etcd-test.git
cd ./shardingsphere-proxy-etcd-test/
docker compose up -d
docker compose logs --follow shardingsphere-proxy-custom-etcd $ docker compose logs --follow shardingsphere-proxy-custom-etcd
shardingsphere-proxy-custom-etcd-1 | we find java version: java21, full_version=21.0.4, full_path=/opt/java/openjdk/bin/java
shardingsphere-proxy-custom-etcd-1 | unadapted java version, please notice...
shardingsphere-proxy-custom-etcd-1 | The port is 3308
shardingsphere-proxy-custom-etcd-1 | The classpath is /opt/shardingsphere-proxy/conf:.:/opt/shardingsphere-proxy/lib/*:/opt/shardingsphere-proxy/ext-lib/*
shardingsphere-proxy-custom-etcd-1 | main class org.apache.shardingsphere.proxy.Bootstrap 3308 /opt/shardingsphere-proxy/conf 0.0.0.0 false
shardingsphere-proxy-custom-etcd-1 | [INFO ] 2024-11-07 09:00:35.476 [main] i.v.c.spi.resolver.ResolverProvider - Using the default address resolver as the dns resolver could not be loaded
shardingsphere-proxy-custom-etcd-1 | [ERROR] 2024-11-07 09:00:41.107 [main] o.a.s.d.p.c.l.PipelineContextManagerLifecycleListener - Dispatch enable pipeline job start event failed
shardingsphere-proxy-custom-etcd-1 | java.lang.IllegalArgumentException: Unsupported cluster type: etcd
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$RegistryCenterHolder.lambda$createRegistryCenter$0(PipelineAPIFactory.java:150)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:44)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$RegistryCenterHolder.createRegistryCenter(PipelineAPIFactory.java:150)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$RegistryCenterHolder.<init>(PipelineAPIFactory.java:141)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$RegistryCenterHolder.lambda$getInstance$1(PipelineAPIFactory.java:155)
shardingsphere-proxy-custom-etcd-1 | at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$RegistryCenterHolder.getInstance(PipelineAPIFactory.java:155)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory.getRegistryCenter(PipelineAPIFactory.java:109)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$ElasticJobAPIHolder.<init>(PipelineAPIFactory.java:123)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$ElasticJobAPIHolder.lambda$getInstance$0(PipelineAPIFactory.java:130)
shardingsphere-proxy-custom-etcd-1 | at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory$ElasticJobAPIHolder.getInstance(PipelineAPIFactory.java:130)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.job.api.PipelineAPIFactory.getJobConfigurationAPI(PipelineAPIFactory.java:89)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.listener.PipelineContextManagerLifecycleListener.dispatchEnablePipelineJobStartEvent(PipelineContextManagerLifecycleListener.java:74)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.data.pipeline.core.listener.PipelineContextManagerLifecycleListener.onInitialized(PipelineContextManagerLifecycleListener.java:65)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.mode.manager.ContextManager.<init>(ContextManager.java:75)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:64)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:62)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:53)
shardingsphere-proxy-custom-etcd-1 | at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:64)
shardingsphere-proxy-custom-etcd-1 | [WARN ] 2024-11-07 09:00:41.108 [main] o.a.s.s.c.j.s.c.StatisticsCollectJobWorker - Can not collect statistics because of unsupported cluster type: etcd
shardingsphere-proxy-custom-etcd-1 | [INFO ] 2024-11-07 09:00:41.202 [main] o.a.s.p.frontend.ssl.ProxySSLContext - Proxy frontend SSL/TLS is not enabled.
shardingsphere-proxy-custom-etcd-1 | [INFO ] 2024-11-07 09:00:41.226 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy Cluster mode started successfully
|
I use is shardingsphere-proxy |
|
Do you mean that proxy does not support etcd at present, only JDBC does? @linghengqian |
|
|
Feel free to consider submitting your fix PR to update the documentation. The ASF community is essentially a volunteer community, and outdated documentation is not something that is not allowed. Especially when you observe communities such as Hive that use ASF Confluence as a documentation site. |
|
|
hello,I don't think it has much to do with where Etcd is deployed. |
Most people don't need to pay attention to the current issue. Multiple management issues of elasticjob prevent the current issue from being resolved. |
Bug Report
[ERROR] 2024-11-06 09:19:40.998 [Etcd-EventListener-0] c.g.common.eventbus.EventBus.default - Exception thrown by subscriber method renew(org.apache.shardingsphere.mode.event.dispatch.state.compute.WorkerIdEvent) on subscriber org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ComputeNodeStateSubscriber@3265ef81 when dispatching event: org.apache.shardingsphere.mode.event.dispatch.state.compute.WorkerIdEvent@7282af36
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because "workerId" is null
at org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext.lambda$updateWorkerId$1(ComputeNodeInstanceContext.java:123)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
at org.apache.shardingsphere.infra.instance.ComputeNodeInstanceContext.updateWorkerId(ComputeNodeInstanceContext.java:123)
at org.apache.shardingsphere.mode.manager.cluster.event.subscriber.dispatch.ComputeNodeStateSubscriber.renew(ComputeNodeStateSubscriber.java:78)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:85)
at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:142)
at com.google.common.eventbus.Subscriber.lambda$dispatchEvent$0(Subscriber.java:71)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31)
at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:68)
at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:109)
at com.google.common.eventbus.EventBus.post(EventBus.java:270)
at org.apache.shardingsphere.infra.util.eventbus.EventBusContext.post(EventBusContext.java:44)
at java.base/java.util.Optional.ifPresent(Optional.java:178)
at org.apache.shardingsphere.mode.manager.cluster.listener.GlobalMetaDataChangedListener.onChange(GlobalMetaDataChangedListener.java:39)
at org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository.lambda$dispatchEvent$3(EtcdRepository.java:191)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
The text was updated successfully, but these errors were encountered: