apache / shardingsphere

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

authority config in server.yaml could be invalid? #11769

Closed ddsr-ops closed 3 years ago

ddsr-ops commented 3 years ago

Question: In general, I config user authority rule in server.yaml when using sharding proxy. But, i can not connect proxy with user authorities has been configured in server.yaml. I hope someone can explain it.

[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -plove8013
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'192.168.15.130' (using password: YES)

However, I use root user and password 'root', connect proxy successfully. I DO NOT config it!

[root@centos7 logs]# mysql -uroot -h192.168.15.130 -P13308 -proot
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 11
Server version: 5.7.35-log-ShardingSphere-Proxy 5.0.0-beta

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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>

User sharding, in the same as user root.

[root@centos7 logs]# mysql -usharding -h192.168.15.130 -P13308 -psharding
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 13
Server version: 5.7.35-log-ShardingSphere-Proxy 5.0.0-beta

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> 

ENV:

  1. version info:

    • proxy version: ShardingSphere-Proxy 5.0.0-beta
    • mysql version: 5.7.35 in docker
  2. config info: server.yaml:

    governance: registryCenter: type: ZooKeeper serverLists: 172.17.0.2:2181 props: retryIntervalMilliseconds: 500 timeToLiveSeconds: 60 maxRetries: 3 operationTimeoutMilliseconds: 500 overwrite: false

    scaling: blockQueueSize: 10000 workerThread: 40

    rules:

    • !AUTHORITY users:
      • root@%:love8013
      • sharding@%:love8013 provider: type: NATIVE

    props: max-connections-size-per-query: 1 executor-size: 16 # Infinite by default. proxy-frontend-flush-threshold: 128 # The default value is 128.

    LOCAL: Proxy will run with LOCAL transaction.

    # XA: Proxy will run with XA transaction.
    # BASE: Proxy will run with B.A.S.E transaction.

    proxy-transaction-type: LOCAL xa-transaction-manager-type: Atomikos proxy-opentracing-enabled: false proxy-hint-enabled: false sql-show: false check-table-metadata-enabled: false lock-wait-timeout-milliseconds: 50000 # The maximum time to wait for a lock show-process-list-enabled: false

    Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.

    # The default value is -1, which means set the minimum value for different JDBC drivers.

    proxy-backend-query-fetch-size: -1

config-sharding.yaml:

###################################################################################################### #

If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.

# ######################################################################################################

schemaName: sharding_db

dataSources: ds_0: url: jdbc:mysql://172.17.0.3:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai username: root password: love8013 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1 ds_1: url: jdbc:mysql://172.17.0.3:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&useTimezone=true&serverTimezone=Asia/Shanghai username: root password: love8013 connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 minPoolSize: 1

rules:

  • !SHARDING tables: torder: actualDataNodes: ds${0..1}.torder${0..1} tableStrategy: standard: shardingColumn: order_id shardingAlgorithmName: t_order_inline keyGenerateStrategy: column: order_id keyGeneratorName: snowflake t_orderitem: actualDataNodes: ds${0..1}.t_orderitem${0..1} tableStrategy: standard: shardingColumn: order_id shardingAlgorithmName: t_order_item_inline keyGenerateStrategy: column: order_item_id keyGeneratorName: snowflake bindingTables:

    • t_order,t_order_item defaultDatabaseStrategy: standard: shardingColumn: user_id shardingAlgorithmName: database_inline defaultTableStrategy: none:

    shardingAlgorithms: databaseinline: type: INLINE props: algorithm-expression: ds${user_id % 2} t_order_inline: type: INLINE props: algorithm-expression: torder${order_id % 2} t_order_item_inline: type: INLINE props: algorithm-expression: t_orderitem${order_id % 2}

    keyGenerators: snowflake: type: SNOWFLAKE props: worker-id: 123

log info:

[INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:java.io.tmpdir=/tmp [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:java.compiler= [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.name=Linux [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.arch=amd64 [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.version=3.10.0-1160.36.2.el7.x86_64 [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.name=root [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.home=/root [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:user.dir=/root/soft/shardingsphere-proxy [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.memory.free=1830MB [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.memory.max=1945MB [INFO ] 2021-08-11 17:43:31.632 [main] org.apache.zookeeper.ZooKeeper - Client environment:os.memory.total=1945MB [INFO ] 2021-08-11 17:43:31.634 [main] org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=172.17.0.2:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionS tate@368f2016 [INFO ] 2021-08-11 17:43:31.637 [main] org.apache.zookeeper.common.X509Util - Setting -D jdk.tls.rejectClientInitiatedRenegotiation=true to disable client-initiated TLS renegotiation [INFO ] 2021-08-11 17:43:31.640 [main] o.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 1048575 Bytes [INFO ] 2021-08-11 17:43:31.645 [main] org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=false [INFO ] 2021-08-11 17:43:31.651 [main] o.a.c.f.imps.CuratorFrameworkImpl - Default schema [INFO ] 2021-08-11 17:43:31.660 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server 172.17.0.2/172.17.0.2:2181. [INFO ] 2021-08-11 17:43:31.660 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - SASL config status: Will not attempt to authenticate using SASL (unknown error) [INFO ] 2021-08-11 17:43:31.663 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /172.17.0.1:52378, server: 172. 17.0.2/172.17.0.2:2181 [INFO ] 2021-08-11 17:43:31.668 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Session establishment complete on server 172.17.0.2/172.17.0.2:2181, session id = 0x100012 38d9e0031, negotiated timeout = 40000 [INFO ] 2021-08-11 17:43:31.673 [main-EventThread] o.a.c.f.state.ConnectionStateManager - State change: CONNECTED [INFO ] 2021-08-11 17:43:31.678 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:31.678 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:31.793 [main] o.apache.curator.utils.Compatibility - Using org.apache.zookeeper.server.quorum.MultipleAddresses [INFO ] 2021-08-11 17:43:31.870 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... [INFO ] 2021-08-11 17:43:32.009 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. [INFO ] 2021-08-11 17:43:32.010 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... [INFO ] 2021-08-11 17:43:32.017 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. [INFO ] 2021-08-11 17:43:32.017 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated... [INFO ] 2021-08-11 17:43:32.017 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Close initiated... [INFO ] 2021-08-11 17:43:32.019 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Closed. [INFO ] 2021-08-11 17:43:32.019 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed. [INFO ] 2021-08-11 17:43:32.019 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Starting... [INFO ] 2021-08-11 17:43:32.023 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Start completed. [INFO ] 2021-08-11 17:43:32.023 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Starting... [INFO ] 2021-08-11 17:43:32.026 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Start completed. [INFO ] 2021-08-11 17:43:32.026 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown initiated... [INFO ] 2021-08-11 17:43:32.027 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Close initiated... [INFO ] 2021-08-11 17:43:32.027 [main] com.zaxxer.hikari.pool.HikariPool - HikariPool-2 - Closed. [INFO ] 2021-08-11 17:43:32.027 [main] com.zaxxer.hikari.HikariDataSource - HikariPool-2 - Shutdown completed. [INFO ] 2021-08-11 17:43:33.027 [main] c.a.icatch.provider.imp.AssemblerImp - Loaded jar:file:/root/soft/shardingsphere-proxy/lib/transactions-4.0.6.jar!/transactions-defaults.properties [INFO ] 2021-08-11 17:43:33.028 [main] c.a.icatch.provider.imp.AssemblerImp - Loaded jar:file:/root/soft/shardingsphere-proxy/lib/shardingsphere-transaction-xa-atomikos-5.0.0-beta.jar!/transa ctions.properties [WARN ] 2021-08-11 17:43:33.038 [main] c.a.icatch.provider.imp.AssemblerImp - Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and pr ofessional support or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice Thanks for using Atomikos! Evaluate http://www.atomikos.com/Main/ExtremeTransactions for advanced features and professional support or register at http://www.atomikos.com/Main/RegisterYourDownload to disable this message and receive FREE tips & advice [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.default_max_wait_time_on_shutdown = 9223372036854775807 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.allow_subtransactions = true [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.recovery_delay = 300000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.automatic_resource_registration = false [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.oltp_max_retries = 5 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.client_demarcation = false [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.threaded_2pc = false [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.serial_jta_transactions = false [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.log_base_dir = ./logs [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.rmi_export_class = none [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.max_actives = 10000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.checkpoint_interval = 50000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.enable_logging = true [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.log_base_name = xa_tx [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.max_timeout = 300000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.trust_client_tm = false [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: java.naming.factory.initial = com.sun.jndi.rmi.registry.RegistryContextFactory [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.tm_unique_name = 192.168.15.130.tm [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.forget_orphaned_log_entries_delay = 86400000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.oltp_retry_interval = 10000 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: java.naming.provider.url = rmi://localhost:1099 [INFO ] 2021-08-11 17:43:33.042 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.force_shutdown_on_vm_exit = false [INFO ] 2021-08-11 17:43:33.043 [main] c.a.icatch.provider.imp.AssemblerImp - USING: com.atomikos.icatch.default_jta_timeout = 300000 [INFO ] 2021-08-11 17:43:33.043 [main] c.a.icatch.provider.imp.AssemblerImp - Using default (local) logging and recovery... [INFO ] 2021-08-11 17:43:33.075 [main] c.a.d.xa.XATransactionalResource - resource-1-ds_0: refreshed XAResource [INFO ] 2021-08-11 17:43:33.080 [main] c.a.d.xa.XATransactionalResource - resource-2-ds_1: refreshed XAResource [INFO ] 2021-08-11 17:43:33.084 [main] o.a.s.p.i.i.AbstractBootstrapInitializer - Database name is MySQL, version is 5.7.35-log [INFO ] 2021-08-11 17:43:33.088 [main] o.a.s.s.c.e.j.FinishedCheckJobExecutor - Start finished check job executor. [INFO ] 2021-08-11 17:43:33.090 [main] o.a.c.f.imps.CuratorFrameworkImpl - Starting [INFO ] 2021-08-11 17:43:33.091 [main] org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=172.17.0.2:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionS tate@31ddb930 [INFO ] 2021-08-11 17:43:33.091 [main] o.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 1048575 Bytes [INFO ] 2021-08-11 17:43:33.091 [main] org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=false [INFO ] 2021-08-11 17:43:33.092 [main] o.a.c.f.imps.CuratorFrameworkImpl - Default schema [INFO ] 2021-08-11 17:43:33.099 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server 172.17.0.2/172.17.0.2:2181. [INFO ] 2021-08-11 17:43:33.099 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - SASL config status: Will not attempt to authenticate using SASL (unknown error) [INFO ] 2021-08-11 17:43:33.099 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /172.17.0.1:52404, server: 172. 17.0.2/172.17.0.2:2181 [INFO ] 2021-08-11 17:43:33.101 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Session establishment complete on server 172.17.0.2/172.17.0.2:2181, session id = 0x100012 38d9e0032, negotiated timeout = 40000 [INFO ] 2021-08-11 17:43:33.101 [main-EventThread] o.a.c.f.state.ConnectionStateManager - State change: CONNECTED [INFO ] 2021-08-11 17:43:33.102 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:33.102 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:33.103 [main] o.a.c.f.imps.CuratorFrameworkImpl - Starting [INFO ] 2021-08-11 17:43:33.103 [main] org.apache.zookeeper.ZooKeeper - Initiating client connection, connectString=172.17.0.2:2181 sessionTimeout=60000 watcher=org.apache.curator.ConnectionS tate@6e041285 [INFO ] 2021-08-11 17:43:33.104 [main] o.apache.zookeeper.ClientCnxnSocket - jute.maxbuffer value is 1048575 Bytes [INFO ] 2021-08-11 17:43:33.104 [main] org.apache.zookeeper.ClientCnxn - zookeeper.request.timeout value is 0. feature enabled=false [INFO ] 2021-08-11 17:43:33.104 [main] o.a.c.f.imps.CuratorFrameworkImpl - Default schema [INFO ] 2021-08-11 17:43:33.111 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Opening socket connection to server 172.17.0.2/172.17.0.2:2181. [INFO ] 2021-08-11 17:43:33.111 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - SASL config status: Will not attempt to authenticate using SASL (unknown error) [INFO ] 2021-08-11 17:43:33.111 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Socket connection established, initiating session, client: /172.17.0.1:52406, server: 172. 17.0.2/172.17.0.2:2181 [INFO ] 2021-08-11 17:43:33.112 [main-SendThread(172.17.0.2:2181)] org.apache.zookeeper.ClientCnxn - Session establishment complete on server 172.17.0.2/172.17.0.2:2181, session id = 0x100012 38d9e0033, negotiated timeout = 40000 [INFO ] 2021-08-11 17:43:33.113 [main-EventThread] o.a.c.f.state.ConnectionStateManager - State change: CONNECTED [INFO ] 2021-08-11 17:43:33.114 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:33.114 [main-EventThread] o.a.c.framework.imps.EnsembleTracker - New config event received: {} [INFO ] 2021-08-11 17:43:33.163 [main] org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor [INFO ] 2021-08-11 17:43:33.172 [main] o.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl [INFO ] 2021-08-11 17:43:33.173 [main] org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.3.2 created. [INFO ] 2021-08-11 17:43:33.173 [main] o.a.s.e.l.i.s.JobShutdownHookPlugin - Registering Quartz shutdown hook. _finished_check [INFO ] 2021-08-11 17:43:33.173 [main] org.quartz.simpl.RAMJobStore - RAMJobStore initialized. [INFO ] 2021-08-11 17:43:33.174 [main] org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.3.2) '_finished_check' with instanceId 'NON_CLUSTERED' Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally. NOT STARTED. Currently in standby mode. Number of jobs executed: 0 Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 1 threads. Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

[INFO ] 2021-08-11 17:43:33.174 [main] org.quartz.impl.StdSchedulerFactory - Quartz scheduler '_finished_check' initialized from an externally provided properties instance. [INFO ] 2021-08-11 17:43:33.174 [main] org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.3.2 [INFO ] 2021-08-11 17:43:33.242 [main] org.quartz.core.QuartzScheduler - Scheduler _finishedcheck$_NON_CLUSTERED started. [INFO ] 2021-08-11 17:43:33.243 [main] o.a.s.s.c.e.job.ScalingJobExecutor - Start scaling job executor. [INFO ] 2021-08-11 17:43:33.402 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758] REGISTERED [INFO ] 2021-08-11 17:43:33.403 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758] BIND: 0.0.0.0/0.0.0.0:13308 [INFO ] 2021-08-11 17:43:33.403 [main] o.a.s.p.frontend.ShardingSphereProxy - ShardingSphere-Proxy start success. [INFO ] 2021-08-11 17:43:33.404 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758, L:/0.0.0.0:13308] ACTIVE [INFO ] 2021-08-11 17:44:00.238 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758, L:/0.0.0.0:13308] READ: [id: 0xa33180a9, L:/192.168.15.130:13308 - R:/192.168.1 5.130:34286] [INFO ] 2021-08-11 17:44:00.241 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758, L:/0.0.0.0:13308] READ COMPLETE [INFO ] 2021-08-11 17:44:07.259 [epollEventLoopGroup-2-1] i.n.handler.logging.LoggingHandler - [id: 0xe5bf1758, L:/0.0.0.0:13308] READ: [id: 0x7361f2c8, L:/192.168.15.130:13308 - R:/192.168.1 5.130:34288]

menghaoranss commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

ddsr-ops commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

node /rules is null, details are shown in bellow:

[zk: localhost:2181(CONNECTED) 3] ls /
[lock, metadata, null, props, rules, states, zookeeper]
[zk: localhost:2181(CONNECTED) 4] ls /rules
[]

And, zookeeper is deployed in a docker.

ddsr-ops commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

I degrade zk from 3.7.0 to 3.6.2, nothing exists in node /rules

ddsr-ops commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

I migrate zk from docker to centos host, it works, then nothing also exists in node /rules.

[zk: localhost:2181(CONNECTED) 0] ls /rules
[]
[zk: localhost:2181(CONNECTED) 1] ls /
[lock, metadata, null, props, rules, states, zookeeper]

[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -plove8013
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 5
Server version: 5.7.35-log-ShardingSphere-Proxy 5.0.0-beta

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> exit;
Bye
[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'192.168.15.130' (using password: YES)
menghaoranss commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

I migrate zk from docker to centos host, it works, then nothing also exists in node /rules.

[zk: localhost:2181(CONNECTED) 0] ls /rules
[]
[zk: localhost:2181(CONNECTED) 1] ls /
[lock, metadata, null, props, rules, states, zookeeper]

[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -plove8013
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 5
Server version: 5.7.35-log-ShardingSphere-Proxy 5.0.0-beta

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> exit;
Bye
[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'192.168.15.130' (using password: YES)

Any content in other zk nodes?

ddsr-ops commented 3 years ago

Please check authority configuration in zookeeper which persisted in /rules.

I migrate zk from docker to centos host, it works, then nothing also exists in node /rules.

[zk: localhost:2181(CONNECTED) 0] ls /rules
[]
[zk: localhost:2181(CONNECTED) 1] ls /
[lock, metadata, null, props, rules, states, zookeeper]

[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -plove8013
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 5
Server version: 5.7.35-log-ShardingSphere-Proxy 5.0.0-beta

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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> exit;
Bye
[root@centos7 bin]# mysql -uroot -h192.168.15.130 -P13308 -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'192.168.15.130' (using password: YES)

Any content in other zk nodes?

I run ls -R in zk shell:

[zk: localhost:2181(CONNECTED) 4] ls -R /
/
/governance_ds
/lock
/metadata
/null
/props
/rules
/states
/zookeeper
/governance_ds/scaling
/governance_ds/scaling/632626829215137792
/governance_ds/scaling/632632714486349825
/governance_ds/scaling/632634198926032896
/governance_ds/scaling/632640186810892289
/governance_ds/scaling/632645043529711616
/governance_ds/scaling/632626829215137792/config
/governance_ds/scaling/632632714486349825/config
/governance_ds/scaling/632634198926032896/config
/governance_ds/scaling/632640186810892289/config
/governance_ds/scaling/632645043529711616/config
/lock/ack
/lock/locks
/metadata/sharding_db
/metadata/sharding_db/dataSources
/metadata/sharding_db/rules
/metadata/sharding_db/schema
/null/scaling
/null/scaling/_finished_check
/null/scaling/_finished_check/config
/null/scaling/_finished_check/instances
/null/scaling/_finished_check/leader
/null/scaling/_finished_check/servers
/null/scaling/_finished_check/sharding
/null/scaling/_finished_check/leader/sharding
/null/scaling/_finished_check/servers/192.168.15.130
/null/scaling/_finished_check/sharding/0
/null/scaling/_finished_check/sharding/0/instance
/states/datanodes
/states/primarynodes
/states/proxynodes
/zookeeper/config
/zookeeper/quota

@menghaoranss

menghaoranss commented 3 years ago

Please configure overwrite as true and try again.

ddsr-ops commented 3 years ago

Please configure overwrite as true and try again. I set overwrite as true, solve it, but /rules in zk has nothing [zk: localhost:2181(CONNECTED) 5] ls /rules []

menghaoranss commented 3 years ago

Please configure overwrite as true and try again. I set overwrite as true, solve it, but /rules in zk has nothing [zk: localhost:2181(CONNECTED) 5] ls /rules []

Could it be reproduced without docker?

ddsr-ops commented 3 years ago

I plan to use proxy 4.1 instead of 5.x