-
Notifications
You must be signed in to change notification settings - Fork 1.2k
The FAQs about the main features of Atlas
Yes, you can set charset through the config option(charset) in config file.
Yes, if the mysql client is in a transaction and quit unexpectedly, Atlas will destory the connection and rollback the transaction, assure ACID of the transaction.
3.Atlas can split reading/writing requests, but sometimes I want send the reading requests to master and don't use transaction. How can I do?
You can add a comment('/*master*/') in the head of the sql, like '/*master*/select * from stu;',and this sql will send to the master.When you use mysql client to test this function, you need use the parameter:'-c' to connect the mysql server in order to retain the comment.
Yes, when the master crash, the reading request will be forward to the slaves by Atlas. The execution of the writing requests will fail, because the master is down.
Atlas will create a thread in order to detect the status of the backend database server in a round robin manner. The working thread will not be influenced.
You can make the database offline(online) through the admin interface of Atlas.You can also add(remove) a backend through the admin interface.
Atlas support prepare statement limited, supporting java, python, PHP(PDO mode).
Currently Atlas do not support this mode, because in this mode Atlas can't assure the data consistency. Atlas support the modes like: a master and a slave, a master and multi-slaves.
You should modify the connection mode of jdbc. For example:
jdbc:mysql://10.10.10.37:3306/user_db?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
change to
jdbc:mysql://10.10.10.37:3306/user_db?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
No, Atlas doesn't monitor the master-slave log file syncing. But enthusiastic user has used perl to implement this function.If you are interested in his implementation, you can visit:
https://github.com/chenzhe07/Atlas_auto_setline
11.When the application developed by java connect Atlas, sometimes the read requests are forwarded to the master,why?
One reason is autocommit is 0, you should change the autocommit to 1.
[mysql-proxy]
- 管理接口的用户名
- 管理接口的密码
- Atlas后端连接的MySQL主库的IP和端口,可设置多项,用逗号分隔
- 从库
- 用户名和密码配置项,需要和主从复制配置的用户名和密码配置一样
- 后台运行
- 工作线程数,对Atlas的性能有很大影响,可根据情况适当设置
- 日志级别,分为message、warning、critical、error、debug五个级别
- 日志存放的路径
- SQL日志的开关,可设置为OFF、ON、REALTIME,OFF代表不记录SQL日志,ON代表记录SQL日志,REALTIME代表记录SQL日>志且实时写入磁盘,默认为OFF
- sql-log = OFF
- 慢日志输出设置。当设置了该参数时,则日志只输出执行时间超过sql-log-slow(单位:ms)的日志>记录。不设置该参数则输出全部日志。
- 实例名称,用于同一台机器上多个Atlas实例间的区分
- Atlas监听的工作接口IP和端口
- Atlas监听的管理接口IP和端口
- 分表设置,此例中person为库名,mt为表名,id为分表字段,3为子表数量,可设置多项,以逗号分>隔,若不分表则不需要设置该项
- tables = person.mt.id.3
- 默认字符集,设置该项后客户端不再需要执行SET NAMES语句
- 允许连接Atlas的客户端的IP,可以是精确IP,也可以是IP段,以逗号分隔,若不设置该项则允许所>有IP连接,否则只允许列表中的IP连接
- client-ips = 127.0.0.1, 192.168.1
- Atlas前面挂接的LVS的物理网卡的IP(注意不是虚IP),若有LVS且设置了client-ips则此项必须设置>,否则可以不设置
- lvs-ips = 192.168.1.1