atlas使用注意事项

avatar 2024年5月12日18:26:27 评论 81 次浏览

atlas已经搭建好了,我们看一下在使用atlas过程中需要注意的事项,在atlas中有两个进程两个端口,默认分别是1234和2345,两个端口分别是atlas的读写分离入口,一个是atlas的管理入口。下面看看atlas的管理入口,在管理入口配置的用户名和密码是在test.cnf文件中配置的。

 [wolf@wulaoer.org 🔥🔥🔥🔥 ~ ]$ mysql -h10.211.55.38 -P 2345 -uroot -proot
 mysql: [Warning] 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 1
 Server version: 5.0.99-agent-admin
 
 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 
 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
 
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
 mysql> SELECT * FROM backends;
 +-------------+-------------------+-------+------+
 | backend_ndx | address           | state | type |
 +-------------+-------------------+-------+------+
 |           1 | 10.211.55.40:3306 | up    | rw   |
 |           2 | 10.211.55.39:3306 | up    | ro   |
 +-------------+-------------------+-------+------+
 2 rows in set (0.00 sec)
 
 mysql> SELECT * FROM help;
 +----------------------------+---------------------------------------------------------+
 | command                    | description                                             |
 +----------------------------+---------------------------------------------------------+
 | SELECT * FROM help         | shows this help                                         |
 | SELECT * FROM backends     | lists the backends and their state                      |
 | SET OFFLINE $backend_id    | offline backend server, $backend_id is backend_ndx's id |
 | SET ONLINE $backend_id     | online backend server, ...                              |
 | ADD MASTER $backend        | example: "add master 127.0.0.1:3306", ...               |
 | ADD SLAVE $backend         | example: "add slave 127.0.0.1:3306", ...                |
 | REMOVE BACKEND $backend_id | example: "remove backend 1", ...                        |
 | SELECT * FROM clients      | lists the clients                                       |
 | ADD CLIENT $client         | example: "add client 192.168.1.2", ...                  |
 | REMOVE CLIENT $client      | example: "remove client 192.168.1.2", ...               |
 | SELECT * FROM pwds         | lists the pwds                                          |
 | ADD PWD $pwd               | example: "add pwd user:raw_password", ...               |
 | ADD ENPWD $pwd             | example: "add enpwd user:encrypted_password", ...       |
 | REMOVE PWD $pwd            | example: "remove pwd user", ...                         |
 | SAVE CONFIG                | save the backends to config file                        |
 | SELECT VERSION             | display the version of Atlas                            |
 +----------------------------+---------------------------------------------------------+
 16 rows in set (0.00 sec)

管理atlas也就无非针对atlas的一些操作,比如增加节点,删除节点等待,上面有帮助可以参考一下。下面看一下读写分离的入口,读写分离的入口用户名和密码是用的在创建数据库创建的用户名和密码,两者的入口不通使用的用户名和密码也不一样。

 [wolf@wulaoer.org 🔥🔥🔥🔥 ~ ]$ mysql -h10.211.55.38 -P 1234 -uatlasm -patlas
 mysql: [Warning] 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 3
 Server version: 5.0.81-log MySQL Community Server - GPL
 
 Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
 
 Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
 
 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
 mysql> show databases;
 +--------------------+
 | Database           |
 +--------------------+
 | information_schema |
 | performance_schema |
 | wulaoer            |
 +--------------------+
 3 rows in set (0.00 sec)

atlas的部署可以参考: https://www.wulaoer.org/?p=3079

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: