手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

如何配置MySQL集群在一台服务器

[日期:2013-12-20] 来源:Linux社区  作者:aichilu [字体:大 中 小]

四,启动成功后检查
 
检查结点连接状态
[root@cluster-one ~]# ndb_mgm -e show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]    2 node(s)
id=2    @127.0.0.1  (MySQL-5.5.29 ndb-7.2.10, Nodegroup: 0, Master)
id=3    @127.0.0.1  (mysql-5.5.29 ndb-7.2.10, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1    @127.0.0.1  (mysql-5.5.29 ndb-7.2.10)
[mysqld(API)]  3 node(s)
id=4    @127.0.0.1  (mysql-5.5.29 ndb-7.2.10)
id=5 (not connected, accepting connect from localhost)
id=6 (not connected, accepting connect from any host)

 
创建一个测试表
[root@cluster-one ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.29-ndb-7.2.10-cluster-gpl-log MySQL Cluster Community Server (GPL)
Copyright (c) 2000, 2012, 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> mysql> CREATE TABLE `sbtest` (
    ->  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    ->  `k` int(10) unsigned NOT NULL DEFAULT '0',
    ->  `c` char(120) NOT NULL DEFAULT '',
    ->  `pad` char(60) NOT NULL DEFAULT '',
    ->  PRIMARY KEY (`id`),
    ->  KEY `k` (`k`),
    ->  KEY `idx_c` (`c`)
    -> ) ENGINE=ndbcluster ;
Query OK, 0 rows affected (0.63 sec)
mysql> show create table sbtest;
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table  | Create Table                                                                                                                                                                                                                                                                                          |
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| sbtest | CREATE TABLE `sbtest` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `c` char(120) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `k` (`k`),
  KEY `idx_c` (`c`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 |
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

linux
相关资讯       MYSQL集群  MySQL集群配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款