The principles of data segmentation can be found in blogs:
http://blog.csdn.net/jhq0113/article/details/44226789
For an introduction to Atlas, see the blog:
http://blog.csdn.net/jhq0113/article/details/44239823
the Atlas source code is written in C, which is equivalent to a DB for Web server, equivalent to a client in db, and if you put the logic of Atlas into a Web server program, it will greatly increase the web The complexity of the server program, coupled with a high degree of coupling between the Web server and the DB, because as long as the DB increases/decreases the service, the Web server is likely to have code changes, if the code does not change, you have to use the intermediate relational table and heartbeat mechanism to maintain the relationship between the server, This leads to a loss of performance, and Atlas is a middleware that is built between Web server and DB, and the coupling between Web server and DB is placed in Atlas to handle both flexibility and performance, which is also the value of Atlas.
Atlas supports horizontal slicing of tables, supports read and write separations, and requires higher data real-time items can be added/*master*/forced read the main library before the SELECT statement, data synchronization between master and slave MySQL database needs its own configuration, Master-slave MySQL database data master-slave replication configuration method See blog:
http://blog.csdn.net/jhq0113/article/details/44263367
1. Installation
Note: Only install on 64-bit Linux operating system, CentOS official recommended RPM installation Method
Get Address: https://github.com/Qihoo360/Atlas/releases
Currently the latest version is:
Atlas-2.2.1. el5. x86_64.rpm CentOS 5.* version
Atlas-2.2.1. el6. x86_64.rpm CentOS 6.* version
My environment is CentOS 6.6 Basic Server x86_64
installation command:
[Email protected] src]# rpm-i atlas-2.2.1.el6.x86_64.rpm
Installation location:
/usr/local/mysql-proxy
Configuration file:
/usr/local/mysql-proxy/conf/test.cnf
Important configuration file:
(1) Number of threads
Event-threads setting, too small can not fully play the performance of multi-core CPU, too large to cause unnecessary thread switching overhead, recommended to set the number of CPU cores.
(2) Minimum number of idle connections (not required for version 2.x or above, 1.x version required)
Min-idle-connections set, too small in high concurrency will have an error, too large although not error, but in the test is not easy to see read and write separation effect, recommended set to the client's concurrency peak slightly larger, see the configuration parameters in detail. The above configuration example is for the Atlas 2.X version, which does not have this option. For the Atlas 1.X version of the configuration file, you need to include this configuration option.
(3) Working ports for Atlas
The proxy-address configuration, such as Proxy-address = 0.0.0.0:1234, means that the client should use the 1234 port to connect to Atlas to send SQL requests.
(4) Management ports for Atlas
The admin-address configuration, such as Admin-address = 0.0.0.0:2345, means that the DBA should use the 2345 port to connect to Atlas to perform operational management operations.
(5) User name and password for management interface
The Admin-username and Admin-password settings, which are used to access the management interface of Atlas, are not related to the back-end connection of MySQL, so you can set them arbitrarily and do not require MySQL to make any changes to the configuration.
(6) Log level
The Log-level configuration is divided into message, warning, critical, error, debug five levels.
(7) Log path
Configured with Log-path items, such as Log-path =/usr/local/mysql-proxy/log.
Not to be finished .....
Data splitting--atlas reading and writing separation MySQL cluster construction