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/05/07 02:17:34 UTC
[GitHub] [shardingsphere] dostar opened a new issue #5450: Fetch DataSource by yaml file?
dostar opened a new issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450
## Question
**For English only**, other languages will not accept.
Before asking a question, make sure you have:
- Googled your question.
- Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
- Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response **more than 7 days** and we cannot reproduce it on current information, we will **close 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] dostar edited a comment on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar edited a comment on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-624999969
----------------------------------------------------------------
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
[GitHub] [shardingsphere] yu199195 commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-624998978
What database connection pool ? if you ues HikariDataSource ,this driverClassName is com.mysql.jdbc.Driver
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar removed a comment on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar removed a comment on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625021183
`
dataSources:
ds0: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
ds1: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
shardingRule:
tables:
t_order:
actualDataNodes: ds${0..1}.t_order_${0..1}
tableStrategy:
inline:
shardingColumn: order_id
algorithmExpression: t_order_${order_id % 2}
keyGenerator:
type: SNOWFLAKE
column: order_id
props:
worker.id: 123
defaultDatabaseStrategy:
inline:
shardingColumn: user_id
algorithmExpression: ds${user_id % 2}
defaultTableStrategy:
none:
props:
sql.show: false`
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar edited a comment on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar edited a comment on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625014357
> Can you use reference spring boot's example?
> The raw jdbc yaml maybe not suitable with spring boot starter.
Can i hava the other way to get DataSource with springboot2 starter at bean config?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] terrymanu commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625009361
Can you use reference spring boot's example?
The raw jdbc yaml maybe not suitable with spring boot starter.
----------------------------------------------------------------
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
[GitHub] [shardingsphere] kimmking commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625020760
Can you show me your yaml file?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar edited a comment on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar edited a comment on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-624999969
HikariDataSource,but when I use com.mysql.jdbc.Driver , is also the same error。
### caused by: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
in 'reader', line 4, column 20:
driverClassName: com.mysql.jdbc.Driver
BTW,mysql-connector-java version is 5.1.48
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625021183
`
dataSources:
ds0: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
ds1: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useUnicode=true&characterEncoding=UTF-8
username: root
password:
shardingRule:
tables:
t_order:
actualDataNodes: ds${0..1}.t_order_${0..1}
tableStrategy:
inline:
shardingColumn: order_id
algorithmExpression: t_order_${order_id % 2}
keyGenerator:
type: SNOWFLAKE
column: order_id
props:
worker.id: 123
defaultDatabaseStrategy:
inline:
shardingColumn: user_id
algorithmExpression: ds${user_id % 2}
defaultTableStrategy:
none:
props:
sql.show: false`
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625022012
> Can you show me your yaml file?
I have send file to u by wechat。
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-625014357
> Can you use reference spring boot's example?
> The raw jdbc yaml maybe not suitable with spring boot starter.
Can i hava the other way to get DataSource with springboot2 starter at bean confg?
----------------------------------------------------------------
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
[GitHub] [shardingsphere] dostar commented on issue #5450: Fetch DataSource by yaml file error
Posted by GitBox <gi...@apache.org>.
dostar commented on issue #5450:
URL: https://github.com/apache/shardingsphere/issues/5450#issuecomment-624999969
HikariDataSource,but when I use com.mysql.jdbc.Driver , is also the same error。
### aused by: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
in 'reader', line 4, column 20:
driverClassName: com.mysql.jdbc.Driver
----------------------------------------------------------------
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