赞
踩
/*+ mycat:resetConfig{} */;
- /*+ mycat:createUser{
- "username":"user",
- "password":"",
- "ip":"127.0.0.1",
- "transactionType":"xa"}
- */;
/*+ mycat:dropUser{ "username":"user"} */;
/*+ mycat:showUsers */;
- /*+ mycat:createDataSource{
- "dbType":"mysql",
- "idleTimeout":60000,
- "initSqls":[],
- "initSqlsGetConnection":true,
- "instanceType":"READ_WRITE",
- "maxCon":1000,
- "maxConnectTimeout":3000,
- "maxRetryCount":5,
- "minCon":1,
- "name":"dc1",
- "password":"123456",
- "type":"JDBC",
- "url":"jdbc:mysql://127.0.0.1:3306?useUnicode=true&serverTimezone=UTC&characterEncoding=UTF-8",
- "user":"root",
- "weight":0}
- */;
- /*+ mycat:dropDataSource{
- "dbType":"mysql",
- "idleTimeout":60000,
- "initSqls":[],
- "initSqlsGetConnection":true,
- "instanceType":"READ_WRITE",
- "maxCon":1000,
- "maxConnectTimeout":3000,
- "maxRetryCount":5,
- "minCon":1,
- "name":"dc1",
- "type":"JDBC",
- "weight":0}
- */;
/*+ mycat:showDataSources{} */;
- 先创建两个数据源dc1和dc2,然后创建集群,dc1是主节点
-
- /*! mycat:createCluster{
- "clusterType":"MASTER_SLAVE",
- "heartbeat":{
- "heartbeatTimeout":1000,
- "maxRetry":3,
- "minSwitchTimeInterval":300,
- "slaveThreshold":0
- },
- "masters":[
- "dc1" //主节点
- ],
- "maxCon":200,
- "name":"c0",
- "readBalanceType":"BALANCE_ALL",
- "replicas":[
- "dc2" //从节点
- ],
- "switchType":"SWITCH"
- } */
/*! mycat:dropCluster{ "name":"c0"} */;
/*+ mycat:showClusters{} */
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。