5 messages in com.mysql.lists.clusterRe: How to create databases and table...
FromSent OnAttachments
raje...@sumasoft.net08 Aug 2007 01:54 
Martin Skold08 Aug 2007 05:24 
raje...@sumasoft.net09 Aug 2007 02:15 
Martin Skold09 Aug 2007 02:38 
raje...@sumasoft.net09 Aug 2007 09:01 
Subject:Re: How to create databases and tables on mysql 5.0 cluster,
From:raje...@sumasoft.net (raje@sumasoft.net)
Date:08/09/2007 02:15:30 AM
List:com.mysql.lists.cluster

----- Original Message ----- From: "Martin Skold" <Mart@mysql.com> To: <raje@sumasoft.net> Cc: <clus@lists.mysql.com> Sent: Wednesday, August 08, 2007 5:54 PM Subject: Re: How to create databases and tables on mysql 5.0 cluster,

Hi!

Where is the second mysqld configured in the cluster? If you plan to use two sql-nodes you must configure both of them.

Thanks for your interest Martin,

But i don't have two sql-nodes; U can read my mail i am having

One mgm node

Two data node

One sql node

I have one more question.

If i add two more data node on my cluster, ie i am going to use 4 data node,

Does it improve the performance of the cluster or it only improves the availability?

Regards,

Rajeev Sekhar

----------------------------------------------------------------- Jr. System Administrator Suma Soft Pvt. Ltd. Suma Center, IInd Floor, Opp. Himali Society, Near Mangeshkar Hospital, Erandwane, Pune - 411004 Ph : +91-20-2542 5655 Extn : 351 Cell : +91-93707 77989 www.sumasoft.com

BR -- Martin raje@sumasoft.net wrote:

Hi List, I am new to Mysql Cluster, I will explain my scenario below. Four machines 1 management server ( 192.168.100.222) 2 data nodes ( 192.168.100.223 and 192.168.100.224) 1 Sql node ( 192.168.100.225)

I followed the docs to install above three server, As I am using RHEL4 32bit on all server , i went for RPM installation.

RPM's installed on each node is given below, ( Done minimal to avoid confusion regarding which RPM for what)

management node [root@mgm1 ~]# rpm -qa | grep MySQL MySQL-clustermanagement-community-5.0.45-0.rhel4 MySQL-clustertools-community-5.0.45-0.rhel4 [root@mgm1 ~]#

Data node's [root@node1 ~]# rpm -qa | grep MySQL MySQL-client-community-5.0.45-0.rhel4 MySQL-server-community-5.0.45-0.rhel4 MySQL-clusterstorage-community-5.0.45-0.rhel4

Mysql-node [root@mysql-node1 ~]# rpm -qa | grep MySQL MySQL-client-community-5.0.45-0.rhel4 MySQL-server-community-5.0.45-0.rhel4 [root@mysql-node1 ~]#

Q1 Please let me know is there any problem in the RPM's i used?

management's control.ini file looks like below [root@mgm1 ~]# cat /var/lib/mysql-cluster/config.ini # Options affecting ndbd processes on all data nodes: [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=1186 # This the default; however, you can use any # port that is free for all the hosts in cluster # Note: It is recommended beginning with MySQL 5.0 that # you do not specify the portnumber at all and simply allow # the default value to be used instead

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

# Options for data node "A": [NDBD] hostname=192.168.100.223 # 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.100.224 # Hostname or IP address datadir=/usr/local/mysql/data # Directory for this data node's data files

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

Q2 Please let me know is there any problem on control.ini on mgm

The my.cnf on three server is the same ( there server means , two data node and one mysql node ) [root@node1 ~]# cat /etc/my.cnf # Options for mysqld process: [MYSQLD] ndbcluster # run NDB storage engine ndb-connectstring=192.168.100.222 # location of management server

# Options for ndbd process: [MYSQL_CLUSTER] ndb-connectstring=192.168.100.222 # location of management server [root@node1 ~]#

Q3 Please let me know is there any problem on my.cnf

The out-put of show command in management node is [root@mgm1 ~]# 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.100.223 (Version: 5.0.45, Nodegroup: 0) id=3 @192.168.100.224 (Version: 5.0.45, Nodegroup: 0, Master)

[ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.100.222 (Version: 5.0.45)

[mysqld(API)] 1 node(s) id=4 @192.168.100.225 (Version: 5.0.45)

ndb_mgm>

I think its looks good,

But SHOW ENGINES\G in data-node is giving below

*************************** 9. row *************************** Engine: ndbcluster Support: DISABLED Comment: Clustered, fault-tolerant, memory-based tables *************************** 10. row ***************************

And in the output of SHOW ENGINES\G sql-node shows *************************** 9. row *************************** Engine: ndbcluster Support: YES Comment: Clustered, fault-tolerant, memory-based tables *************************** 10. row ***************************

Q4 Is the ndbcluster needs to be YES on both data-node? If yes what i have to do. Right as per docs, my mysql starts when system gets boots and i am only issuing ndbd command to get connected with mgm.

Q5 What is the procedure to create databases and tables on mysql-cluster.

I am doing the following procedure, which i understood from the docs.

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

mysql> use world; Database changed mysql> DROP TABLE IF EXISTS `City`; Query OK, 0 rows affected, 1 warning (0.00 sec)

CREATE TABLE `City` ( 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=latin1; INSERT INTO `City` VALUES (3,'Herat','AFG','Herat',186800);Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> 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> show tables; +-----------------+ | Tables_in_world | +-----------------+ | City | +-----------------+ 1 row in set (0.00 sec)

mysql>

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

mysql> use world Database changed mysql> show tables; Empty set (0.00 sec)

Mysql-node mysql> CREATE SCHEMA world; Query OK, 1 row affected (0.01 sec)

mysql> flush tables; Query OK, 0 rows affected (0.00 sec)

mysql> use world; Database changed mysql> show tables; Empty set (0.00 sec)

mysql>

Here you can see my tables is not reflecting on another node,

Kindly help us to understand the Mysql-cluster. It will be great if you answer all my five question.

Thanks in advance. Regards, Rajeev Sekhar

----------------------------------------------------------------- Jr. System Administrator Suma Soft Pvt. Ltd. Suma Center, IInd Floor, Opp. Himali Society, Near Mangeshkar Hospital, Erandwane, Pune - 411004 Ph : +91-20-2542 5655 Extn : 351 Cell : +91-93707 77989 www.sumasoft.com

----------------------------------------------

----------------------------------------------