k8s环境部署mycat集群

k8s环境部署mycat集群

一、通过yaml部署mycat集群
1、mycat-config.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: mycat-config
  namespace: mysql
  labels:
    app: mycat
data:
  schema.xml: "<?xml version=\"1.0\"?>\n<!DOCTYPE mycat:schema SYSTEM \"schema.dtd\">\n:schema
    xmlns:mycat=\"http://io.mycat/\">\n    >\n    >\n    >\n    >\n    >\n    >\n    >\n             >select user()>\n
    \           -0.mysql.mysql:3306\" user=\"root\"
    password=\"\">\n            -read.mysql:3306\"
    user=\"root\" password=\"\" />\n             > \n             -0.mysql.mysql:3306\" user=\"root\" password=\"\"
    />\n         >\n:schema>\n"
  server.xml: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!-- - - Licensed under
    the Apache License, Version 2.0 (the \"License\"); \n\t- you may not use this
    file except in compliance with the License. - You \n\tmay obtain a copy of the
    License at - - http://www.apache.org/licenses/LICENSE-2.0 \n\t- - Unless required
    by applicable law or agreed to in writing, software - \n\tdistributed under the
    License is distributed on an \"AS IS\" BASIS, - WITHOUT \n\tWARRANTIES OR CONDITIONS
    OF ANY KIND, either express or implied. - See the \n\tLicense for the specific
    language governing permissions and - limitations \n\tunder the License. -->\n<!DOCTYPE
    mycat:server SYSTEM \"server.dtd\">\n:server xmlns:mycat=\"http://io.mycat/\">\n\t>\n\t>0> <!-- 0为需要密码登陆、1为不需要密码登陆 ,默认为0,设置为1则需要指定默认账户-->\n\t>1>\n\t>0>
    \ <!-- 1为开启实时统计、0为关闭 -->\n\t>0>
    \ <!-- 1为开启全加班一致性检测、0为关闭 -->\n\n\t\t>2>\n\t>false> <!-- 子查询中存在关联查询的情况下,检查关联字段中是否有分片字段
    .默认 false -->\n      <!--  >1>--> <!--1为开启mysql压缩协议-->\n
    \       <!--  >5.6.20>--> <!--设置模拟的MySQL版本号-->\n\t\n\t\t
    name=\"handleDistributedTransactions\">0>\n\t\t\n\t\t\t<!--\n\t\t\toff
    heap for merge/order/group/limit      1开启   0关闭\n\t\t-->\n\t\t>1>\n\n\t\t<!--\n\t\t\t单位为m\n\t\t-->\n
    \       >64k>\n\n\t\t<!--\n\t\t\t单位为k\n\t\t-->\n\t\t
    name=\"spillsFileBufferSize\">1k>\n\n\t\t>0>\n\n\t\t<!--\n\t\t\t单位为m\n\t\t-->\n\t\t
    name=\"systemReserveMemorySize\">384m>\n\n\n\t\t<!--是否采用zookeeper协调切换
    \ -->\n\t\t>false>\n\n\t\t<!-- XA Recovery
    Log日志路径 -->\n\t\t<!-- name=\"XARecoveryLogBaseDir\">./>-->\n\n\t\t<!--
    XA Recovery Log日志名称 -->\n\t\t<!-- name=\"XARecoveryLogBaseName\">tmlog>-->\n\t\t<!--如果为
    true的话 严格遵守隔离级别,不会在仅仅只有select语句的时候在事务中切换连接-->\n\t\t>false>\n\t\t\n\t\t>true>\n\t\t\n\t>\n\t\n\t<!-- 全局SQL防火墙设置
    -->\n\t<!--白名单可以使用通配符%或着*-->\n\t\n\t
                    

你可能感兴趣的:(mycat,mycat)