Mysql访问中间件--Atlas初探( 二 )

测试应用连接Atlas服务
mysql -h10.10.57.205 -P1234 -utony -ptonyWarning: Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 11Server version: 5.0.81-log MySQL Community Server (GPL)Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql> mysql> select * from test.t_test;+----+-------+| id | name |+----+-------+| 1 | test1 || 2 | test2 |+----+-------+2 rows in set (0.00 sec)通过查看sql运行日志 , 可以看到应用已经实现了读写分离和负载均衡
[08/30/2018 16:48:18] C:10.10.57.208:56858 S:10.10.57.206:3306 OK 13.602 "insert into t_test values('1','test1')"[08/30/2018 16:48:35] C:10.10.57.208:56858 S:10.10.57.206:3306 OK 12.519 "insert into t_test values('2','test2')"[08/30/2018 16:48:47] C:10.10.57.208:56858 S:10.10.57.208:3306 OK 0.414 "select * from t_test"[08/30/2018 16:48:47] C:10.10.57.208:56858 S:10.10.57.207:3306 OK 0.456 "select * from t_test"[08/30/2018 16:48:48] C:10.10.57.208:56858 S:10.10.57.208:3306 OK 0.413 "select * from t_test"喜欢的同学可以关注我的公众号(db_arch)(Mysql数据库运维与架构设计)




推荐阅读