I want to spread my MySQL rows to 4 servers (Horizontal sharding). I searched, and I found that I have to use NDB cluster (MySQL cluster). I made a MySQL server/client with NDB manager server and 4 data nodes servers and this is my manager configuration :
[ndbd default]
NoOfReplicas=1
[ndb_mgmd]
NodeId=1
hostname=192.168.159.133
datadir=/var/lib/mysql-cluster
[ndbd]
NodeId=2
hostname=192.168.159.131
datadir=/home/db
[ndbd]
NodeId=3
hostname=192.168.159.132
datadir=/home/db
[ndbd]
NodeId=4
hostname=192.168.159.137
datadir=/home/db
[mysqld]
NodeId=20
hostname=192.168.159.133
I know replication means make a backup of each row to another server and I don't want it (I just want to spread my data (rows) to 4 servers, not making backup) so I set NoOfReplicas to 1 to have 4 nodegroups ...
Am I right ? Does my data (rows) spread on that 4 data-node servers ?
If I right, what is different between doing this, or just using Innodb and make foreign partitions (on remote servers) ? Because it's a lot easier to make partition (key) by my own and attach each partition to remote servers !!!
Is using NDB has more advantage (about what I want to do (spread data, not replication (making backup))) ?
And final question, is it right to have NDBCLUSTER table with also own partitions ???!!! What is that mean, anyway ? For example, I have 4 data-nodes and for a NDBCLUSTER table, I create 8 partitions too (key partition) ! How that's work? Does it create 8 partitions on each data-node ? Or just split those partitions on those 4 data-nodes server (for example, each data-node holds 2 partitions) ?
[ndbd default]
NoOfReplicas=1
[ndb_mgmd]
NodeId=1
hostname=192.168.159.133
datadir=/var/lib/mysql-cluster
[ndbd]
NodeId=2
hostname=192.168.159.131
datadir=/home/db
[ndbd]
NodeId=3
hostname=192.168.159.132
datadir=/home/db
[ndbd]
NodeId=4
hostname=192.168.159.137
datadir=/home/db
[mysqld]
NodeId=20
hostname=192.168.159.133
I know replication means make a backup of each row to another server and I don't want it (I just want to spread my data (rows) to 4 servers, not making backup) so I set NoOfReplicas to 1 to have 4 nodegroups ...
Am I right ? Does my data (rows) spread on that 4 data-node servers ?
If I right, what is different between doing this, or just using Innodb and make foreign partitions (on remote servers) ? Because it's a lot easier to make partition (key) by my own and attach each partition to remote servers !!!
Is using NDB has more advantage (about what I want to do (spread data, not replication (making backup))) ?
And final question, is it right to have NDBCLUSTER table with also own partitions ???!!! What is that mean, anyway ? For example, I have 4 data-nodes and for a NDBCLUSTER table, I create 8 partitions too (key partition) ! How that's work? Does it create 8 partitions on each data-node ? Or just split those partitions on those 4 data-nodes server (for example, each data-node holds 2 partitions) ?