Marsel Shayhin, Sergey Bogdanik Innopolis 2019
In the root directory you will find following files:
dfs_client.py
— The Client part of the project, responsible for CLI and reading user commands, passing them to the Networker Interface;libclient.py
— the Networker Interface, designed as simple network API, able to send and receive data over the network;dfs_nameserver.py
— the main Name Server script, used to set up the things as socket creation listening, selectors, storage, etc. As soon as it gets a connection from the Client, the Message Interface is created dedicated specifically for this client;libserver.py
— the Message Interface. It is responsible for handling received commands and reading/writing data to/from the client socket. Interacts with Storage Interface;libstorage.py
— the Storage Interface. Middle-man between Name Server and Master Interface. Takes the commands, calls storage and maintains state;storage.py
— the Master Interface. Acts as the orchestrator, interacts with Slave Interfaces;slave.py
— the Slave Interface. Every slave corresponds to the Slave Node in the remote location and used to communicate with them;storage_node.py
— the Slave Node code. Can handle reads/writes/deletes.
There are two main ways to launch our system: through vanilla Python and using Docker containers. Below you will find description of both ways.
- Run
storage_node.py
on Slave Node servers. - Edit
libstorage.py
's__init__
method and put IP addresses of Slave Nodes. - Run
dfs_nameserver.py
on Name Server. - Run
dfs_client.py --host=HOST
, whereHOST
is the IP address of the Name Server. You may also provide--port=PORT
, which defaults to 2100. - Type in some commands.
- Type
q
,quit
orexit
to stop client.
Use the Dockerfiles to deploy.
Node: https://hub.docker.com/repository/docker/srbgd/dfs-node
Nameserver: https://hub.docker.com/repository/docker/srbgd/dfs-nameserver