免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4655 | 回复: 4
打印 上一主题 下一主题

mysql cluster 7.1.3 安装笔记 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-05 18:46 |只看该作者 |倒序浏览
今天初步安装了一下mysql cluster,基本上都是按照官方文档做的,欢迎大家拍砖。
1,服务器使用情况

Management (MGMD) node   192.168.0.10

MySQL server (SQL) node     192.168.0.20

Data (NDBD) node "A"          192.168.0.30
  
Data (NDBD) node "B"          192.168.0.40



2,安装Management、Sql node、 Data node 重复以下步骤:

[root@www local]# tar -zxvf mysql-cluster-gpl-7.1.3-linux-i686-glibc23.tar.gz
[root@www local]# mv mysql-cluster-gpl-7.1.3-linux-i686-glibc23 mysql
[root@www local]# groupadd mysql
[root@www local]# useradd -g mysql mysql
[root@www local]# chown -R mysql.mysql mysql
[root@www local]# /usr/local/mysql/scripts/mysql_install_db  --user=mysql
[root@www mysql]# cp support-files/mysql.server /etc/rc.d/init.d/
[root@www mysql]# chmod +x /etc/rc.d/init.d/mysql.server
[root@www mysql]# chkconfig --add mysql.server



3,配置Management节点:
[root@www mysql]# mkdir /var/lib/mysql-cluster
[root@www mysql]# vi /var/lib/mysql-cluster/config.ini
[ndbd default]
NoOfReplicas=2    # Number of replicas
DataMemory=80M    # How much memory to allocate for data storage
IndexMemory=18M   # How much memory to allocate for index storage
                  # For DataMemory and IndexMemory, we have used the
                  # default values. Since the "world" database takes up
                  # only about 500KB, this should be more than enough for
                  # this example Cluster setup.

# TCP/IP options:
[tcp default]
portnumber=2202   # This the default; however, you can use any port that is free
                  # for all the hosts in the cluster
                  # Note: It is recommended that you do not specify the port
                  # number at all and allow the default value to be used instead

# Management process options:
[ndb_mgmd]
hostname=192.168.0.10           # Hostname or IP address of management node
datadir=/var/lib/mysql-cluster  # Directory for management node log files

# Options for data node "A":
[ndbd]
                                # (one [ndbd] section per data node)
hostname=192.168.0.30           # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's data files

# Options for data node "B":
[ndbd]
hostname=192.168.0.40           # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's data files

# SQL node options:
[mysqld]
hostname=192.168.0.20           # Hostname or IP address
                                # (additional mysqld connections can be
                                # specified for this node for various
                                # purposes such as running ndb_restore)

[root@www mysql-cluster]# cp bin/ndb_mgm* /usr/local/bin




4,配置MySQL server (SQL) node:

创建  /etc/my.cnf并添加下面的内容
#ptions for mysqld process:
[mysqld]
ndbcluster                      # run NDB storage engine
ndb-connectstring=192.168.0.10  # location of management server

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



5,配置 Data (NDBD) node "A":
创建/etc/my.cnf文件,并添加下面的内容
#ptions for mysqld process:
[mysqld]
ndbcluster                      # run NDB storage engine
ndb-connectstring=192.168.0.10  # location of management server

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




6,配置 Data (NDBD) node "B":
创建/etc/my.cnf文件,并添加下面的内容
#ptions for mysqld process:
[mysqld]
ndbcluster                      # run NDB storage engine
ndb-connectstring=192.168.0.10  # location of management server

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





7,启动Management节点:
[root@www local]# ndb_mgmd -f /var/lib/mysql-cluster/config.ini
2010-05-05 13:20:19 [MgmtSrvr] INFO     -- NDB Cluster Management Server. mysql-5.1.44 ndb-7.1.3
2010-05-05 13:20:19 [MgmtSrvr] INFO     -- Loaded config from '/usr/local/mysql/mysql-cluster/ndb_1_config.bin.1'




8,启动  Data (NDBD) node "A"及 Data (NDBD) node "B":
[root@www local]# /usr/local/mysql/bin/ndbd
2010-05-05 13:20:30 [ndbd] INFO     -- Configuration fetched from '192.168.0.10:1186', generation: 1



9,启动  MySQL server (SQL) node
[root@www local]# /etc/init.d/mysql.server start



10,所有的节点都已经起动完成了
[root@www local]# ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.0.30  (mysql-5.1.44 ndb-7.1.3, Nodegroup: 0, Master)
id=3    @192.168.0.40  (mysql-5.1.44 ndb-7.1.3, Nodegroup: 0)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.0.10  (mysql-5.1.44 ndb-7.1.3)

[mysqld(API)]   1 node(s)
id=4    @192.168.0.20  (mysql-5.1.44 ndb-7.1.3)

参考文档: http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster.html

论坛徽章:
8
综合交流区版块每周发帖之星
日期:2015-12-02 15:03:53数据库技术版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-10-02 06:20:00IT运维版块每日发帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年纪念徽章
日期:2013-10-24 15:41:34酉鸡
日期:2013-10-19 10:17:1315-16赛季CBA联赛之北京
日期:2017-03-06 15:12:44
2 [报告]
发表于 2010-05-06 09:36 |只看该作者
谢谢分享

论坛徽章:
0
3 [报告]
发表于 2010-05-06 16:26 |只看该作者
支持lz
动手动脑肯上进,呵呵

论坛徽章:
0
4 [报告]
发表于 2010-05-10 14:17 |只看该作者
恩,原创的不错。

论坛徽章:
0
5 [报告]
发表于 2010-07-29 17:21 |只看该作者
我做出来的怎么有错误 比较郁闷 !
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP