2.0.1.27 dble_config表

含义:

当前dble内存中的配置信息(db、sharding、user、sequence)

使用方式:

语句:select * from dble_config\G
结果:Json格式,需将结果拷贝出进行格式化查看。如: Json格式化工具

*************************** 1. row ***************************
content: {"version":"4.0","dbGroup":[{"rwSplitMode":0,"name":"ha_group1","delayThreshold":100,"disableHA":"true","heartbeat":{"value":"select user()"},"dbInstance":[{"name":"hostM1","url":"**","password":"123456","user":"root","maxCon":200,"minCon":10,"usingDecrypt":"false","disabled":"false","id":"hostM1Id","readWeight":"10","primary":true},{"name":"hostM5","url":"**","password":"123456","user":"root","maxCon":15,"minCon":15,"disabled":"false","primary":false}]},{"rwSplitMode":0,"name":"ha_group2","heartbeat":{"value":"select user()"},"dbInstance":[{"name":"hostM2","url":"**","password":"123456","user":"root","maxCon":200,"minCon":10,"primary":true}]},{"rwSplitMode":0,"name":"ha_group3","delayThreshold":-1,"heartbeat":{"value":"select user()"},"dbInstance":[{"name":"hostM3","url":"**","password":"123456","user":"root","maxCon":15,"minCon":15,"disabled":"false","primary":true}]}],"schema":[{"name":"testdb","sqlMaxLimit":100,"shardingNode":"dn1","table":[{"type":"ShardingTable","properties":{"function":"func_enum","shardingColumn":"code","name":"tb_enum_sharding","shardingNode":"dn1,dn2","sqlMaxLimit":200}},{"type":"GlobalTable","properties":{"name":"test1","shardingNode":"dn1,dn2,dn3,dn4"}}]},{"name":"testdb2","shardingNode":"dn1"}],"shardingNode":[{"name":"dn1","dbGroup":"ha_group1","database":"db_1"},{"name":"dn2","dbGroup":"ha_group1","database":"db_2"},{"name":"dn3","dbGroup":"ha_group2","database":"db_3"},{"name":"dn4","dbGroup":"ha_group2","database":"db_4"}],"function":[{"name":"func_enum","clazz":"Enum","property":[{"value":"partition-enum.txt","name":"mapFile"},{"value":"0","name":"defaultNode"},{"value":"1","name":"type"}]}],"user":[{"type":"ManagerUser","properties":{"readOnly":false,"name":"man1","password":"654321","usingDecrypt":"false","maxCon":10}},{"type":"ShardingUser","properties":{"schemas":"testdb","readOnly":false,"blacklist":"blacklist1","name":"root","password":"123456","maxCon":20}},{"type":"RwSplitUser","properties":{"dbGroup":"ha_group3","blacklist":"blacklist1","name":"rwsu1","password":"123456","maxCon":20}}],"blacklist":[{"name":"blacklist1"}],"sequence_db_conf.properties":{"`TESTDB`.`GLOBAL`":"dn1","`TESTDB`.`COMPANY`":"dn1","`TESTDB`.`CUSTOMER`":"dn1","`TESTDB`.`ORDERS`":"dn1","`TESTDB`.`myauto_test`":"dn1"}}
1 row in set (0.33 sec)

格式化后:

{
    "version":"4.0",
    "dbGroup":[
        {
            "rwSplitMode":0,
            "name":"ha_group1",
            "delayThreshold":100,
            "disableHA":"true",
            "heartbeat":{
                "value":"select user()"
            },
            "dbInstance":[
                {
                    "name":"hostM1",
                    "url":"**",
                    "password":"123456",
                    "user":"root",
                    "maxCon":200,
                    "minCon":10,
                    "usingDecrypt":"false",
                    "disabled":"false",
                    "id":"hostM1Id",
                    "readWeight":"10",
                    "primary":true
                },
                {
                    "name":"hostM5",
                    "url":"**",
                    "password":"123456",
                    "user":"root",
                    "maxCon":15,
                    "minCon":15,
                    "disabled":"false",
                    "primary":false
                }
            ]
        },
        {
            "rwSplitMode":0,
            "name":"ha_group2",
            "heartbeat":{
                "value":"select user()"
            },
            "dbInstance":[
                {
                    "name":"hostM2",
                    "url":"**",
                    "password":"123456",
                    "user":"root",
                    "maxCon":200,
                    "minCon":10,
                    "primary":true
                }
            ]
        },
        {
            "rwSplitMode":0,
            "name":"ha_group3",
            "delayThreshold":-1,
            "heartbeat":{
                "value":"select user()"
            },
            "dbInstance":[
                {
                    "name":"hostM3",
                    "url":"**",
                    "password":"123456",
                    "user":"root",
                    "maxCon":15,
                    "minCon":15,
                    "disabled":"false",
                    "primary":true
                }
            ]
        }
    ],
    "schema":[
        {
            "name":"testdb",
            "sqlMaxLimit":100,
            "shardingNode":"dn1",
            "table":[
                {
                    "type":"ShardingTable",
                    "properties":{
                        "function":"func_enum",
                        "shardingColumn":"code",
                        "name":"tb_enum_sharding",
                        "shardingNode":"dn1,dn2",
                        "sqlMaxLimit":200
                    }
                },
                {
                    "type":"GlobalTable",
                    "properties":{
                        "name":"test1",
                        "shardingNode":"dn1,dn2,dn3,dn4"
                    }
                }
            ]
        },
        {
            "name":"testdb2",
            "shardingNode":"dn1"
        }
    ],
    "shardingNode":[
        {
            "name":"dn1",
            "dbGroup":"ha_group1",
            "database":"db_1"
        },
        {
            "name":"dn2",
            "dbGroup":"ha_group1",
            "database":"db_2"
        },
        {
            "name":"dn3",
            "dbGroup":"ha_group2",
            "database":"db_3"
        },
        {
            "name":"dn4",
            "dbGroup":"ha_group2",
            "database":"db_4"
        }
    ],
    "function":[
        {
            "name":"func_enum",
            "clazz":"Enum",
            "property":[
                {
                    "value":"partition-enum.txt",
                    "name":"mapFile"
                },
                {
                    "value":"0",
                    "name":"defaultNode"
                },
                {
                    "value":"1",
                    "name":"type"
                }
            ]
        }
    ],
    "user":[
        {
            "type":"ManagerUser",
            "properties":{
                "readOnly":false,
                "name":"man1",
                "password":"654321",
                "usingDecrypt":"false",
                "maxCon":10
            }
        },
        {
            "type":"ShardingUser",
            "properties":{
                "schemas":"testdb",
                "readOnly":false,
                "blacklist":"blacklist1",
                "name":"root",
                "password":"123456",
                "maxCon":20
            }
        },
        {
            "type":"RwSplitUser",
            "properties":{
                "dbGroup":"ha_group3",
                "blacklist":"blacklist1",
                "name":"rwsu1",
                "password":"123456",
                "maxCon":20
            }
        }
    ],
    "blacklist":[
        {
            "name":"blacklist1"
        }
    ],
    "sequence_db_conf.properties":{
        "`TESTDB`.`GLOBAL`":"dn1",
        "`TESTDB`.`COMPANY`":"dn1",
        "`TESTDB`.`CUSTOMER`":"dn1",
        "`TESTDB`.`ORDERS`":"dn1",
        "`TESTDB`.`myauto_test`":"dn1"
    }
}
适用场景:

在此之前查看dble中的配置只能通过配置文件一一查看,由于文件具有可修改的属性,因此这种方式得到的配置可能和真实的配置不一致。

表dble_config中的数据来自于dble内存中的实际配置信息,通过查询该表得到的配置更具备真实性、权威性

results matching ""

    No results matching ""