1 Star 0 Fork 59

jiaozilgx / kingshard

forked from flike / kingshard 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Build Status

kingshard简介

kingshard是一个由Go开发高性能MySQL Proxy项目,kingshard在满足基本的读写分离的功能上,致力于简化MySQL分库分表操作;能够让DBA通过kingshard轻松平滑地实现MySQL数据库扩容。 kingshard的性能是直连MySQL性能的80%以上。线上使用kingshard,请从release页面获取最新版!!

主要功能:

1. 基础功能

  • 支持SQL读写分离。
  • 支持透明的MySQL连接池,不必每次新建连接。
  • 支持平滑上线DB或下线DB,前端应用无感知。
  • 支持多个slave,slave之间通过权值进行负载均衡。
  • 支持强制读主库。
  • 支持主流语言(java,php,python,C/C++,Go)SDK的mysql的prepare特性。
  • 支持到后端DB的最大连接数限制。
  • 支持SQL日志及慢日志输出。
  • 支持SQL黑名单机制。
  • 支持客户端IP访问白名单机制,只有白名单中的IP才能访问kingshard(支持IP 段)。
  • 支持字符集设置。
  • 支持last_insert_id功能。
  • 支持热加载配置文件,动态修改kingshard配置项(具体参考管理端命令)。
  • 支持以Web API调用的方式管理kingshard。
  • 支持多用户模式,不同用户之间的表是权限隔离的,互补感知。

2. sharding功能

  • 支持按整数的hash和range分表方式。
  • 支持按年、月、日维度的时间分表方式。
  • 支持跨节点分表,子表可以分布在不同的节点。
  • 支持跨节点的count,sum,max和min等聚合函数。
  • 支持单个分表的join操作,即支持分表和另一张不分表的join操作。
  • 支持跨节点的order by,group by,limit等操作。
  • 支持将sql发送到特定的节点执行。
  • 支持在单个节点上执行事务,不支持跨多节点的分布式事务。
  • 支持非事务方式更新(insert,delete,update,replace)多个node上的子表。

kinshard文档

kingshard安装和使用

1.安装kingshard

2.如何利用一个数据库中间件扩展MySQL集群——kingshard使用指南

3.kingshard sharding介绍

4.kingshard按时间分表功能介绍

5.kingshard 快速入门

6.管理端命令介绍

7.管理端Web API接口介绍

8.kingshard SQL黑名单功能介绍

9.kingshard的FAQ

10.kingshard SQL支持范围

11.如何配合LVS实现集群部署

12.Kinghshard接入prometheus

13.kingshard视频教程

kingshard架构与设计

1.kingshard架构设计和功能实现

2.kingshard性能优化之网络篇

3.kingshard性能测试报告

鸣谢

  • 感谢mixer作者siddontang, kingshard最初的版本正是基于mixer开发而来的。
  • 感谢bigpyer,他对kingshard做了详细的性能测试,并撰写了一份非常详细的测试报告。
  • 感谢以下开源爱好者为kingshard做出的贡献。

kingshard用户列表

https://github.com/flike/kingshard/issues/148

反馈

kingshard开源以来,经过不断地迭代开发,功能较为完善,稳定性有较大提升。 目前已有超过50家公司在生产环境使用kingshard作为MySQL代理。 如果您在使用kingshard的过程中发现BUG或者有新的功能需求,请发邮件至flikechen#qq.com与作者取得联系,或者加入QQ群(147926796)交流。 欢迎关注后端技术快讯公众号,有关kingshard的最新消息与后端架构设计类的文章,都会在这个公众号分享。

License

kingshard采用Apache 2.0协议,相关协议请参看目录

# kingshard [中文主页](README_ZH.md) [![Build Status](https://travis-ci.org/flike/kingshard.svg?branch=master)](https://travis-ci.org/flike/kingshard) ## Overview kingshard is a high-performance proxy for MySQL powered by Go. Just like other mysql proxies, you can use it to split the read/write sqls. Now it supports basic SQL statements (select, insert, update, replace, delete). The most important feature is the sharding function. Kingshard aims to simplify the sharding solution of MySQL. **The Performance of kingshard is about 80% compared to connecting to MySQL directly.** ## Feature ### 1. Basic Function - Splits reads and writes - Client's ip ACL control. - Transaction in single node. - Support limitting the max count of connections to MySQL database. - Support setting the backend database online or offline dynamically. - Supports prepared statement: COM_STMT_PREPARE, COM_STMT_EXECUTE, etc. - Support multi slaves, and loading banlance between slaves. - Support reading master database forcely. - Support last_insert_id(). - Support MySQL backends HA. - Support set the charset of proxy. - Support SQL blacklist. - Support dynamically changing the config value of kingshard. ### 2. Sharding Function - Support hash,range and date sharding across multiple nodes. - Support sending sql to the specified node. - Support most commonly used functions, such as `max, min, count, sum`, and also support `join, limit, order by,group by`. ## Install ``` 1. Install Go 2. git clone https://github.com/flike/kingshard.git src/github.com/flike/kingshard 3. cd src/github.com/flike/kingshard 4. source ./dev.sh 5. make 6. set the config file (etc/ks.yaml) 7. run kingshard (./bin/kingshard -config=etc/ks.yaml) ``` # Details of kingshard [1.How to use kingshard building a MySQL cluster](./doc/KingDoc/how_to_use_kingshard_EN.md) ## License kingshard is under the Apache 2.0 license. See the [LICENSE](./doc/License) directory for details.

简介

kingshard 是一个由Go开发高性能MySQL Proxy项目 展开 收起
Go
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/jiaozilgx/kingshard.git
git@gitee.com:jiaozilgx/kingshard.git
jiaozilgx
kingshard
kingshard
master

搜索帮助