NET_RAID_FS is a network filesystem implemented with standard raid level 1 algorithm.
- Filesystem uses stable storage which guarantees atomicity for any given write operation and allows software to be written that is robust against some hardware and power failures.
- In case of server loss, filesystem uses hot swapping which allows replacement of server to a system without stopping, shutting down, or rebooting it.
- Also filesystem has caching and epoll mechanisms for efficiency purposes.
.
|-- server
| |-- MakeFile
| |-- net_raid_server.c
|
|-- Makefile
|-- net_raid_client.c
|-- parser.c
|-- parser.h
|-- README.md
|-- DOC
|-- utils.h
.
There are separate entry points and therefore separate makefile files for server and client, there is additional parser.c/h in client side to parse configuration file, also in client side there is utils.h which is common for both server and client and where there is described all the data structures that is needed to send and receive data.
To run the program you need to have valid configuration file, which looks like this:
errorlog = /path/to/error.log
cache_size = 1024M
cache_replacement = lru
timeout = 10
diskname = STORAGE1
mountpoint = /path/to/mountpoint1
raid = 1
servers = 127.0.0.1:10001, 127.0.0.1:10002
hotswap = 127.0.0.1:11111
diskname = STORAGE2
mountpoint = /path/to/mountpoint2
raid = 5
servers = 127.0.0.1:10011, 127.0.0.1:10012, 127.0.0.1:10013
hotswap = 127.0.0.1:22222
Where:
- errorlog - the file path where you want to log system activities.
- cache_size - size of cache, which has B/K/M/G.
- cache_replacement - replacement algorithm (system has only lru support).
- timeout - second, which system is waiting after server loss, in this time system might recover the lost server and continue working, after this time servers is declared missing.
Beside of these general configurations, there can be multiple disk configurations:
- diskname - used only in logging.
- mountpoint - main mount directory for this disk, where client will read and write data.
- raid - level of raid algorithm (system has only level 1 support).
- servers - list of servers, which should be registered before client, there is only 2 servers in raid 1.
- hotswap - hotswap server for replacing lost server. After server loss data will be copied from healthy server, in case of another server loss system will continue working with only one server.
After creating the configuration file, libssl must be installed to run the hashing mechanisms command - $ sudo apt-get install libpcap-dev libssl-dev
After installing this package, it is now possible to run the program, first running the server:
- From the terminal which is opened from /NET_RAID_FS/server directory run make command first to compile code.
- To run the server itself run the following command ./net_raid_server [ip] [port] [storagedir] (e.g. ./net_raid_server 127.0.0.1 10001 /home/kobi/Desktop/storagedir1)
- First all the servers that was specified in the configuration file must register and wait for their connections.
After registering all the servers, the client runs
- From the terminal which is opened from /NET_RAID_FS directory run make command first to compile code.
- To run the server itself run the following command ./net_raid_client [config file] (e.g. ./net_raid_client /home/kobi/Desktop/config_file.txt)
After launching the program, the mount points specified in the configuration file will be mounted. Data will be stored on the server side, in the storage specified during the registration.