djession opened a new issue #8952:
URL: https://github.com/apache/shardingsphere/issues/8952


   when i using shardingsphere-proxy 5.0.0,i found that it didn't work either 
under Docker or manually deploying the proxy. The error content was the same.
   **proxy server log:**
   ```
   [INFO ] 16:06:12.319 [ShardingSphere-Command-9] ShardingSphere-SQL - Logic 
SQL: show tables
   [INFO ] 16:06:12.319 [ShardingSphere-Command-9] ShardingSphere-SQL - 
SQLStatement: MySQLShowTablesStatement(fromSchema=Optional.empty)
   [INFO ] 16:06:12.319 [ShardingSphere-Command-9] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: show tables
   [INFO ] 16:06:12.319 [ShardingSphere-Command-9] ShardingSphere-SQL - Actual 
SQL: ds_1 ::: show tables
   [INFO ] 16:06:12.337 [ShardingSphere-Command-10] ShardingSphere-SQL - Logic 
SQL: SHOW COLUMNS FROM t_order FROM sharding_db
   [INFO ] 16:06:12.337 [ShardingSphere-Command-10] ShardingSphere-SQL - 
SQLStatement: 
MySQLShowColumnsStatement(table=SimpleTableSegment(tableName=TableNameSegment(startIndex=18,
 stopIndex=24, identifier=IdentifierValue(value=t_order, quoteCharacter=NONE)), 
owner=Optional.empty, alias=Optional.empty), 
fromSchema=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dal.FromSchemaSegment@7dbcb5be])
   [INFO ] 16:06:12.337 [ShardingSphere-Command-10] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: SHOW COLUMNS FROM t_order_0 
   [INFO ] 16:06:12.340 [ShardingSphere-Command-12] ShardingSphere-SQL - Logic 
SQL: SHOW COLUMNS FROM t_order_item FROM sharding_db
   [INFO ] 16:06:12.341 [ShardingSphere-Command-12] ShardingSphere-SQL - 
SQLStatement: 
MySQLShowColumnsStatement(table=SimpleTableSegment(tableName=TableNameSegment(startIndex=18,
 stopIndex=29, identifier=IdentifierValue(value=t_order_item, 
quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty), 
fromSchema=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dal.FromSchemaSegment@47405aaf])
   [INFO ] 16:06:12.341 [ShardingSphere-Command-12] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: SHOW COLUMNS FROM t_order_item_0 
   [INFO ] 16:06:12.343 [ShardingSphere-Command-13] ShardingSphere-SQL - Logic 
SQL: show tables
   [INFO ] 16:06:12.344 [ShardingSphere-Command-13] ShardingSphere-SQL - 
SQLStatement: MySQLShowTablesStatement(fromSchema=Optional.empty)
   [INFO ] 16:06:12.344 [ShardingSphere-Command-13] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: show tables
   [INFO ] 16:06:12.344 [ShardingSphere-Command-13] ShardingSphere-SQL - Actual 
SQL: ds_1 ::: show tables
   [INFO ] 16:06:12.351 [ShardingSphere-Command-14] ShardingSphere-SQL - Logic 
SQL: SHOW COLUMNS FROM t_order FROM sharding_db
   [INFO ] 16:06:12.351 [ShardingSphere-Command-14] ShardingSphere-SQL - 
SQLStatement: 
MySQLShowColumnsStatement(table=SimpleTableSegment(tableName=TableNameSegment(startIndex=18,
 stopIndex=24, identifier=IdentifierValue(value=t_order, quoteCharacter=NONE)), 
owner=Optional.empty, alias=Optional.empty), 
fromSchema=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dal.FromSchemaSegment@4a68c5ec])
   [INFO ] 16:06:12.351 [ShardingSphere-Command-14] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: SHOW COLUMNS FROM t_order_0 
   [INFO ] 16:06:12.356 [ShardingSphere-Command-15] ShardingSphere-SQL - Logic 
SQL: SHOW COLUMNS FROM t_order_item FROM sharding_db
   [INFO ] 16:06:12.356 [ShardingSphere-Command-15] ShardingSphere-SQL - 
SQLStatement: 
MySQLShowColumnsStatement(table=SimpleTableSegment(tableName=TableNameSegment(startIndex=18,
 stopIndex=29, identifier=IdentifierValue(value=t_order_item, 
quoteCharacter=NONE)), owner=Optional.empty, alias=Optional.empty), 
fromSchema=Optional[org.apache.shardingsphere.sql.parser.sql.common.segment.dal.FromSchemaSegment@76026e50])
   [INFO ] 16:06:12.356 [ShardingSphere-Command-15] ShardingSphere-SQL - Actual 
SQL: ds_0 ::: SHOW COLUMNS FROM t_order_item_0 
   
   ```
   **mysql cli error:**
   
   ```
   mysql> select * from t_order;
   ERROR 2006 (HY000): MySQL server has gone away
   No connection. Trying to reconnect...
   Connection id:    23
   Current database: sharding_db
   
   ERROR 2006 (HY000): MySQL server has gone away
   No connection. Trying to reconnect...
   Connection id:    24
   Current database: sharding_db
   
   ERROR 2006 (HY000): MySQL server has gone away
   mysql> 
   
   ```
   
   **my config:**
   
   server.yaml
   
   ```yaml
   #
   #governance:
   #  name: governance_ds
   #  registryCenter:
   #    type: ZooKeeper
   #    serverLists: localhost:2181
   #    props:
   #      retryIntervalMilliseconds: 500
   #      timeToLiveSeconds: 60
   #      maxRetries: 3
   #      operationTimeoutMilliseconds: 500
   #  overwrite: false
   
   authentication:
     users:
       root:
         password: root
       sharding:
         password: sharding
         authorizedSchemas: sharding_db
   
   props:
     max-connections-size-per-query: 1
     acceptor-size: 16  # The default value is available processors count * 2.
     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
     proxy-opentracing-enabled: false
     proxy-hint-enabled: false
     query-with-cipher-column: true
     sql-show: true
     check-table-metadata-enabled: false
   
   ```
   config-sharding.yaml
   
   ```yaml
   #schemaName: sharding_db
   #
   #dataSourceCommon:
   #  username: postgres
   #  password: postgres
   #  connectionTimeoutMilliseconds: 30000
   #  idleTimeoutMilliseconds: 60000
   #  maxLifetimeMilliseconds: 1800000
   #  maxPoolSize: 50
   #  minPoolSize: 1
   #  maintenanceIntervalMilliseconds: 30000
   #
   #dataSources:
   #  ds_0:
   #    url: 
jdbc:postgresql://127.0.0.1:5432/demo_ds_0?serverTimezone=UTC&useSSL=false
   #  ds_1:
   #    url: 
jdbc:postgresql://127.0.0.1:5432/demo_ds_1?serverTimezone=UTC&useSSL=false
   #
   #rules:
   #- !SHARDING
   #  tables:
   #    t_order:
   #      actualDataNodes: ds_${0..1}.t_order_${0..1}
   #      tableStrategy:
   #        standard:
   #          shardingColumn: order_id
   #          shardingAlgorithmName: t_order_inline
   #      keyGenerateStrategy:
   #        column: order_id
   #        keyGeneratorName: snowflake
   #    t_order_item:
   #      actualDataNodes: ds_${0..1}.t_order_item_${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:
   #    database_inline:
   #      type: INLINE
   #      props:
   #        algorithm-expression: ds_${user_id % 2}
   #    t_order_inline:
   #      type: INLINE
   #      props:
   #        algorithm-expression: t_order_${order_id % 2}
   #    t_order_item_inline:
   #      type: INLINE
   #      props:
   #        algorithm-expression: t_order_item_${order_id % 2}
   #  
   #  keyGenerators:
   #    snowflake:
   #      type: SNOWFLAKE
   #      props:
   #        worker-id: 123
   
   
######################################################################################################
   #
   # If you want to connect to MySQL, you should manually copy MySQL driver to 
lib directory.
   #
   
######################################################################################################
   
   schemaName: sharding_db
   
   dataSourceCommon:
     username: root
     password: 12345
     connectionTimeoutMilliseconds: 30000
     idleTimeoutMilliseconds: 60000
     maxLifetimeMilliseconds: 1800000
     maxPoolSize: 50
     minPoolSize: 1
     maintenanceIntervalMilliseconds: 30000
   
   dataSources:
     ds_0:
       url: 
jdbc:mysql://192.168.183.132:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
     ds_1:
       url: 
jdbc:mysql://192.168.183.134:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..1}.t_order_${0..19}
         tableStrategy:
           standard:
             shardingColumn: order_id
             shardingAlgorithmName: t_order_inline
         keyGenerateStrategy:
           column: order_id
           keyGeneratorName: snowflake
       t_order_item:
         actualDataNodes: ds_${0..1}.t_order_item_${0..19}
         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:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 2}
       t_order_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_${order_id % 19}
       t_order_item_inline:
         type: INLINE
         props:
           algorithm-expression: t_order_item_${order_id % 19}
     
     keyGenerators:
       snowflake:
         type: SNOWFLAKE
         props:
           worker-id: 123
   ```
   
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to