# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # kind: ConfigMap apiVersion: "1.0" metadata: name: arana-config data: tenants: - name: arana sys_db: #host: arana-mysql host: 127.0.0.1 port: 3310 username: root password: "123456" # TODO It is recommended that the initialization of the subsequent system library be handled by arana internally database: __arana_sys weight: r10w10 parameters: users: - username: root password: "123456" - username: arana password: "123456" clusters: - name: employees type: mysql sql_max_limit: -1 tenant: arana parameters: slow_threshold: 1s max_allowed_packet: 256M groups: - name: employees_0000 nodes: - node0 - name: employees_0001 nodes: - node1 sharding_rule: tables: - name: employees.student sequence: type: snowflake option: db_rules: - columns: - name: uid expr: parseInt($0 % 32 / 8) tbl_rules: - columns: - name: uid expr: $0 % 32 topology: db_pattern: employees_${0000..0003} tbl_pattern: student_${0000..0031} attributes: allow_full_scan: true sqlMaxLimit: -1 - name: employees.friendship sequence: type: snowflake option: db_rules: - columns: - name: uid - name: friend_id expr: parseInt(($0*31+$1) % 32 / 8) tbl_rules: - columns: - name: uid - name: friend_id expr: ($0*31+$1) % 32 topology: db_pattern: employees_${0000..0003} tbl_pattern: friendship_${0000..0031} attributes: allow_full_scan: true sqlMaxLimit: -1 nodes: node0: name: node0 host: 127.0.0.1 port: 3310 username: root password: "123456" database: employees_0000 weight: r10w10 parameters: node1: name: node1 host: 127.0.0.1 port: 3311 username: root password: "123456" database: employees_0001 weight: r10w10 parameters: