`
ginge
  • 浏览: 208377 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

MySQL NDB 6.3.20集群安装 (测试部分)

阅读更多

测试

SQL节点[192.168.99.88]上创建数据库且插入数据

mysql> create database world;
Query OK, 1 row affected (0.09 sec)

mysql> use world;
Database changed

mysql> CREATE TABLE `City` (
    ->   `ID` int(11) NOT NULL auto_increment,
    ->   `Name` char(35) NOT NULL default '',
    ->   `CountryCode` char(3) NOT NULL default '',
    ->   `District` char(20) NOT NULL default '',
    ->   `Population` int(11) NOT NULL default '0',
    ->   PRIMARY KEY  (`ID`)
    -> ) ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.93 sec)

mysql> INSERT INTO `City` VALUES (1,'Kabul','AFG','Kabol',1780000);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `City` VALUES (2,'Qandahar','AFG','Qandahar',237500);
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO `City` VALUES (3,'Herat','AFG','Herat',186800);
Query OK, 1 row affected (0.00 sec)




mysql> select * from City;
+----+----------+-------------+----------+------------+
| ID | Name     | CountryCode | District | Population |
+----+----------+-------------+----------+------------+
|  3 | Herat    | AFG         | Herat    |     186800 |
|  1 | Kabul    | AFG         | Kabol    |    1780000 |
|  2 | Qandahar | AFG         | Qandahar |     237500 |
+----+----------+-------------+----------+------------+
3 rows in set (0.00 sec)

 

 

 

/usr/local/mysql/cluster-conf/config.ini添加

[mysqld]
Id=5
Hostname=192.168.99.80           # Hostname or IP address
                                # (additional mysqld connections can be
                                # specified for this node for various
                                # purposes such as running ndb_restore)

 

具体步骤如下:

[root@candyshop mysql]# vi /etc/my.cnf
# Options for mysqld process:
[mysqld]
ndbcluster                      # run NDB storage engine
ndb-connectstring=192.168.99.80  # location of management server

# Options for ndbd process:
[mysql_cluster]
ndb-connectstring=192.168.99.80  # location of management server

[root@candyshop mysql]# cd bin/
[root@candyshop bin]# cd ..
[root@candyshop mysql]# ./bin/ndb_mgmd -f cluster-conf/config.ini
[root@candyshop mysql]# ./bin/ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 192.168.99.80:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.99.89  (mysql-5.1.30 ndb-6.3.20, Nodegroup: 0, Master)
id=3    @192.168.99.90  (mysql-5.1.30 ndb-6.3.20, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.99.80  (mysql-5.1.30 ndb-6.3.20)

[mysqld(API)]   2 node(s)
id=4 (not connected, accepting connect from 192.168.99.88)
id=5    @192.168.99.80  (mysql-5.1.30 ndb-6.3.20)

 

 

启动节点:

[root@candyshop mysql]# ./bin/mysqld_safe &
[1] 12009
[root@candyshop mysql]# 070917 19:40:47 mysqld_safe Logging to '/usr/local/mysql/data/candyshop.bee.com.err'.
070917 19:40:47 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

[root@candyshop mysql]# ./bin/mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.30-ndb-6.3.20-cluster-gpl MySQL Cluster Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
| world              |
+--------------------+
4 rows in set (0.00 sec)

mysql> select * from world.City;
+----+----------+-------------+----------+------------+
| ID | Name     | CountryCode | District | Population |
+----+----------+-------------+----------+------------+
|  1 | Kabul    | AFG         | Kabol    |    1780000 |
|  2 | Qandahar | AFG         | Qandahar |     237500 |
|  3 | Herat    | AFG         | Herat    |     186800 |
+----+----------+-------------+----------+------------+
3 rows in set (0.07 sec)

 

 

发现之前在另外一个SQL节点[192.168.99.88]创建的数据库也出现在节点5[192.168.99.80]上面了。

 

这样整个安装和测试都完结了。

 

 

分享到:
评论

相关推荐

    Pro.MySQL.NDB.Cluster

    Create and run a real-time, highly-available, and high-redundancy version of the world's most popular open-source database, MySQL....Chapter 20: MySQL NDB Cluster and Application Performance Tuning

    2017_Pro MySQL NDB Cluster.pdf

    The book has been written for database administrators who are looking into deploying MySQL NDB Cluster or already have a cluster in production and want to increase their knowledge to be able to handle...

    MySQL Cluster(MySQL 集群)

    MySQL Cluster(MySQL 集群) 测试环境: CentOS4.6 数据库版本: mysql-cluster-gpl-6.3.20

    MySQL NDB Cluster实践.pdf

    MySQL NDB Cluster实践.pdf

    MySQL NDB集群部署与维护

    通过学习mysql官方文档,在实验中形成的一份简明扼要的笔记性质文档,适合MySQL NDB集群感兴趣的同学参考。

    CentOS8部署Mysql NDB Cluster8+Mysql Router8方案及应用.pdf

    CentOS8部署Mysql NDB Cluster8+Mysql Router8方案及应用~~~~

    MySQLCluster(MySQL集群)V7.6.10官方安装版(附安装配置教程)64位

    MySQL Cluster 是专门用来做MySQL集群的程序,简单来讲它是一种技术,该技术能够在无共享的系统中部署内存中数据库的“Cluster”,通过无共享体系结构,系统能够使用各种廉价的硬件,并对所有硬件没有任何特殊的要求...

    mysql reference manual v5.1 (includes MySQL Cluster NDB 6.X/7.X)

    官网下载,安全可靠权威,没做任何改动,方便好用,当大家在了解了mysql基础上看英文版的一定会比中文版的有收获,很高兴和大家分享这个手册,官网的下载地址为http://dev.mysql.com/doc/,不过希望根据我的介绍到...

    MySQL 8.0参考手册 Including MySQL NDB Cluster 8.0

    MySQL 8.0参考手册 Including MySQL NDB Cluster 8.0

    Pro MySQL NDB Cluster epub

    Pro MySQL NDB Cluster 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    MySQL NDB Cluster安装

    MySQL NDB Cluster安装

    Pro MySQL NDB Cluster 无水印原版pdf

    Pro MySQL NDB Cluster 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在...

    MySQL DBA培训全套教程

    01.about_me.pdf 02.mysql_concept.pdf 03.mysql_myisam_archive.pdf 04.innodb_concept.pdf 05.innodb_lock.pdf ... 18.mysql_HA_NDB.pdf 19.mysql_scale.pdf 20.mysql_Fabric.pdf 21.mysql_cache.pdf

    MySQL集群环境搭建.docx

    如果集群配置有更新了:rm /usr/local/mysql/mysql-cluster/ndb_1_config.bin.1 3)停止SQL节点的命令:/usr/local/mysql/bin/mysqladmin -uroot shutdown 4)SQL Node上连接MySQL:/usr/local/mysql/bin/mysql -u ...

    MySQL 8.0 Reference Manual.pdf.7z

    For infor mation about MySQL Cluster, please see MySQL NDB Cluster 7.5 and NDB Cluster 7.6. MySQL 8.0 features. This manual describes features that are not included in every edition of MySQL 8.0; ...

    MySQL 5.1中文手冊

    2.3.13. 测试MySQL安装 2.3.14. 在Windows环境下对MySQL安装的故障诊断与排除 2.3.15. 在Windows下升级MySQL 2.3.16. Windows版MySQL同Unix版MySQL对比 2.4. 在Linux下安装MySQL 2.5.在Mac OS X中安装MySQL 2.6. 在...

    MySQL8中文参考手册 .chm

    关于MySQL集群的信息,请参阅7.5、MySQL NDB Cluster NDB簇7.6 MySQL 8的特点。本手册介绍了不包含在MySQL 8的每一个版本的功能;这种功能可能不包含在MySQL 8版授权给你。如果你有任何问题的特征包含在你的MySQL...

    MySQL 5.6参考手册(英文版).pdf

    MySQL Cluster NDB 7.2. MySQL 5.6 features. This manual describes features that are not included in every edition of MySQL 5.6; such features may not be included in the edition of MySQL 5.6 licensed to...

    MySQL 5.1参考手册

    2.3.13. 测试MySQL安装 2.3.14. 在Windows环境下对MySQL安装的故障诊断与排除 2.3.15. 在Windows下升级MySQL 2.3.16. Windows版MySQL同Unix版MySQL对比 2.4. 在Linux下安装MySQL 2.5.在Mac OS X中安装MySQL 2.6. 在...

    MySQL 5.1参考手册 (中文版)

    2.3.13. 测试MySQL安装 2.3.14. 在Windows环境下对MySQL安装的故障诊断与排除 2.3.15. 在Windows下升级MySQL 2.3.16. Windows版MySQL同Unix版MySQL对比 2.4. 在Linux下安装MySQL 2.5.在Mac OS X中安装MySQL 2.6. 在...

Global site tag (gtag.js) - Google Analytics