If all has gone well, and the cluster has been set up correctly, the cluster should now be operational.
You can test this by invoking the
shown here, although you might see some slight differences in the output depending upon the exact
version of MySQL that you are using:
shell>
ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm>
SHOW
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]
id=2
@192.168.0.30
id=3
@192.168.0.40
[ndb_mgmd(MGM)] 1 node(s)
id=1
@192.168.0.10
[mysqld(API)]
id=4
@192.168.0.20
The SQL node is referenced here as [mysqld(API)], which reflects the fact that the
is acting as a MySQL Cluster API node.
You should now be ready to work with databases, tables, and data in MySQL Cluster. See
Section 17.2.4, "MySQL Cluster Example with Tables and
17.2.4. MySQL Cluster Example with Tables and Data
Working with database tables and data in MySQL Cluster is not much different from doing so in
standard MySQL. There are two key points to keep in mind:
• For a table to be replicated in the cluster, it must use the
this, use the
CREATE TABLE
Alternatively, for an existing table that uses a different storage engine, use
the table to use NDBCLUSTER:
ALTER TABLE
• Every
NDBCLUSTER
created, the
up space just as does any other table index. (It is not uncommon to encounter problems due to
insufficient memory for accommodating these automatically created indexes.)
If you are importing tables from an existing database using the output of mysqldump, you can open the
SQL script in a text editor and add the
existing
ENGINE
MySQL server that does not support MySQL Cluster, and you want to export the
shell>
mysqldump --add-drop-table world City > city_table.sql
The resulting
statements necessary to import the table data):
MySQL Cluster Example with Tables and Data
ndb_mgm
2 node(s)
(Version: 5.0.96, Nodegroup: 0, Master)
(Version: 5.0.96, Nodegroup: 0)
(Version: 5.0.96)
1 node(s)
(Version: 5.0.96)
Note
The IP address shown for a given MySQL Cluster SQL or other API node in the
output of
is the address used by the SQL or API node to connect to the
SHOW
cluster data nodes, and not to any management node.
ENGINE=NDBCLUSTER
tbl_name (col_name
tbl_name
ENGINE=NDBCLUSTER;
table has a primary key. If no primary key is defined by the user when a table is
storage engine automatically generates a hidden one. Such a key takes
NDBCLUSTER
(or TYPE) options. Suppose that you have the
file will contain this table creation statement (and the
city_table.sql
management node client. The output should look like that
Data", for a brief discussion.
NDBCLUSTER
or
option when creating the table:
ENGINE=NDB
column_definitions) ENGINE=NDBCLUSTER;
option to any table creation statements, or replace any
ENGINE
1540
storage engine. To specify
ALTER TABLE
sample database on another
world
City
process
mysqld
to change
table:
INSERT
Need help?
Do you have a question about the 5.0 and is the answer not in the manual?
Questions and answers