root@10.1.6.205:~# tar -C /usr/local -xzvf mysql-cluster-gpl-7.2.6-linux2.6-x86_64.tar.gz root@10.1.6.205:/usr/local# ln -s /usr/local/mysql-cluster-gpl-7.2.8-linux2.6-i686 /usr/local/mysql root@10.1.6.205:/usr/local# cd mysql root@10.1.6.205:/usr/local/mysql# scripts/mysql_install_db --user=mysql root@10.1.6.205:/usr/local/mysql# chown -R mysql:mysql /usr/local/mysql 同理10.1.6.203
root@10.1.6.205:/usr/local/mysql# vim /etc/my.cnf [mysqld] basedir=/usr/local/mysql/ datadir=/usr/local/mysql/data/ user=mysql port=3306 socket=/tmp/mysql.sock ndbcluster max_connect_errors=10000 ndb-connectstring=10.1.6.205 connect_timeout = 300 [mysql_cluster] ndb-connectstring=10.1.6.205
root@10.1.6.205:/usr/local/mysql# vim /opt/cluster/config.ini [ndbd default] NoOfReplicas=2 DataMemory=80M #分配data storage使用的内存 每个ndb占用 IndexMemory=18M #分配index storage使用的内存 每个ndb占用 [tcp default] portnumber=2205 #ndb监听端口 #设置管理节点 [ndb_mgmd] NodeId=1 hostname=10.1.6.205 datadir=/opt/cluster #在MGM上保存日志的目录 #设置存储节点NDB1 [ndbd] NodeId=2 hostname=10.1.6.203 datadir=/usr/local/mysql/data #设置存储节点NDB2 [ndbd] NodeId=3 hostname=10.1.6.205 datadir=/usr/local/mysql/data #设置SQL节点1 [mysqld] NodeId=4 hostname=10.1.6.203 #设置SQL节点2 [mysqld] NodeId=5 hostname=10.1.6.205 [mysqld] #运行任意ip连接 [mysqld]
root@10.1.6.205:/usr/local/mysql/bin# /usr/local/mysql/bin/ndb_mgmd -f /opt/cluster/config.ini MySQL Cluster Management Server mysql-5.5.22 ndb-7.2.6
root@10.1.6.205:/usr/local/mysql/bin# /usr/local/mysql/bin/ndbd --initial 2013-08-28 23:40:36 [ndbd] INFO -- Angel connected to '10.1.6.205:1186' 2013-08-28 23:40:36 [ndbd] INFO -- Angel allocated nodeid: 2
root@10.1.6.205:/usr/local/mysql/bin# /usr/local/mysql/bin/ndbd
root@10.1.6.203:/usr/local/mysql/bin# /usr/local/mysql/bin/mysqld_safe /etc/my.cnf &
root@10.1.6.205:/usr/local/mysql# /usr/local/mysql/bin/ndb_mgm -- NDB Cluster -- Management Client -- ndb_mgm> show Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=2 @10.1.6.203 (mysql-5.5.22 ndb-7.2.6, Nodegroup: 0, Master) id=3 @10.1.6.205 (mysql-5.5.22 ndb-7.2.6, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @10.1.6.205 (mysql-5.5.22 ndb-7.2.6) [mysqld(API)] 4 node(s) id=4 @10.1.6.203 (mysql-5.5.22 ndb-7.2.6) id=5 @10.1.6.205 (mysql-5.5.22 ndb-7.2.6) id=6 (not connected, accepting connect from any host) id=7 (not connected, accepting connect from any host) ndb_mgm>
root@10.1.6.203:/usr/local/mysql/bin# /usr/local/mysql/bin/mysql -uroot -p mysql> use test; mysql> create table dave (num int(10)) engine=ndb; mysql> show create table dave\G; *************************** 1. row *************************** Table: dave Create Table: CREATE TABLE `dave` ( `num` int(10) DEFAULT NULL ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 1 row in set (0.00 sec) mysql> insert into dave -> values -> (100); Query OK, 1 row affected (0.01 sec) mysql> select * from dave; +------+ | num | +------+ | 100 | +------+
root@10.1.6.205:/usr/local/mysql# /usr/local/mysql/bin/mysql -uroot -p mysql> use test mysql> select * from dave; +------+ | num | +------+ | 100 | +------+
mysql> select * from ndbinfo.memoryusage; +---------+--------------+--------+------------+----------+-------------+ | node_id | memory_type | used | used_pages | total | total_pages | +---------+--------------+--------+------------+----------+-------------+ | 2 | Data memory | 851968 | 26 | 83886080 | 2560 | | 2 | Index memory | 212992 | 26 | 19136512 | 2336 | | 3 | Data memory | 851968 | 26 | 83886080 | 2560 | | 3 | Index memory | 212992 | 26 | 19136512 | 2336 |
root@10.1.6.205:/usr/local/mysql/bin# /usr/local/mysql/bin/ndb_mgm -e shutdown Connected to Management Server at: 10.1.6.205:1186 3 NDB Cluster node(s) have shutdown. Disconnecting to allow management server to shutdown.
root@10.1.6.203:/usr/local/mysql/bin# /usr/local/mysql/bin/mysqladmin -uroot -p shutdown Enter password: 130829 02:19:57 mysqld_safe mysqld from pid file /usr/local/mysql/data//debian.pid ended [1]+ Done /usr/local/mysql/bin/mysqld_safe /etc/my.cnf
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有