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/11/25 13:42:58 UTC
[GitHub] [shardingsphere] zjcnb opened a new issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
zjcnb opened a new issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800
Hi, community
Now, The `db-discovery` module integrates MYSQL MGR and openGuass, they get master-slave relation through timed task polling, and about job code are duplicat. So we plan to strip job code out of s`hardingsphere-db-discovery-provider` module, move it to `shardingsphere-db-discovery-core` management. `shardingsphere-db-discovery-provider` module is only provide master-slave relation. In order to achieve the purpose mentioned before, we will adjust `db-discovery` module api.
`Before adjustment` :
```
schemaName: database_discovery_db
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:13306/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:mysql://127.0.0.1.18:13307/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_2:
url: jdbc:mysql://127.0.0.1:13308/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password: 123456
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !READWRITE_SPLITTING
dataSources:
rd_rs:
autoAwareDataSourceName: pr_ds
- !DB_DISCOVERY
dataSources:
pr_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr
discoveryTypes:
mgr:
type: MGR
props:
groupName: 64ce3a6b-3d25-11ec-931a-6c92bf049e78
zkServerLists: 'localhost:2181'
keepAliveCron: '0/50 * * * * ?'
```
`After adjustment` :
```
schemaName: database_discovery_db
dataSources:
ds_0:
url: jdbc:mysql://127.0.0.1:3306/demo_primary_ds?serverTimezone=UTC&useSSL=false
username: root
password:
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:mysql://127.0.0.1:3306/demo_replica_ds_0?serverTimezone=UTC&useSSL=false
username: root
password:
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_2:
url: jdbc:mysql://127.0.0.1:3306/demo_replica_ds_1?serverTimezone=UTC&useSSL=false
username: root
password:
connectionTimeoutMilliseconds: 3000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
rules:
- !READWRITE_SPLITTING
dataSources:
rd_rs:
autoAwareDataSourceName: pr_ds
- !DB_DISCOVERY
dataSources:
pr_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr1
discoveryScheduleName: mgr-job1
discoverySchedulers:
mgr-job1:
type: e-job
props:
zkServerLists: 'localhost:2181'
keepAliveCron: '0/5 * * * * ?'
discoveryTypes:
mgr1:
type: MGR
props:
groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
```
--
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] zjcnb edited a comment on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
zjcnb edited a comment on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-983235223
```
rules:
- !DB_DISCOVERY
dataSources:
primary_replica_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr
discoveryHeartBeatName: mgr-job
discoveryHeartBeat:
mgr-job:
props:
keepAliveCron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
```
@terrymanu @menghaoranss Hi, according to your suggestion, I adjusted the api. We can confirm 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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] sandynz commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
sandynz commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-983321039
For heartbeat, set time interval might be enough (e.g. every 5 seconds), it's simpler than cron expression.
If there're several heartbeat jobs to do, `HashedWheelTimer` is an alternative, it's performant.
I'll consider whether add it to ElasticJob or not later.
How do you think? @menghaoranss
--
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] zjcnb commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-984481696
refer to : #13902
--
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] zjcnb edited a comment on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
zjcnb edited a comment on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-983235223
```
rules:
- !DB_DISCOVERY
dataSources:
primary_replica_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr
discoveryHeartBeatName: mgr-heartbeat
discoveryHeartBeat:
mgr-heartbeat:
props:
keepAliveCron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
```
@terrymanu @menghaoranss Hi, according to your suggestion, I adjusted the api. We can confirm 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.
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 commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-979680189
> I have question for new config of discoverySchedulers:
>
> Does `type` of discoverySchedulers is necessary, is there any other job can inline in to ShardingSphere? If we use elastic-job for the only one solution, could we consider about remove the type, do not let user know the new concept.
>
> And the zkServerLists maybe use same one with ShardingSphere.
>
> The config maybe change to:
>
> ```yaml
> discoverySchedulers:
> mgr-job:
> keepAliveCron: '0/5 * * * * ?'
> ```
>
> What do you think?
@terrymanu I agree to use elastic-job as the default scheduler in `ShardingSphere`, and don't consider integrating other solutions.
--
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] zjcnb commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-983235223
```
rules:
- !DB_DISCOVERY
dataSources:
primary_replica_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr
discoveryHeartBeatName: mgr-job
discoveryHeartBeat:
mgr-job:
type: elastic-job
props:
keepAliveCron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
```
@terrymanu @menghaoranss Hi, according to your suggestion, I adjusted the api. We can confirm 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.
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 commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-983248514
> ```
> rules:
> - !DB_DISCOVERY
> dataSources:
> primary_replica_ds:
> dataSourceNames:
> - ds_0
> - ds_1
> - ds_2
> discoveryTypeName: mgr
> discoveryHeartBeatName: mgr-heartbeat
>
> discoveryHeartBeat:
> mgr-heartbeat:
> props:
> keepAliveCron: '0/5 * * * * ?'
>
> discoveryTypes:
> mgr:
> type: MGR
> props:
> groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
> ```
>
>
>
>
>
> @terrymanu @menghaoranss Hi, according to your suggestion, I adjusted the api. We can confirm it.
I suggest `discoveryHeartbeatName` and `discoveryHeartbeats ` is better.
```
rules:
- !DB_DISCOVERY
dataSources:
primary_replica_ds:
dataSourceNames:
- ds_0
- ds_1
- ds_2
discoveryTypeName: mgr
discoveryHeartbeatName: mgr-heartbeat
discoveryHeartbeats:
mgr-heartbeat:
props:
keepAliveCron: '0/5 * * * * ?'
discoveryTypes:
mgr:
type: MGR
props:
groupName: 92504d5b-6dec-11e8-91ea-246e9612aaf1
```
--
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] terrymanu commented on issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800#issuecomment-979661591
I have question for new config of discoverySchedulers:
Does `type` of discoverySchedulers is necessary, is there any other job can inline in to ShardingSphere? If we use elastic-job for the only one solution, could we consider about remove the type, do not let user know the new concept.
And the zkServerLists maybe use same one with ShardingSphere.
The config maybe change to:
```yaml
discoverySchedulers:
mgr-job:
keepAliveCron: '0/5 * * * * ?'
```
What do you think?
--
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] zjcnb closed issue #13800: Plan to adjust shardingsphere-db-discovery-provider and change db-discover api.
Posted by GitBox <gi...@apache.org>.
zjcnb closed issue #13800:
URL: https://github.com/apache/shardingsphere/issues/13800
--
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