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/04/29 03:25:21 UTC
[GitHub] [shardingsphere] huntunshule opened a new issue #5375: How do I connect sharding-proxy in the springboot project?
huntunshule opened a new issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375
How do I connect sharding-proxy in the springboot project? Do I need to rely on it? I did not find relevant documents.
Thank you very much!!
----------------------------------------------------------------
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 #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-620975134
FYI: https://shardingsphere.apache.org/document/current/en/quick-start/sharding-proxy-quick-start/
----------------------------------------------------------------
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] huntunshule commented on issue #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
huntunshule commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-620995046
> 1. config and start sharding-proxy like above link
> 2. use jdbc connecting to sharding-proxy just as a real mysql server
I have almost followed the steps you mentioned, but there is the following error
```
2020-04-29 13:25:03.834 ERROR 7960 [] [main] com.alibaba.druid.pool.DruidDataSource init datasource error, url: jdbc:mysql://192.168.1.211:3312/cloud-master?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
at com.mysql.cj.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:906)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:831)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:156)
at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:787)
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150)
...
ERROR 7960 [] [main] com.alibaba.druid.pool.DruidDataSource {dataSource-1} init error
```
----------------------------------------------------------------
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] cherrylzhao commented on issue #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
cherrylzhao commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-621245589
you can download it from `https://dist.apache.org/repos/dist/dev/shardingsphere/4.1.0/apache-shardingsphere-4.1.0-sharding-proxy-bin.tar.gz`, we will release it recently
----------------------------------------------------------------
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] huntunshule commented on issue #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
huntunshule commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-620995365
this is mysql application.yaml
```
spring:
datasource:
dynamic:
primary: master
datasource:
master:
username: ${aic.datasource.username}
password: ${aic.datasource.password}
url: jdbc:mysql://192.168.1.211:3312/cloud-master?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
driver-class-name: com.mysql.cj.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] huntunshule commented on issue #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
huntunshule commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-621565100
> you can download it from `https://dist.apache.org/repos/dist/dev/shardingsphere/4.1.0/apache-shardingsphere-4.1.0-sharding-proxy-bin.tar.gz`, we will release it recently
Now, all runs perfectly, thanks
This is my Dockerfile
```
FROM java:8
COPY ./apache-shardingsphere-4.1.0-sharding-proxy-bin.tar.gz /opt/
RUN cd /opt && tar -zxvf apache-shardingsphere-4.1.0-sharding-proxy-bin.tar.gz && \
rm -f sharding-proxy.tar.gz && \
mv apache-shardingsphere-4.1.0-sharding-proxy-bin sharding-proxy && \
mkdir -p /opt/sharding-proxy/ext-lib
COPY ./mysql-connector-java-8.0.17.jar /opt/sharding-proxy/lib
ENTRYPOINT /opt/sharding-proxy/bin/start.sh && tail -f /opt/sharding-proxy/logs/stdout.log
```
----------------------------------------------------------------
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 #5375: How do I connect sharding-proxy in the springboot project?
Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #5375:
URL: https://github.com/apache/shardingsphere/issues/5375#issuecomment-620991106
1. config and start sharding-proxy like above link
2. use jdbc connecting to sharding-proxy just as a real mysql server
----------------------------------------------------------------
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