0

I am new in master-slave replication and horizontal fragmentation technique. Currently, I am doing my final year degree project title "Cluster replication using horizontal fragmentation approach".

This is my use case:

There are 4 virtual machines. One act as a master server and the others are slave server. I will implement the horizontal fragmentation technique in master server based on campus condition. My database is about student information.

These are the steps for my project:

  1. Import data from window to Linux
  2. Configure master-slave
  3. Implement the horizontal fragmentation techniques.

So, the problem is when I write this coding:

mysqldump --databases Student --tables Student_info --w"Campus in (select Campus from Student_info WHERE CAMPUS='KGB')" --single-transaction >masterdump1.sql

sudo scp masterdump1.sql slave1@192.168.117.143:

The data from the master server fragmented well. But when I try to add new student name, it is not fragment based on the campus condition.

It should be:

SLAVE1: student from KGB
SLAVE2: student from KB
SLAVE3: student from KK

But when updates, it will copy all the data and not fragment like it should be.

Is there any syntax that I left? Any suggestion to solve this problem? can you please help me?

  • Please, don't use all caps in your questions. Looks like shouting – Nathalia Soragge Jul 25 '18 at 02:44
  • okay. I am sorry. – izzati Aziz Jul 25 '18 at 03:03
  • 1
    I guess if a 3-liner would be enough to implement it, it's probably not worth a final year project. You cannot do that in native mysql (and you should analyze/note it in your documentation), so part of your project is probably to do research into/comparison of tools that can help you setting it up (any tool that reads binary logs, e.g. maxwell, plus additional steps to filter and get it back into slaves). Also make sure that your task is absolutely clear, e.g. which dbms to use (as e.g. most nosql systems support horizontal sharding out-of-the-box), and that cluster means 1 master+x slaves. – Solarflare Jul 25 '18 at 08:51
  • what do you mean about 3-liner and not worth for final year project? i don't understand. – izzati Aziz Jul 25 '18 at 16:27
  • I meant: if doing the dump with a `w` 3 times (3 lines of code) would make it work, it seems too small for a final year project (so it's probably not the intended solution). MySQL does not support horizontal fragmentation out of the box, so you need external tools for that (see e.g. [here](https://stackoverflow.com/a/23065889) or [here](https://dba.stackexchange.com/a/189829)). Your main task might be to analyze/decide on those (and other) options. You might also ask your teacher if that is the direction he intended you to go. Btw, is this school or university? – Solarflare Jul 26 '18 at 06:26
  • can you please give me the 3 lines of code that would make it works? I really need it. please.. – izzati Aziz Jul 26 '18 at 08:28
  • You tried to solve the task with 3 lines: `mysqldump...--w"Campus in (...'KGB'...`,`mysqldump...--w"...'KK'...`, `mysqldump...--w"...'KB'...`. These are the 3 lines of code I was talking about. You wondered why this didn't solve your task already (e.g. for `update`s). I just meant that *if* these 3 lines *would* solve it, it wouldn't be much of a project, so it's not surprising that it's not the solution. Please check my links to get a starting point of what you *could* do (assuming I (and you) understood your task correctly, so check with your teacher if that's the path he intended you to go) – Solarflare Jul 26 '18 at 14:27

0 Answers0