It's a python project to communicate between several machines using TCP/IP (PyZmq) where We have master, data keepers and clients. Clients can ask master to upload/download videos then master reply with specific IP/port for data keeper to upload/download from then Data keeper notify master that the process succeeded.
Master processes are:
- Processes to interact with clients.
- Process to interact with data keepers.
- Process to receive alive message from datakeepers.
- Process to replicate data on different datakeepers.
- Main process to run all processes.
Master Shared Memories are:
- Lookup_table contains each file name and the data keepers contain that file.
- Available_stream_table contains each ip/port status for data keepers(available or busy).
- Alive_table contains status for each data keeper(alive or dead).
Data keeper processes are:
- Processes to interact with clients and Master.
- Main process to run all processes.
We need first to write configuration file config.txt
. Parameter are replica factor, replice_period, number of data keepers(n) and number of data keeper processes in that order then n pair of lines each two lines contain ip and start_port for the data keeper. Then run master.py and give it starting port and number of processes to connect with clients. For example:
$ python main.py 4444 1
Run data-keeper.py and give it starting port, number of processes to connect with clients/master and folder_name to upload/download files using it. For example:
$ python data_keeper.py 5556 3 dk1
Run client.py and give it master ip, master_start_port number of processes in master to interact with clients, folder_name to upload/download files using it and id for that user. For example:
$ python client.py 4444 1 client_data 6