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

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

[日期:2012-02-22] 来源:Linux社区  作者:xiaoyi829 [字体:大 中 小]
九:破坏性测试:
  1,关闭其中一个数据节点,验证结果表明,集群工作正常,

   以下操作在数据节点2[192.168.133.102]上执行,如下:
    [root@localhost bin]# ps -ef | grep ndbd
  root      7541     1  0 01:52 ?        00:00:00 ./ndbd –nodeid=3 –initial
  root      7542  7541  0 01:52 ?        00:02:39 ./ndbd –nodeid=3 –initial
  root      9931  3295  0 20:47 pts/1    00:00:00 grep ndbd
  [root@localhost bin]# kill 7541 7542
  [root@localhost bin]# ps -ef | grep ndbd
  root      9933  3295  0 20:47 pts/1    00:00:00 grep ndbd
  [root@localhost bin]# ifconfig
  eth0      Link encap:Ethernet  HWaddr 00:50:56:B8:00:13
            inet addr:192.168.133.102  Bcast:192.168.133.255  Mask:255.255.255.0
            inet6 addr: fe80::250:56ff:feb8:13/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:19511513 errors:0 dropped:0 overruns:0 frame.:0
            TX packets:19957492 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:1781288143 (1.6 GiB)  TX bytes:1899963551 (1.7 GiB)
            Base address:0x2000 Memory:d8920000-d8940000
          
          
  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:597990 errors:0 dropped:0 overruns:0 frame.:0
            TX packets:597990 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:51521498 (49.1 MiB)  TX bytes:51521498 (49.1 MiB)
 
  [root@localhost bin]#
--------------------------------------------------------------------------------
   十:去管理节点看集群的状态:
    ndb_mgm> show
  Cluster Configuration
  ---------------------
  [ndbd(NDB)]     2 node(s)
  id=2    @192.168.133.101  (Version: 7.1.10, Nodegroup: 0, Master)
  id=3 (not connected, accepting connect from 192.168.133.102)
 
  [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)
 
    ndb_mgm>

表明192.168.133.102上的数据节点确实当掉了.

    去mysql节点1[192.168.133.62]做如下操作:
    [root@localhost setup]# mysql
  [root@localhost setup]# ifconfig
  eth0      Link encap:Ethernet  HWaddr 00:50:56:B8:00:0F
            inet addr:192.168.133.62  Bcast:192.168.133.255  Mask:255.255.255.0
            inet6 addr: fe80::250:56ff:feb8:f/64 Scope:Link
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:7603400 errors:0 dropped:0 overruns:0 frame.:0
            TX packets:4072260 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:1000
            RX bytes:684602777 (652.8 MiB)  TX bytes:402432650 (383.7 MiB)
            Base address:0x2000 Memory:d8920000-d8940000
 
  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            inet6 addr: ::1/128 Scope:Host
            UP LOOPBACK RUNNING  MTU:16436  Metric:1
            RX packets:203352 errors:0 dropped:0 overruns:0 frame.:0
            TX packets:203352 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:0
            RX bytes:11961759 (11.4 MiB)  TX bytes:11961759 (11.4 MiB)
 
  [root@localhost setup]# mysql
  Welcome to the MySQL monitor.  Commands end with ; or \g.
  Your MySQL connection id is 9
  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.00 sec)
 
  mysql> use ndbdatabase;
  Database changed
  mysql> show tables;
  +-----------------------+
  | Tables_in_ndbdatabase |
  +-----------------------+
  | test                  |
  +-----------------------+
  1 row in set (0.01 sec)
 
  mysql> select * from test;
  +------+
  | id   |
  +------+
  |    1 |
  +------+
  1 row in set (0.00 sec)
 
  mysql>

以上操作表明在一个数据节点当机后,集群依然工作正常。

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

       

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