Database –cobar distributed database cluster MySQL middlewareCobar-github:https://github.com/alibaba/cobar/wikiOperating Environment:
- Host 1:ubuntu14.04 Desktop + MySQL5.5 + JDK 1.7 (HP Z400) Intranet IP address: 192.168.137.8
- Node1:ubuntu 13.04 Server + MySQL5.5 Intranet IP Address: 192.168.137.31
- Node2:ubuntu 13.04 Server + MySQL5.5 Intranet IP Address: 192.168.137.32
Note: (NODE1 and NODE2 run on Xen virtualization platform, hardware environment HP Z800)
Cobar the most important issues to solve are:distributed and Ha.
Distributed: Mainly by dividing the data of the same table into multiple, into different database instances, the query will also follow the same mode of operation to update the corresponding data in the specific database instance.
HA: High availability, in the case of a MySQL heartbeat set, if the primary database has an exception, Cobar automatically connects from the database, and if the primary database returns to normal, it can only be manually restored to the primary database. Cobar is only responsible for switching the database instance, is not responsible for the master-slave database synchronization, so the master-slave database must be set up in two-way synchronization.
Deficiencies in existence:
- (1). Join, paging, sorting, subquery operations in cross-library scenarios are not supported.
- (2). Set statement execution is ignored, except for transaction and character set settings.
- (3). In the case of a library, the INSERT statement must contain the name of the Split field column.
- (4). In the case of a library, the UPDATE statement cannot update the value of the Split field.
- (5). SavePoint operation is not supported.
- (6). Only MySQL data nodes are supported temporarily.
- (7). The Rewritebatchedstatements=true parameter setting (default = False) is not supported when using JDBC.
- (8). The Useserverprepstmts=true parameter setting (default = False) is not supported when using JDBC.
- (9). When using JDBC, the BLOB, BINARY, varbinary field cannot set parameters using the Setblob () or Setbinarystream () method.
Of course, if you want to try to achieve these functions, you can fork the official source code: Https://github.com/alibaba/cobar
How to use:
Refer to GitHub:https://github.com/alibaba/cobar/wiki or http://blog.geekcome.com/archives/252
MySQL distributed-cobar