You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by 772826099 <77...@qq.com> on 2019/03/15 01:28:17 UTC

回复: 动弹建表问题

I mean, separation, master-slave, speaking, reading and writing table depots, under the condition of the route query can be routed to the specific one from the table, now see your source code, is the only mandatory routing master database, to be honest is from library data consistent in all cases, how to manually assigned to specific from table rather than to change the configuration file and restart, are looking forward to your reply


------------------ 原始邮件 ------------------
发件人: "zhangliang@apache.org"<zh...@apache.org>;
发送时间: 2019年3月14日(星期四) 晚上10:54
收件人: "dev"<de...@shardingsphere.apache.org>;

主题: Re: 动弹建表问题



For English only

------------------

Liang Zhang (John)
Apache ShardingSphere & Dubbo


congyq1@163.com <co...@163.com> 于2019年3月14日周四 下午7:03写道:

> 见信好:
>     我通过配置项后,使用JPA方式连接数据库情况下,可以实现按照分片规则插入对应的表中,配置如下:
>
> server.port=8080
> spring.jpa.hibernate.ddl-auto=update
> spring.jpa.show-sql=true
> spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
>
> sharding.jdbc.datasource.names=serverdb
>
> sharding.jdbc.datasource.serverdb.type=com.alibaba.druid.pool.DruidDataSource
> sharding.jdbc.datasource.serverdb.driver-class-name=com.mysql.jdbc.Driver
>
> sharding.jdbc.datasource.serverdb.url=jdbc:mysql://localhost:3306/xxx?characterEncoding=utf8&useSSL=false
> sharding.jdbc.datasource.serverdb.username=xxx
> sharding.jdbc.datasource.serverdb.password=xxx
>
> sharding.jdbc.config.sharding.tables.config.dynamic=true
> sharding.jdbc.config.sharding.tables.visit_api_log.config.dynamic=true
>
> sharding.jdbc.config.sharding.tables.visit_api_log.table-strategy.standard.sharding-column=date
>
> sharding.jdbc.config.sharding.tables.visit_api_log.table-strategy.standard.precise-algorithm-class-name=com.cong.testShardingSphere.algorithm.PreciseModuloShardingTableAlgorithm
>
>
> PreciseModuloShardingTableAlgorithm类中会根据插入时间,数据插入时,进入对应的"visit_api_log_201901、visit_api_log_201902、visit_api_log_201903。。。”
>
> 但是现在有个问题,当我进行查询的时,因为对应的表“visit_api_log”目前为动态分表情况,查询数据时应该按照"visit_api_log_201901、visit_api_log_201902、visit_api_log_201903。。。”进行查询并统计结果返回。
>     但是目前查询时不再查询根据动态生成的表名,仅查询visit_api_log原表数据。
>     是有别的配置项需要配置,还是暂时不支持查询所有动态插入的表单库?这个问题请教下您,谢谢您的关注
>
>
>
>
>
>
>
>

回复: 动弹建表问题

Posted by 772826099 <77...@qq.com>.
我的意思是 , 主从读写分离情况下, 不分表不分库 , 在路由查询的情况下可以路由到具体某一个从表 ,目前看你们源码,是只有强制路由主库,坦白讲就是在所有从库数据一致的情况下如何手动切换指定到具体的从表  而不用再去改配置文件 再重启,期待您的回复
不还意思  翻译之后的英文 完全变了意思




------------------ 原始邮件 ------------------
发件人: "zhangliang@apache.org"<zh...@apache.org>;
发送时间: 2019年3月15日(星期五) 上午10:43
收件人: "dev"<de...@shardingsphere.apache.org>;

主题: Re: 动弹建表问题



英文和中文不是同一个问题,标题不是同一个
主题。
您发送了一封包含正确英文标题的新电子邮件?
搜索很好。

------------------ 

Liang Zhang(John)
Apache ShardingSphere&Dubbo 


772826099 <77...@qq.com>于2019年3月15日周五上午9:28写道:

>我的意思是,分离,主从,说,读,写表
>软件仓库,在路由查询的条件下可以
从表中路由到>特定的一个,现在看你的源代码,是唯一的
>强制的路由主数据库,说实话是从库数据
>在所有情况下都是一致的,如何从表中手动分配到特定的
> rather than to change the configuration file and restart, are looking
> forward to your reply
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "zhangliang@apache.org"<zh...@apache.org>;
> 发送时间: 2019年3月14日(星期四) 晚上10:54
> 收件人: "dev"<de...@shardingsphere.apache.org>;
>
> 主题: Re: 动弹建表问题
>
>
>
> For English only
>
> ------------------
>
> Liang Zhang (John)
> Apache ShardingSphere & Dubbo
>
>
> congyq1@163.com <co...@163.com> 于2019年3月14日周四 下午7:03写道:
>
> > 见信好:
> >     我通过配置项后,使用JPA方式连接数据库情况下,可以实现按照分片规则插入对应的表中,配置如下:
> >
>> server.port = 8080 
>> spring.jpa.hibernate.ddl-auto = update 
>> spring.jpa.show-sql = true 
>> spring.jpa.database-platform = org.hibernate.dialect.MySQL5InnoDBDialect 
>> 
>> sharding.jdbc.datasource.names = serverdb 
>> 
>> 
> sharding.jdbc.datasource.serverdb.type = com.alibaba.druid.pool.DruidDataSource 
>> sharding.jdbc.datasource.serverdb.driver类名= com.mysql.jdbc.Driver 
>> 
>> 
> sharding.jdbc.datasource.serverdb.url = JDBC:MySQL的://本地主机:3306 / XXX的characterEncoding = UTF8&useSSL =假
>> sharding.jdbc.datasource.serverdb。 username = xxx 
>> sharding.jdbc.datasource.serverdb.password = xxx 
>>
>> sharding.jdbc.config.sharding.tables.config.dynamic =真
>> sharding.jdbc.config.sharding.tables.visit_api_log.config.dynamic =真
>> 
>> 
> sharding.jdbc.config.sharding.tables .visit_api_log.table-strategy.standard.sharding列=日期
>> 
>> 
> sharding.jdbc.config.sharding.tables.visit_api_log.table-strategy.standard.precise算法类名= com.cong.testShardingSphere .algorithm.PreciseModuloShardingTableAlgorithm 
>> 
>> 
>> 
> PreciseModuloShardingTableAlgorithm类中会根据插入时间,数据插入时,进入对应的“visit_api_log_201901,visit_api_log_201902,visit_api_log_201903 ......” 
>> 
>>
> 但是现在有个问题,当我进行查询的时,因为对应的表“visit_api_log”目前为动态分表情况,查询数据时应该按照"visit_api_log_201901、visit_api_log_201902、visit_api_log_201903。。。”进行查询并统计结果返回。
> >     但是目前查询时不再查询根据动态生成的表名,仅查询visit_api_log原表数据。
> >     是有别的配置项需要配置,还是暂时不支持查询所有动态插入的表单库?这个问题请教下您,谢谢您的关注
> >
> >
> >
> >
> >
> >
> >
> >

Re: 动弹建表问题

Posted by "zhangliang@apache.org" <zh...@apache.org>.
The English and Chinese is not same question, and the title is not same
topic.
Cloud you sent a new email with correct english title? It is good to be
searched.

------------------

Liang Zhang (John)
Apache ShardingSphere & Dubbo


772826099 <77...@qq.com> 于2019年3月15日周五 上午9:28写道:

> I mean, separation, master-slave, speaking, reading and writing table
> depots, under the condition of the route query can be routed to the
> specific one from the table, now see your source code, is the only
> mandatory routing master database, to be honest is from library data
> consistent in all cases, how to manually assigned to specific from table
> rather than to change the configuration file and restart, are looking
> forward to your reply
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "zhangliang@apache.org"<zh...@apache.org>;
> 发送时间: 2019年3月14日(星期四) 晚上10:54
> 收件人: "dev"<de...@shardingsphere.apache.org>;
>
> 主题: Re: 动弹建表问题
>
>
>
> For English only
>
> ------------------
>
> Liang Zhang (John)
> Apache ShardingSphere & Dubbo
>
>
> congyq1@163.com <co...@163.com> 于2019年3月14日周四 下午7:03写道:
>
> > 见信好:
> >     我通过配置项后,使用JPA方式连接数据库情况下,可以实现按照分片规则插入对应的表中,配置如下:
> >
> > server.port=8080
> > spring.jpa.hibernate.ddl-auto=update
> > spring.jpa.show-sql=true
> > spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
> >
> > sharding.jdbc.datasource.names=serverdb
> >
> >
> sharding.jdbc.datasource.serverdb.type=com.alibaba.druid.pool.DruidDataSource
> > sharding.jdbc.datasource.serverdb.driver-class-name=com.mysql.jdbc.Driver
> >
> >
> sharding.jdbc.datasource.serverdb.url=jdbc:mysql://localhost:3306/xxx?characterEncoding=utf8&useSSL=false
> > sharding.jdbc.datasource.serverdb.username=xxx
> > sharding.jdbc.datasource.serverdb.password=xxx
> >
> > sharding.jdbc.config.sharding.tables.config.dynamic=true
> > sharding.jdbc.config.sharding.tables.visit_api_log.config.dynamic=true
> >
> >
> sharding.jdbc.config.sharding.tables.visit_api_log.table-strategy.standard.sharding-column=date
> >
> >
> sharding.jdbc.config.sharding.tables.visit_api_log.table-strategy.standard.precise-algorithm-class-name=com.cong.testShardingSphere.algorithm.PreciseModuloShardingTableAlgorithm
> >
> >
> >
> PreciseModuloShardingTableAlgorithm类中会根据插入时间,数据插入时,进入对应的"visit_api_log_201901、visit_api_log_201902、visit_api_log_201903。。。”
> >
> >
> 但是现在有个问题,当我进行查询的时,因为对应的表“visit_api_log”目前为动态分表情况,查询数据时应该按照"visit_api_log_201901、visit_api_log_201902、visit_api_log_201903。。。”进行查询并统计结果返回。
> >     但是目前查询时不再查询根据动态生成的表名,仅查询visit_api_log原表数据。
> >     是有别的配置项需要配置,还是暂时不支持查询所有动态插入的表单库?这个问题请教下您,谢谢您的关注
> >
> >
> >
> >
> >
> >
> >
> >