Add Yat Test for ShardingSphere

构建 yat

下载源码

git clone https://gitee.com/opengauss/Yat.git

构建 yat

cd Yat/yat-master
chmod +x gradlew
./gradlew pack
cd pkg
chmod +x install
./install -F

根据源码中的 dockerFile 构建 dockerImage

使用 yat 测试 测试 shardingSphere proxy

利用构建的 yat image 运行相关测试 需要挂在到对应目录

docker run --name yat0 -i -t -v /Users/chenchuxin/Documents/GitHub/Yat/openGaussBase:/root/openGaussBase -w /root/openGaussBase --entrypoint=bash --privileged=true yat-v1

修改 yat 项目 openGaussBase/conf 下的 configure.yml 文件

Polar Db

https://zhuanlan.zhihu.com/p/515688555

mac 开发环境启动 galaxysql

https://hub.docker.com/r/polardbx/polardb-x

docker pull polardbx/polardb-x
docker run -d --name some-dn-and-gms --env mode=dev -p 4886:4886 -p 32886:32886 polardbx/polardb-x
docker exec -it 41d8a027 bash
mysql -h127.0.0.1 -P4886 -uroot -padmin -D polardbx_meta_db_polardbx -e "select passwd_enc from storage_info where inst_kind=2"

获取密码后修改 server.properties

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
serverPort=8528
managerPort=3406
rpcPort=9090
charset=utf-8
processors=4
processorHandler=16
processorKillExecutor=128
timerExecutor=8
managerExecutor=256
serverExecutor=1024
idleTimeout=
trustedIps=127.0.0.1
slowSqlTime=1000
maxConnection=20000
allowManagerLogin=1
allowCrossDbQuery=true
galaxyXProtocol=1
metaDbAddr=127.0.0.1:4886
metaDbXprotoPort=32886
metaDbUser=my_polarx
# 前文查看的存储节点密码
metaDbPasswd=qEJWtCdgsOIie4j4mKP2Bvg2dsFHzdIhTaqMiq86N1QQU1HHL7olKb60pxz5hp/4
#?? E2+jB0*0&gM9)9$4+6)E4@1$lO9%G8+jA4_
metaDbName=polardbx_meta_db_polardbx
instanceId=polardbx-polardbx

注释掉 CobarServer.java 中 tryStartCdcManager(); 代码

How to Modify Pr

Step 1: 克隆项目

Step 2: 添加新的远程仓库 为了修改他人 Fork 的仓库,你需要将其添加到自己的远程仓库列表中

$ git remote add sirmin https://github.com/SirMin/shardingsphere.git

现在,当你执行 git remote -v 指令时,就可以看到他人 Fork 的仓库,出现在你的远程仓库列表中:

% git remote -v
origin	https://github.com/tuichenchuxin/shardingsphere.git (fetch)
origin	https://github.com/tuichenchuxin/shardingsphere.git (push)
sirmin	https://github.com/SirMin/shardingsphere.git (fetch)
sirmin	https://github.com/SirMin/shardingsphere.git (push)
upstream	https://github.com/apache/shardingsphere.git (fetch)
upstream	https://github.com/apache/shardingsphere.git (push)

Step 3: 拉取新的远程仓库

mac docker 安装 oracle 11g

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker run --privileged --restart=always --name oracle_11g -p 1521:1521 -d registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker exec -it 容器ID /bin/bash
source /home/oracle/.bash_profile
sqlplus nologconnect as sysdba
1
2
3
4
create user oracle identified by oracle#123;
alter user system identified by system;
alter user system identified by 123456;
grant connect,resource,dba to oracle;

参考:https://baijiahao.baidu.com/s?id=1709232831349390844&wfr=spider&for=pc