apache / shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Apache License 2.0
19.73k stars 6.69k forks source link

Can we provide check for configuration of `server.yaml`? #22499

Open wsm12138 opened 1 year ago

wsm12138 commented 1 year ago

Feature Request

ShardingSphere-5.2.2-SNAPSHOT
Commit ID: 34c5cba3bb9bc58c61496112ba44f533a63f9b94
Commit Message: Move RunnerParameters (#22496)
Branch: master
Build time: 2022-11-29T15:17:29+0800

Can we provide check for configuration of server.yaml? Now i can config wrong value for some key. It is obviously not true.

Is your feature request related to a problem?

no

Describe the feature you would like.

[root@localhost 1129]# mysql -uroot -proot -P3333 -h192.168.10.23
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.22-ShardingSphere-Proxy 5.2.2-SNAPSHOT-34c5cba

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW TRANSACTION RULE;
+--------------+---------------+-------+
| default_type | provider_type | props |
+--------------+---------------+-------+
| XA           | testasdasd    |       |
+--------------+---------------+-------+
1 row in set (0.26 sec)

mysql> ^DBye
[root@localhost 1129]# cat conf/server.yaml | grep -v ^# | grep -v ^$
authority:
  users:
    - user: root@%
      password: root
    - user: sharding
      password: sharding
  privilege:
    type: ALL_PERMITTED
transaction:
  defaultType: XA
  providerType: testasdasd
sqlParser:
  sqlCommentParseEnabled: true
  sqlStatementCache:
    initialCapacity: 1000
    maximumSize: 55535
  parseTreeCache:
    initialCapacity: 28
    maximumSize: 1000

dSF8V2ey8v

sandynz commented 1 year ago

Hi @wsm12138 , thanks for your suggestion.

We could try to verify global rule.

RaigorJiang commented 1 year ago

Good suggestion.

wsm12138 commented 2 weeks ago

Good suggestion.

Agree!