MySQL分布式数据库服务中间件--Cobar研究二(二)

2015-07-24 07:25:04 · 作者: · 浏览: 4
, 启动成功日志如下

[root@localhost logs]# more stdout.log
17:31:10,939 INFO ===============================================
17:31:10,940 INFO Cobar is ready to startup ...
17:31:10,940 INFO Startup processors ...
17:31:10,974 INFO Startup connector ...
17:31:10,975 INFO Initialize dataNodes ...
17:31:11,140 INFO node1:0 init success
17:31:11,142 INFO node2:0 init success
17:31:11,150 INFO CobarManager is started and listening on 9066
17:31:11,152 INFO CobarServer is started and listening on 8066
17:31:11,152 INFO ===============================================

访问Cobar同访问MySQL的方式完全相同

常用访问方式如下(注意:本文将Cobar部署在192.168.66.89这台机器上,否则请替换为您的Cobar所在IP,其他信息不变)

SQL执行语句时与使用传统单一数据库无区别

[root@localhost cobar-server-1.2.7]# mysql -h192.168.66.89 -utest -ptest -P8066 -DUserCenter

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 5
Server version: 5.1.48-cobar-1.2.7 Cobar Server (ALIBABA)

Copyright (c) 2000, 2014, 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   |
+------------+
| UserCenter |
+------------+
1 row in set (0.00 sec)

mysql> show tables;
+----------------------+
| Tables_in_UserCenter |
+----------------------+
| u_user               |
+----------------------+
1 row in set (0.05 sec)

mysql> 



至此配置完成!

?

?

?

?

?