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 2020/02/06 12:18:22 UTC

[GitHub] [incubator-shardingsphere] cielswift opened a new issue #3993: Start error with yml

cielswift opened a new issue #3993: Start error with yml
URL: https://github.com/apache/incubator-shardingsphere/issues/3993
 
 
   spring boot version 2.2
   jdk 13
   sharding 4.0.0-RC3
   
   I searched most of the cases and configured them with properties
   But I used yml, but something went wrong
   
   Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
   Reason: Failed to determine a suitable driver class
   
   This is my configuration
   ```yaml
     shardingsphere:  
       datasource:
         names: ds0,ds1
         ds0:
           type: com.alibaba.druid.pool.DruidDataSource
           driverClassName: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://mysql.ciel.cl:1600/ds0?seUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
           password: ciel
         ds1:
           type: com.alibaba.druid.pool.DruidDataSource
           driverClassName: com.mysql.cj.jdbc.Driver
           url: jdbc:mysql://mysql.ciel.cl:1601/ds1?seUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: root
           password: ciel
       sharding: 
         default-database-strategy:
           inline:
             sharding-column: id
             algorithm-expression: ds$->{id % 2}
   
         tables:   
           t_order:
             actual-data-nodes: ds$->{0..1}.t_order$->{0..2}
             table-strategy:
               inline:
                 sharding-column: id  
                 algorithm-expression: t_order$->{id % 2}
             key-generator: # 
               column: id
               type: SNOWFLAKE
   #        t_order_item:
   #          actual-data-nodes: ds$->{0..1}.t_order_item$->{0..1}
   #          table-strategy:
   #            inline:
   #              sharding-column: order_id
   #              algorithm-expression: t_order_item$->{order_id % 2}
       props:
         sql:
           show: true #
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services