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

MySQL NDB 安装的安装配置与测试

[日期:2012-02-22] 来源:Linux社区  作者:xiaoyi829 [字体:大 中 小]
七:启动数据节点[192.168.133.101, 192.168.133.102]:

[root@localhost ~]#cd /usr/local/MySQL/bin

[root@localhost bin]#./ndbd

启动SQL节点[192.168.133.62,192.168.133.100]:

[root@localhost mysql]# ./bin/mysqld_safe &
 
至此,所有节点已经启动完成,让我们来查看系统状态:

Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.133.101  (Version: 7.1.10, Nodegroup: 0, Master)
id=3    @192.168.133.102  (Version: 7.1.10, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.133.98  (Version: 7.1.10)

[mysqld(API)]   2 node(s)
id=4    @192.168.133.62  (Version: 7.1.10)
id=5    @192.168.133.100  (Version: 7.1.10)
--------------------------------------------------------------------------------
    八:测试:
   在192.168.133.62上执行以下命令:
   #mysql
    mysql> use ndbdatabase;
  Database changed
  mysql> create table test (id int) engine=ndb;
  Query OK, 0 rows affected (0.10 sec)
 
  mysql> show create table test\G;
  *************************** 1. row ***************************
         Table: test
  Create Table: CREATE TABLE `test` (
    `id` int(11) DEFAULT NULL
  ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
  1 row in set (0.00 sec)
 
  ERROR:
  No query specified
 
  mysql> insert into test values(1);
  Query OK, 1 row affected (0.00 sec)
 
  mysql> select * from test;
  +------+
  | id   |
  +------+
  |    1 |
  +------+
  1 row in set (0.00 sec)
 
  mysql>

在192.168.133.100上执行以下命令,验证以上操作:
  [root@localhost test]# mysql
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 4
  Server version: 5.1.51-ndb-7.1.10-log Source distribution
 
  Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  This software comes with ABSOLUTELY NO WARRANTY. This is free software,
  and you are welcome to modify and redistribute it under the GPL v2 license
 
  Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
  mysql> show databases;
  +--------------------+
  | Database           |
  +--------------------+
  | information_schema |
  | mysql              |
  | ndbdatabase        |
  | ndbinfo            |
  | test               |
  +--------------------+
  5 rows in set (0.01 sec)
 
  mysql> use ndbdatabase;
  Database changed
  mysql> show tables;
  +-----------------------+
  | Tables_in_ndbdatabase |
  +-----------------------+
  | test                  |
  +-----------------------+
  1 row in set (0.00 sec)
 
  mysql> show create table test\G;
  *************************** 1. row ***************************
         Table: test
  Create Table: CREATE TABLE `test` (
    `id` int(11) DEFAULT NULL
  ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
  1 row in set (0.02 sec)
 
  ERROR:
  No query specified
 
  mysql> select * from test;
  +------+
  | id   |
  +------+
  |    1 |
  +------+
  1 row in set (0.01 sec)
 
  mysql>

验证表明,集群工作正常.

linux
相关资讯       Hadoop 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

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