2025年4月3日 | 版本 8.0
东方通关系数据服务(RDS)是一款国产高性能数据库中间件产品,提供数据库连接池、SQL解析、读写分离、分库分表等功能。本指南将详细介绍如何安装和配置东方通RDS。
支持高并发数据库访问,优化SQL执行效率
提供SQL注入防护、敏感数据脱敏等安全机制
支持数据库故障自动切换,确保服务连续性
注意: 生产环境建议使用专用服务器,配置应根据实际业务需求调整。
scp tongrds-8.0-linux-x64.tar.gz root@your-server:/opt
cd /opt tar -zxvf tongrds-8.0-linux-x64.tar.gz
cd tongrds-8.0
./install.sh
安装过程中会提示选择安装路径、服务端口等配置,可按默认值或根据需求修改。
service tongrds start
使用客户端工具连接RDS服务:
mysql -h127.0.0.1 -P8066 -uroot -p
检查服务状态(Linux):
service tongrds status
检查服务状态(Windows):
sc query TongRDS
/opt/tongrds/conf/server.xmlC:\TongRDS\conf\server.xml<system>
<property name="serverPort">8066</property>
<property name="managerPort">9066</property>
<property name="charset">utf8</property>
</system>
<dataSource name="ds_test">
<property name="url">jdbc:mysql://127.0.0.1:3306/test</property>
<property name="username">root</property>
<property name="password">123456</property>
<property name="maxPoolSize">100</property>
<property name="minPoolSize">10</property>
</dataSource>
<user name="app_user">
<property name="password">app_password</property>
<property name="schemas">test</property>
<property name="readOnly">false</property>
</user>
firewall-cmd --zone=public --add-port=8066/tcp --permanent firewall-cmd --reload
<dataNode name="dn_mysql">
<writeHost host="master" url="jdbc:mysql://master:3306"
user="root" password="123456"/>
<readHost host="slave1" url="jdbc:mysql://slave1:3306"
user="root" password="123456"/>
<readHost host="slave2" url="jdbc:mysql://slave2:3306"
user="root" password="123456"/>
</dataNode>
<schema name="test">
<table name="orders" primaryKey="id" dataNode="dn1,dn2"
rule="mod-long">
<childTable name="order_items" joinKey="order_id"
parentKey="id"/>
</table>
</schema>
<function name="mod-long" class="io.mycat.route.function.PartitionByMod">
<property name="count">2</property>
</function>
<firewall>
<whitehost>
<host host="192.168.1.*" user="app_user"/>
</whitehost>
<blacklist check="true">
<property name="deleteAllow">false</property>
<property name="updateAllow">false</property>
</blacklist>
</firewall>
修改启动脚本中的JVM参数:
JAVA_OPTS="-server -Xms4g -Xmx4g -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"
netstat -tulnp | grep 8066 # Linux netstat -ano | findstr 8066 # Windows
tail -n 100 /opt/tongrds/logs/rds.log
/opt/tongrds/bin/rds --check-config
telnet 127.0.0.1 8066
show @@connection;
show @@slow_query;
service tongrds start # Linux net start TongRDS # Windows
service tongrds stop # Linux net stop TongRDS # Windows
service tongrds restart # Linux net stop TongRDS && net start TongRDS # Windows
# 连接管理控制台 mysql -h127.0.0.1 -P9066 -uroot -p # 查看数据源状态 show @@datasource; # 查看SQL执行统计 show @@sql; # 重载配置 reload @@config;
tar -czvf tongrds-conf-backup-$(date +%Y%m%d).tar.gz /opt/tongrds/conf