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/07/02 14:31:36 UTC

[GitHub] [shardingsphere] Arch-Digest opened a new issue #6246: sharding-proxy can't unmarshal yaml config from config cneter.

Arch-Digest opened a new issue #6246:
URL: https://github.com/apache/shardingsphere/issues/6246


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - 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 anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   
   ```
   sharding-proxy:4.1.1
   shardingsphere-ui:4.1.1
   zookeeper:3.4.14
   ```
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ```
   ShardingSphere-Proxy + ShardingSphere-ui + zookeeper
   ```
   
   ### Expected behavior
   
   Load data source configurations from zk.
   
   ### Actual behavior
   
   After insert data source configurations into zk, ShardingSphere-Proxy work failed. 
   Here is error logs : 
   
   ```
   services_zk_1 is up-to-date
   Starting services_ssp_1 ... done
   Attaching to services_ssp_1
   ssp_1    | Starting the Sharding-Proxy ...
   ssp_1    | The port is 3308
   ssp_1    | The classpath is /opt/sharding-proxy/conf:.:..:/opt/sharding-proxy/lib/*:/opt/sharding-proxy/lib/*:/opt/sharding-proxy/ext-lib/*
   ssp_1    | Please check the STDOUT file: /opt/sharding-proxy/logs/stdout.log
   ssp_1    | [INFO ] 14:08:27.810 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.arch=amd64
   ssp_1    | [INFO ] 14:08:27.810 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.version=4.9.125-linuxkit
   ssp_1    | [INFO ] 14:08:27.810 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.name=root
   ssp_1    | [INFO ] 14:08:27.810 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.home=/root
   ssp_1    | [INFO ] 14:08:27.811 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.dir=/opt/sharding-proxy
   ssp_1    | [INFO ] 14:08:27.812 [main] org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=zk:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@1fa268de
   ssp_1    | [INFO ] 14:08:27.836 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server services_zk_1.services_default/172.28.0.2:2181. Will not attempt to authenticate using SASL (unknown error)
   ssp_1    | [INFO ] 14:08:27.844 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Socket connection established to services_zk_1.services_default/172.28.0.2:2181, initiating session
   ssp_1    | [INFO ] 14:08:27.860 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Session establishment complete on server services_zk_1.services_default/172.28.0.2:2181, sessionid = 0x10000a3ce05000b, negotiated timeout = 40000
   ssp_1    | [INFO ] 14:08:27.865 [main-EventThread] o.a.c.f.state.ConnectionStateManager - State change: CONNECTED
   ssp_1    | [INFO ] 14:08:27.885 [main] o.a.c.f.imps.CuratorFrameworkImpl - Starting
   ssp_1    | [INFO ] 14:08:27.886 [main] org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=zk:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionState@293a5bf6
   ssp_1    | [INFO ] 14:08:27.889 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server services_zk_1.services_default/172.28.0.2:2181. Will not attempt to authenticate using SASL (unknown error)
   ssp_1    | [INFO ] 14:08:27.890 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Socket connection established to services_zk_1.services_default/172.28.0.2:2181, initiating session
   ssp_1    | [INFO ] 14:08:27.894 [main-SendThread(services_zk_1.services_default:2181)] org.apache.zookeeper.ClientCnxn - Session establishment complete on server services_zk_1.services_default/172.28.0.2:2181, sessionid = 0x10000a3ce05000c, negotiated timeout = 40000
   ssp_1    | [INFO ] 14:08:27.894 [main-EventThread] o.a.c.f.state.ConnectionStateManager - State change: CONNECTED
   ssp_1    | [INFO ] 14:08:28.135 [main] o.a.s.core.log.ConfigurationLogger - Authentication:
   ssp_1    | users:
   ssp_1    |   system:
   ssp_1    |     authorizedSchemas: system
   ssp_1    |     password: system
   ssp_1    |   users:
   ssp_1    |     authorizedSchemas: users
   ssp_1    |     password: users
   ssp_1    |   root:
   ssp_1    |     authorizedSchemas: ''
   ssp_1    |     password: '123456'
   ssp_1    | 
   ssp_1    | [INFO ] 14:08:28.136 [main] o.a.s.core.log.ConfigurationLogger - Properties:
   ssp_1    | {}
   ssp_1    | 
   ssp_1    | [INFO ] 14:08:28.685 [Curator-Framework-0] o.a.c.f.imps.CuratorFrameworkImpl - backgroundOperationsLoop exiting
   ssp_1    | [INFO ] 14:08:28.698 [main-EventThread] org.apache.zookeeper.ClientCnxn - EventThread shut down
   ssp_1    | [INFO ] 14:08:28.698 [main] org.apache.zookeeper.ZooKeeper - Session: 0x10000a3ce05000b closed
   ssp_1    | Exception in thread "main" java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration
   ssp_1    |      at org.apache.shardingsphere.orchestration.core.configcenter.ConfigCenter.lambda$loadDataSourceConfigurations$1(ConfigCenter.java:242)
   ssp_1    |      at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
   ssp_1    |      at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
   ssp_1    |      at java.util.Iterator.forEachRemaining(Iterator.java:116)
   ssp_1    |      at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
   ssp_1    |      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
   ssp_1    |      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
   ssp_1    |      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
   ssp_1    |      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
   ssp_1    |      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
   ssp_1    |      at org.apache.shardingsphere.orchestration.core.configcenter.ConfigCenter.loadDataSourceConfigurations(ConfigCenter.java:242)
   ssp_1    |      at org.apache.shardingsphere.shardingproxy.Bootstrap.getSchemaDataSourceParameterMap(Bootstrap.java:149)
   ssp_1    |      at org.apache.shardingsphere.shardingproxy.Bootstrap.startWithRegistryCenter(Bootstrap.java:138)
   ssp_1    |      at org.apache.shardingsphere.shardingproxy.Bootstrap.main(Bootstrap.java:87)
   ```
    
   
   ### Reason analyze (If you can)
   
   In `loadDataSourceConfigurations` method  of  `org.apache.shardingsphere.orchestration.core.configcenter.ConfigCenter`  
    when unmarshal yaml file  the class `YamlDataSourceConfiguration.class` not present.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   
   datasource config: 
   
   ```
   ds_0:
      url: jdbc:mysql://127.0.0.1:3306/sass_users?serverTimezone=Asia/Shanghai&useSSL=false
      username: root
      password: 123456
   ```
   
   
   ### Example codes for reproduce this issue (such as a github link).
   
   


----------------------------------------------------------------
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] Arch-Digest closed issue #6246: sharding-proxy can't unmarshal yaml config from config cneter.

Posted by GitBox <gi...@apache.org>.
Arch-Digest closed issue #6246:
URL: https://github.com/apache/shardingsphere/issues/6246


   


----------------------------------------------------------------
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] Arch-Digest commented on issue #6246: sharding-proxy can't unmarshal yaml config from config cneter.

Posted by GitBox <gi...@apache.org>.
Arch-Digest commented on issue #6246:
URL: https://github.com/apache/shardingsphere/issues/6246#issuecomment-653047241


   wow! must add `ds_0: !!org.apache.shardingsphere.orchestration.core.configuration.YamlDataSourceConfiguration` 


----------------------------------------------------------------
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