betterjava commented on issue #2964: Can I configure multiple schemas? URL: https://github.com/apache/incubator-shardingsphere/issues/2964#issuecomment-527773470 @M-make There is no 'shardingRule' in your config ymal. Here is my config and it works well. config-shard1.yaml: ``` schemaName: z9 dataSources: demo_ds_master_0: url: jdbc:mysql://127.0.0.1:3306/demo_ds_master_0?serverTimezone=UTC&useSSL=false username: root password: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 demo_ds_master_1: url: jdbc:mysql://127.0.0.1:3306/demo_ds_master_1?serverTimezone=UTC&useSSL=false username: root password: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 shardingRule: tables: user: actualDataNodes: demo_ds_master_0.user_$->{0..1} tableStrategy: inline: shardingColumn: ex_id algorithmExpression: user_$->{ex_id % 2} databaseStrategy: inline: shardingColumn: ex_id algorithmExpression: demo_ds_master_0 keyGenerator: type: SNOWFLAKE column: id encryptRule: encryptors: user_name_encryptor: type: AES props: aes.key.value: 123456 tables: user: columns: logic_name: cipherColumn: name plainColumn: pre_name assistedQueryColumn: name_assisted encryptor: user_name_encryptor ``` config-shard2.ymal: ``` schemaName: sharding_db dataSources: demo_ds_master_0: url: jdbc:mysql://127.0.0.1:3306/demo_ds_master_0?serverTimezone=UTC&useSSL=false username: root password: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 demo_ds_master_1: url: jdbc:mysql://127.0.0.1:3306/demo_ds_master_1?serverTimezone=UTC&useSSL=false username: root password: connectionTimeoutMilliseconds: 30000 idleTimeoutMilliseconds: 60000 maxLifetimeMilliseconds: 1800000 maxPoolSize: 50 shardingRule: tables: user: actualDataNodes: demo_ds_master_0.user_$->{0..1} tableStrategy: inline: shardingColumn: ex_id algorithmExpression: user_$->{ex_id % 2} databaseStrategy: inline: shardingColumn: ex_id algorithmExpression: demo_ds_master_0 keyGenerator: type: SNOWFLAKE column: id ``` and the result picture: 
---------------------------------------------------------------- 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] With regards, Apache Git Services
