You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by sushixiang <sh...@qq.com> on 2020/04/29 05:35:13 UTC

[SHARDING-SCALING]Optimization about job start API

Hi everyone,&nbsp;
As we know, sharding-scaling can be used for migrating data from single datasource to ShardingSphere when first using ShardingSphere,&nbsp;and the start API is showed below:


curl -X POST \
&nbsp; http://localhost:8888/shardingscaling/job/start \
&nbsp; -H 'content-type: application/json' \
&nbsp; -d '{
&nbsp; &nbsp;"ruleConfiguration": {
&nbsp; &nbsp; &nbsp; "sourceDatasource": "ds_0: !!YamlDataSourceConfiguration\n&nbsp; dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n&nbsp; properties:\n&nbsp; &nbsp; jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&amp;useSSL=false\n&nbsp; &nbsp; username: root\n&nbsp; &nbsp; password: '\''123456'\''\n&nbsp; &nbsp; connectionTimeout: 30000\n&nbsp; &nbsp; idleTimeout: 60000\n&nbsp; &nbsp; maxLifetime: 1800000\n&nbsp; &nbsp; maxPoolSize: 50\n&nbsp; &nbsp; minPoolSize: 1\n&nbsp; &nbsp; maintenanceIntervalMilliseconds: 30000\n&nbsp; &nbsp; readOnly: false\n",
&nbsp; &nbsp; &nbsp; "sourceRule": "tables:\n&nbsp; t_order:\n&nbsp; &nbsp; actualDataNodes: ds_0.t_order\n&nbsp; &nbsp; tableStrategy:\n&nbsp; &nbsp; &nbsp; none",
&nbsp; &nbsp; &nbsp; "destinationDataSources": {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name": "dt_0",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"password": "123456",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&amp;useSSL=false",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"username": "root"
&nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp;},
&nbsp; &nbsp;"jobConfiguration": {
&nbsp; &nbsp; &nbsp; "concurrency": 3
&nbsp; &nbsp;}
}'



But I think the configuration may be much complex for the fisrt use, if we need migrate all tables from the source database, we should config all tables in the 'sourceRule' item, and for first use, we may not have the concept of table rules.


So, I think a simpler configuration may be needed, not only the first data migrate scenario, does anyone has some suggestions about it?


All data migrate scenarios can refer the link:&nbsp;https://shardingsphere.apache.org/document/current/en/features/sharding-scaling/core-features/

Re: [SHARDING-SCALING]Optimization about job start API

Posted by Sheng Wu <wu...@gmail.com>.
I think qq mail box and some mail local tool have this issue. Gmail showing
them.

Sheng Wu 吴晟
Twitter, wusheng1108


sushixiang <sh...@qq.com> 于2020年4月30日周四 上午8:58写道:

> Sorry, I don't know why the blanks&nbsp;&nbsp;turn into &amp;nbsp;.
>
>
>
>
> ------------------&nbsp;Original&nbsp;------------------
> From:&nbsp;"KimmKing"<kimmking@apache.org&gt;;
> Date:&nbsp;Wed, Apr 29, 2020 07:24 PM
> To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;"birdyanggr"<
> birdyanggr@163.com&gt;;
>
> Subject:&nbsp;Re:[SHARDING-SCALING]Optimization about job start API
>
>
>
> a text format mail is better.
>
>
>
>
>
> At 2020-04-29 13:35:13, "sushixiang" <shixiangsu@qq.com&gt; wrote:
> &gt;Hi everyone,&amp;nbsp;
> &gt;As we know, sharding-scaling can be used for migrating data from
> single datasource to ShardingSphere when first using
> ShardingSphere,&amp;nbsp;and the start API is showed below:
> &gt;
> &gt;
> &gt;curl -X POST \
> &gt;&amp;nbsp; http://localhost:8888/shardingscaling/job/start \
> &gt;&amp;nbsp; -H 'content-type: application/json' \
> &gt;&amp;nbsp; -d '{
> &gt;&amp;nbsp; &amp;nbsp;"ruleConfiguration": {
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "sourceDatasource": "ds_0:
> !!YamlDataSourceConfiguration\n&amp;nbsp; dataSourceClassName:
> com.zaxxer.hikari.HikariDataSource\n&amp;nbsp; properties:\n&amp;nbsp;
> &amp;nbsp; jdbcUrl: jdbc:mysql://
> 127.0.0.1:3306/test?serverTimezone=UTC&amp;amp;useSSL=false\n&amp;nbsp
> <http://127.0.0.1:3306/test?serverTimezone=UTC&amp;amp;useSSL=false%5Cn&amp;nbsp>;
> &amp;nbsp; username: root\n&amp;nbsp; &amp;nbsp; password:
> '\''123456'\''\n&amp;nbsp; &amp;nbsp; connectionTimeout: 30000\n&amp;nbsp;
> &amp;nbsp; idleTimeout: 60000\n&amp;nbsp; &amp;nbsp; maxLifetime:
> 1800000\n&amp;nbsp; &amp;nbsp; maxPoolSize: 50\n&amp;nbsp; &amp;nbsp;
> minPoolSize: 1\n&amp;nbsp; &amp;nbsp; maintenanceIntervalMilliseconds:
> 30000\n&amp;nbsp; &amp;nbsp; readOnly: false\n",
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "sourceRule": "tables:\n&amp;nbsp;
> t_order:\n&amp;nbsp; &amp;nbsp; actualDataNodes: ds_0.t_order\n&amp;nbsp;
> &amp;nbsp; tableStrategy:\n&amp;nbsp; &amp;nbsp; &amp;nbsp; none",
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "destinationDataSources": {
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name": "dt_0",
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"password":
> "123456",
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"url":
> "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&amp;amp;useSSL=false
> ",
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"username":
> "root"
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }
> &gt;&amp;nbsp; &amp;nbsp;},
> &gt;&amp;nbsp; &amp;nbsp;"jobConfiguration": {
> &gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "concurrency": 3
> &gt;&amp;nbsp; &amp;nbsp;}
> &gt;}'
> &gt;
> &gt;
> &gt;
> &gt;But I think the configuration may be much complex for the fisrt use,
> if we need migrate all tables from the source database, we should config
> all tables in the 'sourceRule' item, and for first use, we may not have the
> concept of table rules.
> &gt;
> &gt;
> &gt;So, I think a simpler configuration may be needed, not only the first
> data migrate scenario, does anyone has some suggestions about it?
> &gt;
> &gt;
> &gt;All data migrate scenarios can refer the link:&amp;nbsp;
> https://shardingsphere.apache.org/document/current/en/features/sharding-scaling/core-features/

Re:[SHARDING-SCALING]Optimization about job start API

Posted by sushixiang <sh...@qq.com>.
Sorry, I don't know why the blanks&nbsp;&nbsp;turn into &amp;nbsp;.




------------------&nbsp;Original&nbsp;------------------
From:&nbsp;"KimmKing"<kimmking@apache.org&gt;;
Date:&nbsp;Wed, Apr 29, 2020 07:24 PM
To:&nbsp;"dev"<dev@shardingsphere.apache.org&gt;;"birdyanggr"<birdyanggr@163.com&gt;;

Subject:&nbsp;Re:[SHARDING-SCALING]Optimization about job start API



a text format mail is better.





At 2020-04-29 13:35:13, "sushixiang" <shixiangsu@qq.com&gt; wrote:
&gt;Hi everyone,&amp;nbsp;
&gt;As we know, sharding-scaling can be used for migrating data from single datasource to ShardingSphere when first using ShardingSphere,&amp;nbsp;and the start API is showed below:
&gt;
&gt;
&gt;curl -X POST \
&gt;&amp;nbsp; http://localhost:8888/shardingscaling/job/start \
&gt;&amp;nbsp; -H 'content-type: application/json' \
&gt;&amp;nbsp; -d '{
&gt;&amp;nbsp; &amp;nbsp;"ruleConfiguration": {
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "sourceDatasource": "ds_0: !!YamlDataSourceConfiguration\n&amp;nbsp; dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n&amp;nbsp; properties:\n&amp;nbsp; &amp;nbsp; jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&amp;amp;useSSL=false\n&amp;nbsp; &amp;nbsp; username: root\n&amp;nbsp; &amp;nbsp; password: '\''123456'\''\n&amp;nbsp; &amp;nbsp; connectionTimeout: 30000\n&amp;nbsp; &amp;nbsp; idleTimeout: 60000\n&amp;nbsp; &amp;nbsp; maxLifetime: 1800000\n&amp;nbsp; &amp;nbsp; maxPoolSize: 50\n&amp;nbsp; &amp;nbsp; minPoolSize: 1\n&amp;nbsp; &amp;nbsp; maintenanceIntervalMilliseconds: 30000\n&amp;nbsp; &amp;nbsp; readOnly: false\n",
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "sourceRule": "tables:\n&amp;nbsp; t_order:\n&amp;nbsp; &amp;nbsp; actualDataNodes: ds_0.t_order\n&amp;nbsp; &amp;nbsp; tableStrategy:\n&amp;nbsp; &amp;nbsp; &amp;nbsp; none",
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "destinationDataSources": {
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"name": "dt_0",
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"password": "123456",
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&amp;amp;useSSL=false",
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"username": "root"
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }
&gt;&amp;nbsp; &amp;nbsp;},
&gt;&amp;nbsp; &amp;nbsp;"jobConfiguration": {
&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "concurrency": 3
&gt;&amp;nbsp; &amp;nbsp;}
&gt;}'
&gt;
&gt;
&gt;
&gt;But I think the configuration may be much complex for the fisrt use, if we need migrate all tables from the source database, we should config all tables in the 'sourceRule' item, and for first use, we may not have the concept of table rules.
&gt;
&gt;
&gt;So, I think a simpler configuration may be needed, not only the first data migrate scenario, does anyone has some suggestions about it?
&gt;
&gt;
&gt;All data migrate scenarios can refer the link:&amp;nbsp;https://shardingsphere.apache.org/document/current/en/features/sharding-scaling/core-features/

Re:[SHARDING-SCALING]Optimization about job start API

Posted by KimmKing <ki...@apache.org>.
a text format mail is better.





At 2020-04-29 13:35:13, "sushixiang" <sh...@qq.com> wrote:
>Hi everyone,&nbsp;
>As we know, sharding-scaling can be used for migrating data from single datasource to ShardingSphere when first using ShardingSphere,&nbsp;and the start API is showed below:
>
>
>curl -X POST \
>&nbsp; http://localhost:8888/shardingscaling/job/start \
>&nbsp; -H 'content-type: application/json' \
>&nbsp; -d '{
>&nbsp; &nbsp;"ruleConfiguration": {
>&nbsp; &nbsp; &nbsp; "sourceDatasource": "ds_0: !!YamlDataSourceConfiguration\n&nbsp; dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n&nbsp; properties:\n&nbsp; &nbsp; jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&amp;useSSL=false\n&nbsp; &nbsp; username: root\n&nbsp; &nbsp; password: '\''123456'\''\n&nbsp; &nbsp; connectionTimeout: 30000\n&nbsp; &nbsp; idleTimeout: 60000\n&nbsp; &nbsp; maxLifetime: 1800000\n&nbsp; &nbsp; maxPoolSize: 50\n&nbsp; &nbsp; minPoolSize: 1\n&nbsp; &nbsp; maintenanceIntervalMilliseconds: 30000\n&nbsp; &nbsp; readOnly: false\n",
>&nbsp; &nbsp; &nbsp; "sourceRule": "tables:\n&nbsp; t_order:\n&nbsp; &nbsp; actualDataNodes: ds_0.t_order\n&nbsp; &nbsp; tableStrategy:\n&nbsp; &nbsp; &nbsp; none",
>&nbsp; &nbsp; &nbsp; "destinationDataSources": {
>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name": "dt_0",
>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"password": "123456",
>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&amp;useSSL=false",
>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"username": "root"
>&nbsp; &nbsp; &nbsp; }
>&nbsp; &nbsp;},
>&nbsp; &nbsp;"jobConfiguration": {
>&nbsp; &nbsp; &nbsp; "concurrency": 3
>&nbsp; &nbsp;}
>}'
>
>
>
>But I think the configuration may be much complex for the fisrt use, if we need migrate all tables from the source database, we should config all tables in the 'sourceRule' item, and for first use, we may not have the concept of table rules.
>
>
>So, I think a simpler configuration may be needed, not only the first data migrate scenario, does anyone has some suggestions about it?
>
>
>All data migrate scenarios can refer the link:&nbsp;https://shardingsphere.apache.org/document/current/en/features/sharding-scaling/core-features/

Re:[SHARDING-SCALING]Optimization about job start API

Posted by Juan Pan <pa...@apache.org>.
Hi shixiang,


I am glad to see your discussion email, 
which surely contains your thinking and opinion in dev list.
If you have any idea to express and welcome others' thoughts, 
my suggestion is to put them in GitHub and open a discussion thread in dev list, 
which helps present yourself through images or links, anyway.


Best,
Trista




 Juan Pan (Trista)
                         
Senior DBA & PPMC of Apache ShardingSphere(Incubating)
E-mail: panjuan@apache.org




On 04/29/2020 13:35,sushixiang<sh...@qq.com> wrote:
Hi everyone,&nbsp;
As we know, sharding-scaling can be used for migrating data from single datasource to ShardingSphere when first using ShardingSphere,&nbsp;and the start API is showed below:


curl -X POST \
&nbsp; http://localhost:8888/shardingscaling/job/start \
&nbsp; -H 'content-type: application/json' \
&nbsp; -d '{
&nbsp; &nbsp;"ruleConfiguration": {
&nbsp; &nbsp; &nbsp; "sourceDatasource": "ds_0: !!YamlDataSourceConfiguration\n&nbsp; dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n&nbsp; properties:\n&nbsp; &nbsp; jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&amp;useSSL=false\n&nbsp; &nbsp; username: root\n&nbsp; &nbsp; password: '\''123456'\''\n&nbsp; &nbsp; connectionTimeout: 30000\n&nbsp; &nbsp; idleTimeout: 60000\n&nbsp; &nbsp; maxLifetime: 1800000\n&nbsp; &nbsp; maxPoolSize: 50\n&nbsp; &nbsp; minPoolSize: 1\n&nbsp; &nbsp; maintenanceIntervalMilliseconds: 30000\n&nbsp; &nbsp; readOnly: false\n",
&nbsp; &nbsp; &nbsp; "sourceRule": "tables:\n&nbsp; t_order:\n&nbsp; &nbsp; actualDataNodes: ds_0.t_order\n&nbsp; &nbsp; tableStrategy:\n&nbsp; &nbsp; &nbsp; none",
&nbsp; &nbsp; &nbsp; "destinationDataSources": {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"name": "dt_0",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"password": "123456",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&amp;useSSL=false",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"username": "root"
&nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp;},
&nbsp; &nbsp;"jobConfiguration": {
&nbsp; &nbsp; &nbsp; "concurrency": 3
&nbsp; &nbsp;}
}'



But I think the configuration may be much complex for the fisrt use, if we need migrate all tables from the source database, we should config all tables in the 'sourceRule' item, and for first use, we may not have the concept of table rules.


So, I think a simpler configuration may be needed, not only the first data migrate scenario, does anyone has some suggestions about it?


All data migrate scenarios can refer the link:&nbsp;https://shardingsphere.apache.org/document/current/en/features/sharding-scaling/core-features/