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/11/25 02:29:17 UTC
[GitHub] [shardingsphere] MercuryTan opened a new issue, #22398: shardingjdbc5.1.1 +zk does not support custom time?
MercuryTan opened a new issue, #22398:
URL: https://github.com/apache/shardingsphere/issues/22398
**question:**
zk is connected,but when I starting the project, an exception occurred
org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
**When I debugged, I found:**
The zk timeout has been configured
![image](https://user-images.githubusercontent.com/31116969/203887386-00aa3f8b-9547-45fe-91be-4b384b6279a8.png)
But when actually initializing,only used “server-lists” and “namespace”。Other parameters are default values
![image](https://user-images.githubusercontent.com/31116969/203887262-00bd320b-f0e8-4205-9f38-06292d7d0fea.png)
So, how to solve this 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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] MercuryTan closed issue #22398: shardingjdbc5.1.1 +zk does not support custom time?
Posted by GitBox <gi...@apache.org>.
MercuryTan closed issue #22398: shardingjdbc5.1.1 +zk does not support custom time?
URL: https://github.com/apache/shardingsphere/issues/22398
--
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] MercuryTan commented on issue #22398: shardingjdbc5.1.1 +zk does not support custom time?
Posted by GitBox <gi...@apache.org>.
MercuryTan commented on issue #22398:
URL: https://github.com/apache/shardingsphere/issues/22398#issuecomment-1327093989
@zhaojinchao95 thank u, but adjustment sessionTimeoutMilliseconds do not take effect.
When setting the parameter “**server-list**” from
```
spring.shardingsphere.mode.repository.props.server-lists=ip:2181
```
**to**
```
spring.shardingsphere.mode.repository.props.server-lists=zkServer:2181
```
and **hosts file** settings mapping
```
ip zkServer
```
Project started successfully.
--
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 #22398: shardingjdbc5.1.1 +zk does not support custom time?
Posted by GitBox <gi...@apache.org>.
zhaojinchao95 commented on issue #22398:
URL: https://github.com/apache/shardingsphere/issues/22398#issuecomment-1326960515
You can see `ZookeeperRepository.init(final ClusterPersistRepositoryConfiguration config)`. Maybe you need to Adjust `sessionTimeoutMilliseconds` time.
--
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 #22398: shardingjdbc5.1.1 +zk does not support custom time?
Posted by GitBox <gi...@apache.org>.
zhaojinchao95 commented on issue #22398:
URL: https://github.com/apache/shardingsphere/issues/22398#issuecomment-1327024545
You can adjustment `sessionTimeoutMilliseconds` to 6000. And try it again.
--
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] MercuryTan commented on issue #22398: shardingjdbc5.1.1 +zk does not support custom time?
Posted by GitBox <gi...@apache.org>.
MercuryTan commented on issue #22398:
URL: https://github.com/apache/shardingsphere/issues/22398#issuecomment-1326972555
@zhaojinchao95 in `ZookeeperRepository.init(final ClusterPersistRepositoryConfiguration config)`,did use custom time,no error reported at this time. when executing the method `ZookeeperRegistryCenter.init()`,an exception occurred
**It works when my config file is the following section:**
```
spring.shardingsphere.mode.type=Cluster
spring.shardingsphere.mode.repository.type=ZooKeeper
spring.shardingsphere.mode.repository.props.namespace= xxx
spring.shardingsphere.mode.repository.props.server-lists= xxxx
spring.shardingsphere.mode.repository.props.sessionTimeoutMilliseconds=1000
spring.shardingsphere.mode.repository.props.maxRetries=5
spring.shardingsphere.mode.repository.props.retryIntervalMilliseconds=50000
spring.shardingsphere.mode.repository.props.timeToLiveSeconds=6000
spring.shardingsphere.mode.repository.props.operationTimeoutMilliseconds=60000
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.type=Static
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.props.write-data-source-name=write1
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.props.read-data-source-names=read1,read2
```
But **when I want to achieve dynamic read-write separation**, the previous exception is thrown when using the following configuration file:
RegException: org.apache.zookeeper.KeeperException$OperationTimeoutException: KeeperErrorCode = OperationTimeout
```
spring.shardingsphere.mode.type=Cluster
spring.shardingsphere.mode.repository.type=ZooKeeper
spring.shardingsphere.mode.repository.props.namespace= xxx
spring.shardingsphere.mode.repository.props.server-lists= xxx
spring.shardingsphere.mode.repository.props.sessionTimeoutMilliseconds=1000
spring.shardingsphere.mode.repository.props.maxRetries=5
spring.shardingsphere.mode.repository.props.retryIntervalMilliseconds=50000
spring.shardingsphere.mode.repository.props.timeToLiveSeconds=6000
spring.shardingsphere.mode.repository.props.operationTimeoutMilliseconds=60000
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.type=Dynamic
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.props.auto-aware-data-source-name=dbsource_discovery
spring.shardingsphere.rules.readwrite-splitting.data-sources.readwrite_ds.props.allow-write-data-source-query=false
spring.shardingsphere.rules.database-discovery.data-sources.dbsource_discovery.data-source-names=write1,read1,read2
spring.shardingsphere.rules.database-discovery.data-sources.dbsource_discovery.discovery-heartbeat-name=replication_delay_heartbeat
spring.shardingsphere.rules.database-discovery.data-sources.dbsource_discovery.discovery-type-name=replication_delay
spring.shardingsphere.rules.database-discovery.discovery-heartbeats.replication_delay_heartbeat.props.keep-alive-cron='0/5 * * * * ?'
spring.shardingsphere.rules.database-discovery.discovery-types.replication_delay.type=SHOW_SLAVE_STATUS
spring.shardingsphere.rules.database-discovery.discovery-types.replication_delay.props.delay-milliseconds-threshold=10000
```
Is this configuration correct?
--
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