- CREATE command cannot create any directories at level zero, it at least has to specify one directory in which it wants to create a file or directory.
- Do not input an initial slash in the path.
- When we are sending a folder it must end with a slash.
- We assume that none of the files or folders in a storage server are empty.
- When a Storage Server goes offline, we will wait 15 seconds to issue redundancy commands.
- Port number is constant for different storage servers.
client/ contains all the files related to clients:
client.hcontains all the declarations of the functions and global variables used.client.ccontains all the functions and their implementations used.main.ccontains implementation of the main function and some of the helper functions.
common/ contains only one file common.h which has declarations and global variables that are used commonly across all three components.
naming_server/ contains all the files related to the naming server:
lru.chas implementations of the LRU cache.online.ccontains implementations for checking if all the storage servers are online periodically.trie.ccontains implementation of the trie for efficient searching and also some of the helper functions.naming_server.ccontains implementations of the functions used across the naming server.naming_server.hholds the function definitions of the functions in this folder.main.ccontains the main function of this modular code.
storage_server/ contains all the files related to storage server:
storage_server.ccontains all the implementations of the functions used across this folder.storage_server.hcontains the declarations of the functions that are implemented in storage_server.c.main.ccontains the main function of this modular code.
Open different terminals for different servers and clients.
For a naming server, run:
cd ./naming_server
gcc *.c
./a.outThe above prints out the IP address and different port numbers for client and storage server
For a client, run:
cd ./client
gcc *.c
./a.out <Naming Server IP> <Naming Server Port>For a storage_server, run:
cd ./storage_server
gcc *.c
./a.out <Naming Server IP> <Naming Server Port> <Path to directory of storage server>