To compile and execute the files, make sure that you include the required .jar files under lib/ in the classpath.
Set the IP addresses for the workers, server, and reducer by changing the constants on java.com.homerentals.backend.BackendUtils (default is localhost)
-
For Linux and Mac OS: Simply execute our script by running
bash startup.sh
-
For Windows:
cd src/main/java
- Compile the files
javac -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com/homerentals/**/*.java
- Reserve worker ports:
java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.PortManager <NUMBER_OF_WORKERS> com/homerentals/backend/ports.list
- Start the server:
java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.Server com/homerentals/backend/ports.list
- Start the workers.
Run the below for as many workers as you defined above. The port should be one of the automatically generated ports inside
src/main/java/com/homerentals/backend/ports.list
:java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.Worker <PORT>
- Start the reducer instance:
java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.Reducer <NUMBER_OF_WORKERS>
- The backend is up and running. You can connect to it by either a dummy guest console with the credentials
[email protected]:guest
java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.GuestConsole
or as the host via the host console with the credentialsadmin:admin
java -cp ../../../lib/commons-io-2.15.1.jar;../../../lib/json-20240303.jar;. com.homerentals.backend.
(credentials inusername:password
format). - Success! You are now connected.
Created by Alex Papadopoulos and Katerina Mantaraki for 🎓