Reputation: 9
I'm currently trying to setup a MySQL Cluster within my tomcat web application project. I've already properly set up my entire MySQL Cluster with my.cnf files sitting on both the Data Nodes and MySQL Nodes, and config.ini file sitting on the management node. All in all, I have 2 Management nodes, 2 Data Nodes, and 2 SQL Nodes.
This is the config.ini file:
#config.ini file
[ndb_mgmd]
NodeId=1
HostName=192.168.0.8
datadir=c:\my_cluster\ndb_data
[ndb_mgmd]
NodeId=2
HostName=192.168.0.2
datadir=c:\my_cluster\ndb_data
[ndbd default]
noofreplicas=2
datadir=c:\my_cluster\ndb_data
[ndbd]
hostname=192.168.0.1
NodeId=3
[ndbd]
hostname=192.168.0.6
NodeId=4
[mysqld]
hostname=192.168.0.2
[mysqld]
hostname=192.168.0.3
This is the my.cnf file
#my.cnf file
[mysqld]
ndbcluster
datadir=c:\\my_cluster\\mysqld_data
basedir=c:\\mysqlc
port=5000
ndb-connectstring=192.168.0.8,192.168.0.2
skip-name-resolve
[mysql_cluster]
ndb-connectstring=192.168.0.8,192.168.0.2
After setting up this entire cluster, the entire cluster setup works. However, when I made a simple insertion of data in my project web application when testing using the computer with this ip address, 192.168.0.6, the insertion did not take place at the data nodes' databases. Instead, insertion of data took place at the SQL Nodes' localhost databases.
Please advice me what should I do to ensure that insertion of new data goes to the data nodes' databases.
Upvotes: 1
Views: 395
Reputation: 570
Just to check - what makes you believe that the data is stored locally in the MySQL server rather than in the data nodes?
When you created the tables, did you include the engine=ndb option? Check the output of SHOW CREATE TABLE to make sure.
Andrew.
Upvotes: 1