A multi-threaded microblogging service like Twitter which is able to handle multple concurrent clients #Instructions to execute the code.
Initial steps to setup the system:
-
Create a database and run the database code to define the database tables.
-
DDL Code to execute the database is available in Database_microblogging.
-
Update the database server details in database server string in the server codes of serv1.c and serv2.c.
-
Run make to compile all the files in the folder.
-
Executing the loadbalancer first. In our design we have defined the loadbalancer service on port number 8001.
run the following command to execute loadbalancer code.
./loadbalancer 8001 ex: ./loadbalancer localhost 8001
- Executing the servers: SERVER 1:PRIMARY SERVER we have defined the servers to take in the port number as arguments.
run the following command to execute server1 code:
./primary_server ex : ./primary_server 6001
- Executing the servers: SERVER 1:SECONDARY SERVER we have defined the servers to take in the port number as arguments.
run the following command to execute server2 code:
./backup_server ex : ./backup_server 7001
- Execute the client:
we have defined the client to take in the port number of the loadbalancer as argument.
run the following command to execute server2 code:
./client <port No of loadbalancer in step 5> ex : ./client localhost 8001