Skip to content

Mehdibenhadjkhelifa/Distributed-Systems-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Distributed systems Project

this is an assignment for my university

STATUS: Work In Progress

Dependencies

For this project to be setup and run you should have:

1- A mysql databse

download a mysql database like Mysql MariaDB .

2- Have Gcc compiler

download a gcc compiler to compile provided code with provided shell script

3- Mysql Library

download the mysql library to staticly link it with the ServeurTCP binary

Setup

1- Clone Repository

clone the repository locally and cd into it with the following commands:

git clone https://github.com/Mehdibenhadjkhelifa/Distributed-Systems-Project.git
cd Distributed-Systems-Project

2- download dependencies

you need download all dependencies listed above

OR

if you are in a ubuntu system run:

scripts/ubuntuSetup.sh

3- Setup MySql Database

a- Setup a user named root with a password of root:

this is achieved by the following comands:

sudo mysql
-- for MySQL
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

-- for MariaDB
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('root');

b- Create a database named VehiculeDB with a table named Invoices:

Use the provided file in SqlHelpers named setup.sql entering the following command :

mysql < SqlHelpers/setup.sql -u root -p

when prompted for the password enter root as setup in step a

this command will setup your mysql server with a database named VehiculeDB

and a table named Invoices have examples of invoices.

OR

you can set it up manually using sql commands but NOTE that the name

of the database and the table should match what is noted above.

c- Add additional invoices data:

You can use the data.sql file provided in SqlHelpers and modify it to add additional raws in the database .

After adding elements execute:

mysql < SqlHelpers/data.sql -u root -p

Same as last step enter root as your password.

OR

you can add individual elements manually and NOTE to match the name of the table.

4- Build Binaries

you can build the whole project with :

scripts/build.sh

this will generate 4 binaries under the bin folder to use :

1- ClientTCP which is the client's binaries

2- ClientServeur which is the proxy

3- ServeurTCP which is the Vehicules serveur

4- ServeurUDP which is the parapharmaceutical serveur

OR

you can compile the binaries with a compiler of your choice but note that

the proxy have the following source files: ClientServeur.c ClientServeurUtils.c

And link the vehicule serveur ServeurTCP with mysqlclient.

Executing the app

you should execute the 4 provided binaries in a seperate processes and only use the Client

pocesse to use the app where you can:

1- Retrieve Parapharmaceutical invoices

2- Retrieve Vehicules invoices

3- Get Sum of both server's invoices

NOTE: To view more details about the project,check the provided pdf file(STILL NOT PROVIDED).

About

Developing a distributed system as a university assignement while collaborating with my classmates

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •