To run the project you need ant and java in a linux environment. If you don't want to create Jar files, you can use the script run-non-jar.sh.
First you need to run the script (has to be done with source):
$ source run.sh
You can use the command help to get help all the possibilities. The possible commands are:
$ compile
$ run_server
$ run_client
$ benchmarking
A quickly overview of the files are shown above:
- compile - Compile using ant and build the jar files to run the rest of the script.
- run_server - Run the Central Indexing Server at the Default port 3434.
- run_client - Run a Peer.
- bench_lookup - Benchmark the system.
- bench_single_registry - Benchmark the system.
- bench_registry_nodes - Benchmark the system.
- bench_registry - Benchmark the system.
- bench_download - Benchmark the system.
- create_directory - Create a test directory.
- help - Help command for the script.
There aren't possible option here, but this will only work with a working version of Apache Ant.
By default, it runs the server at the port 3434, to change it you have to use:
$ run_server portNumber
For the client there are two possibilities, the first one uses the default address for the Central Indexing Server and the second one you have to define the address and port for the server:
-
Uses the Central Indexing Server at localhost:3434
$ run_client directory port
-
Uses the Central Indexing Server address defined by the user:
$ run_client directory port serverAddress serverPort
For the Benchmarking of sending Lookup requests to the server, you can use like this:
-
Uses the Central Indexing Server at localhost:3434
$ bench_lookup numNodes folderName fileName numRequests
-
Uses the Central Indexing Server address defined by the user:
$ bench_lookup numNodes folderName fileName numRequests serverAddress serverPort
- numNodes: number of nodes
- folderName: the benchmarking is a peer so needs a folder name to register to the Server
- fileName: the file you want to search in the Server
- numRequests: number of requests per node
For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program 'numPeers' times.
-
Uses the Central Indexing Server at localhost:3434
$ bench_single_registry numPeers folderName
-
Uses the Central Indexing Server address defined by the user:
$ bench_single_registry numPeers folderName serverAddress serverPort
- numPeers: number of Peers registering
- folderName: the benchmarking is a peer so needs a folder name to register to the Server
For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program 'numPeers' times and will register 'numRegistryPerNode' times using a pool of threads for the concurrency.
-
Uses the Central Indexing Server at localhost:3434
$ bench_registry_nodes numPeers folderName numRegistryPerNode
-
Uses the Central Indexing Server address defined by the user:
$ bench_registry_nodes numPeers folderName numRegistryPerNode serverAddress serverPort
- numPeers: number of Peers registering"
- folderName: the benchmarking is a peer so needs a folder name to register to the Server"
- numRegistryPerNode - how many times will register each peer"
For the Benchmarking of registering peers to the server, you can use like below. In this one, it will run the program just once and will register 'numPeers' peers using a pool of threads for the concurrency.
-
Uses the Central Indexing Server at localhost:3434
$ bench_registry folderName numPeers
-
Uses the Central Indexing Server address defined by the user:
$ bench_registry folderName numPeers serverAddress serverPort
- numPeers: number of Peers registering
- folderName: the benchmarking is a peer so needs a folder name to register to the Server
For the Benchmarking of downloading files from other peer, you can use like this:
-
Uses the Central Indexing Server at localhost:3434
$ bench_download numNodes folderName fileName numRequests
-
Uses the Central Indexing Server address defined by the user:
$ bench_download numNodes folderName fileName numRequests serverAddress serverPort
- numNodes: number of nodes
- folderName: the benchmarking is a peer so needs a folder name to register to the Server
- fileName: the file you want to search in the Server
- numRequests: number of requests per node
This command will create a directory and random text files(1~20K) in order to test the system. It uses base64, so check if your Linux distro has it. Make any changes if needed. You can use this like this:
$ create_directory folderName numFiles
- folderName: Folder name that will be created to put the text files on
- numFiles: number of files that will be created in the created folder
You can type $ help
to view all the commands possible, and $ help 'command'
to know more about the command.