20 messages in com.mysql.lists.clusterRe: SQL Node Setup Question
FromSent OnAttachments
Burhan Khalid28 Apr 2008 03:45 
ewen fortune28 Apr 2008 04:12 
Burhan Khalid28 Apr 2008 04:59 
ewen fortune28 Apr 2008 05:23 
Burhan Khalid28 Apr 2008 15:07 
ewen fortune29 Apr 2008 00:14 
ewen fortune29 Apr 2008 05:32 
Geert Vanderkelen29 Apr 2008 06:06 
Burhan Khalid29 Apr 2008 06:17 
ewen fortune29 Apr 2008 06:50 
Geert Vanderkelen29 Apr 2008 06:56 
Geert Vanderkelen29 Apr 2008 07:10 
Burhan Khalid29 Apr 2008 07:49 
ewen fortune29 Apr 2008 08:00 
Geert Vanderkelen29 Apr 2008 08:53 
Burhan Khalid30 Apr 2008 01:19 
Jon Stephens30 Apr 2008 03:13 
Burhan Khalid30 Apr 2008 05:13 
ewen fortune30 Apr 2008 05:16 
Burhan Khalid30 Apr 2008 05:52 
Subject:Re: SQL Node Setup Question
From:ewen fortune (ewen@gmail.com)
Date:04/29/2008 05:32:39 AM
List:com.mysql.lists.cluster

Hi Burhan,

You must either start mysqld with "--ndbcluster" or enable the ndb storage engine in the [mysqld] section of /etc/my.cnf

Ewen

On Tue, Apr 29, 2008 at 2:10 PM, Burhan Khalid <b.kh@kuwaitnet.net> wrote:

So I downloaded 5.1 from source and compiled it with the following:

CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" ./configure --with-innodb --with-big-tables --with-mysqld-user=mysql --with-ndbcluster --with-ndb-test --prefix=/usr/local --with-unix-socket=/var/run/mysql.sock --enable-assembler

The system has compiled correctly. The reason I chose to compile from source is because of the thread reply from Greet regarding the redhat RPM and how it doesn't have ndb cluster support anymore.

However, when I login to the server, I don't see ndbcluster as an available engine when I run 'show engines';

The options I have are MRG_MYISAM, CSV, MyISAM, InnoDB, Memory.

Can someone tell me what I missed? Thanks.

[root@node3 bin]# mysql -S /var/lib/mysql/mysql.sock Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.25-rc Source distribution

ewen fortune wrote: Hi Burhan,

SQL Node - does this need to have MySQL server running? Not sure what does it mean here when it says "a given mysqld is already running".

Yes, the mysqld running with ndbcluster storage enabled is the SQL node. What "a given mysqld is already running" means here is that if for example a "create database" statement is executed on an SQL node, any mysqld connected to the cluster will receive the same command and therefore "discover" the database, but any SQL node that joins the cluster afterwards or is offline when the command is executed will not receive the command and therefore will have no knowlege of it being executed.

Data Nodes - No need for mysql server, just the ndb commands

Yes, data nodes only require the ndbd process to be running

Management Node - No need for mysql server, just the ndb commands

The management node only requires the ndb_mgmd process

cheers

Ewen

On Tue, Apr 29, 2008 at 12:07 AM, Burhan Khalid <b.kh@kuwaitnet.net> wrote:

Just a few more questions because I'll be setting up the cluster from scratch using 5.1 one.

SQL Node - does this need to have MySQL server running? Not sure what does it mean here when it says "a given mysqld is already running".

Data Nodes - No need for mysql server, just the ndb commands

Management Node - No need for mysql server, just the ndb commands

ewen fortune wrote:

Hi Burhan,

From

http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-resolved.html

-- Database autodiscovery and online schema changes. Autodiscovery of databases is now supported for multiple MySQL servers accessing the same MySQL Cluster, provided that a given mysqld is already running and is connected to the cluster at the time that the database is created on a different mysqld. --

I think that kind of explains things, its true that there are conditions involved, but if those conditions are met, then autodiscovery of databases is supported.

Cheers

Ewen

On Mon, Apr 28, 2008 at 1:59 PM, Burhan Khalid <b.kh@kuwaitnet.net>

wrote:

ewen fortune wrote:

Hi Burhan,

1. Why isn't it showing the SQL node?

From the output of "show" from ndb_mgm you have two API nodes connected [mysqld(API)] 6 node(s) id=4 @10.12.38.72 (Version: 5.0.45) id=5 @10.12.38.70 (Version: 5.0.45) I presume they are SQL nodes that are configured on each of the two data nodes, if that was not the intention, shutdown mysqld on each of the nodes as only the ndbd process is required. On the management node, have you enabled ndbcluster? [mysqld] ndbcluster ndb-connectstring=6;localhost

Thanks Ewen for responding, on my management node, /etc/my.cnf has: [mysqld] ndbcluster ndb-connectstring=10.8.106.134 [mysql_cluster] ndb-connectstring=10.8.106.134

I don't need to run ndb on the management node as well do I? What I

want is

all clients to connect to the management node to execute the queries,

and

then the clustering magic makes sure the queries are executed on the

data

nodes.

2. My understanding is that the SQL nodes are where clients connect;

and

then the SQL node will distribute the commands among the data nodes. So

in

my code, I should give the server address for connection as the

IP/hostname

of the SQL node, is this correct?

Yes, clients connect to the API nodes, in this case SQL nodes

3. From the docs it seems that database creation is not replicated; so what is the end result when a client sends a 'create database foo;'

command

to the SQL nodes? It is ignored or ... ??

Under 5.1 the "binary log injector thread" is responsible for "autodiscovery" of databases and ndb tables. Basically it propagates the DDL statements that are executed on one node to the the other SQL nodes.

Not sure what you are trying to tell me here :) Are you saying that if

I

upgrade to 5.1 (right now all the servers are 5.0) then I won't have

this

problem? As I read in the docs for both 5.0, 5.1 it said the same

thing:

http://dev.mysql.com/doc/refman/6.0/en/mysql-cluster-multi-load-data-queries.html

http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-multi-load-data-queries.html

http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-multi-load-data-queries.html

" It is important to note that NDBCLUSTER in MySQL 5.1 does not support autodiscovery of databases. (See Section 17.15, "Known Limitations of

MySQL

Cluster".) This means that, once the world database and its tables have

been

created on one data node, you need to issue the CREATE DATABASE world statement (or you may use CREATE SCHEMA world instead), followed by

FLUSH

TABLES on each SQL node in the cluster. This causes the node to

recognize

the database and read its table definitions."

Cheers

Ewen

On Mon, Apr 28, 2008 at 12:45 PM, Burhan Khalid <b.kh@kuwaitnet.net> wrote:

Hello:

I'm setting up a very basic cluster with the following:

Management Node: 10.8.106.134

Node A (data node): 10.12.38.72

Node B (data node): 10.12.38.70

Now I would like to setup the management node as a SQL node. I have installed mysql on the management node, and have edited the my.cnf file

to

look exactly like those on the data nodes; my config.ini is appended at

the

bottom of this message.

When I show the status on the management console, I get the following output:

ndb_mgm> show Connected to Management Server at: 10.8.106.134:1186 Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=2 @10.12.38.72 (Version: 5.0.51, Nodegroup: 0) id=3 @10.12.38.70 (Version: 5.0.51, Nodegroup: 0, Master)

[ndb_mgmd(MGM)] 1 node(s) id=1 @10.8.106.134 (Version: 5.0.51)

[mysqld(API)] 6 node(s) id=4 @10.12.38.72 (Version: 5.0.45) id=5 @10.12.38.70 (Version: 5.0.45) id=6 (not connected, accepting connect from any host) id=7 (not connected, accepting connect from any host) id=8 (not connected, accepting connect from any host) id=9 (not connected, accepting connect from any host)

Now for the actual questions:

1. Why isn't it showing the SQL node?

2. My understanding is that the SQL nodes are where clients connect;

and

then the SQL node will distribute the commands among the data nodes. So

in

my code, I should give the server address for connection as the

IP/hostname

of the SQL node, is this correct?

3. From the docs it seems that database creation is not replicated; so what is the end result when a client sends a 'create database foo;'

command

to the SQL nodes? It is ignored or ... ??

Thanks,

Burhan

config.ini:

[NDBD DEFAULT] NoOfReplicas=2 [MYSQLD DEFAULT] [NDB_MGMD DEFAULT] [TCP DEFAULT]

# Management Server Information [NDB_MGMD] HostName=10.8.106.134

# Nodes [NDBD] HostName=10.12.38.72 DataDir=/var/lib/mysql-cluster

[NDBD] HostName=10.12.38.70 DataDir=/var/lib/mysql-cluster

# SQL Node [MYSQLD] [MYSQLD] [MYSQLD] [MYSQLD] [MYSQLD] [MYSQLD]