{"id":24273231,"url":"https://github.com/benawi/process-migration","last_synced_at":"2025-09-24T14:31:40.145Z","repository":{"id":235533224,"uuid":"614924937","full_name":"Benawi/Process-Migration","owner":"Benawi","description":"Distributed Systems- Code Migration Demo","archived":false,"fork":false,"pushed_at":"2023-03-30T12:58:24.000Z","size":68,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-23T19:22:15.346Z","etag":null,"topics":["codemigration","distributed-systems","masterserver","slaveserver"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Benawi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-16T15:37:13.000Z","updated_at":"2024-04-23T19:22:17.739Z","dependencies_parsed_at":"2024-04-26T06:45:18.705Z","dependency_job_id":null,"html_url":"https://github.com/Benawi/Process-Migration","commit_stats":null,"previous_names":["benawi/process-migration"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benawi%2FProcess-Migration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benawi%2FProcess-Migration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benawi%2FProcess-Migration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benawi%2FProcess-Migration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Benawi","download_url":"https://codeload.github.com/Benawi/Process-Migration/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234089323,"owners_count":18778052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemigration","distributed-systems","masterserver","slaveserver"],"created_at":"2025-01-15T19:36:30.159Z","updated_at":"2025-09-24T14:31:39.667Z","avatar_url":"https://github.com/Benawi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Process-Migration\n## Distributed Systems- Code Migration Demo\n\n## DESIGN\nThis distributed system architecture has the following components:\n\t1. Master node\n\t2. Multiple Slave nodes\nAll the components communicate with each other as follows:\n● The slave nodes continuously listening on particular predefined ports.\n● The master connects to the various slaves via sockets to issue the required commands.\n\nThe master node waits on the user to enter a particular command. The framework supports the\nfollowing commands:\n\n## 1. LAUNCH\nUsed to launch a new process. The syntax is:\nlaunch \u003cprocess_name\u003e \u003carguments\u003e\nThis command makes the master choose one of the slave nodes in a round robin\nfashion and fork the process \u003cprocess_name\u003e with the required process arguments\n\u003carguments\u003e.\nOn the successful execution of the command, the process gets started on the\ncorresponding slave node and the master outputs P_name. P_name is the name of the\njob that just got created. The string looks like this:\n\tPname: \u003cslave\u003e_\u003cprocess_name\u003e_\u003cidentifier\u003e\nThis basically has 3 parts to it. They are:\n\ta) \u003cslave\u003e: This is the name of the slave node on which the process is running on.\n\tb) \u003cprocess_name\u003e: This is the process that is running on the slave node. It is same as\n\t\tthe process name mentioned to launch the process above.\n\tc) \u003cidentifier\u003e: This is the unique identifier that is used to distinguish this process on this\nslave from other similar named processes on the same node.\nThis P_name will be used for identifying the process while migrating the process.\n\n## 2. MIGRATE\nThis command is used to migrate a process from one slave node to another. The syntax\nis as follows:\nmigrate \u003cP_name\u003e \u003cdestination_slave\u003e\nThe user can choose any running process P_name and choose to migrate it to any slave\nnode he wishes to using this command.\nOnce the command is successfully executed, it returns the new P_name coherent to the\nnew slave node its running on.\n\n## 3. KILL\nThis command is used to kill any running process. The syntax is as follows:\nkill \u003cP_name\u003e\nThe user can choose to kill any running process using this command. Once the\ncommand is successfully executed, it prints a message saying what got killed.\n\n## 4. PEEK\nThis command is used to peek at the current running process list. The syntax is:\npeek\nIt does not have any arguments. It prints out a list of all the P_names. This information\ncan be used to determine which process to migrate or kill.\nWhen this command is called, the master node pings each slave with the various\nP_names to determine if they’re still running of if they exited (with an error or gracefully). It\nthen populates the list and prints it to the user.\nEach node (master and different slaves) have their own instances running on different nodes.\nThe slaves are listening on a particular port and the command line prompt is available to the user\non the master node for input. Once the user enters one of the commands viz. launch, remove,\nmigrate and peek, the master initiates a connection with one of the slaves (in round-robin\nstyle)\nfor the launch command or a particular slave in case of a migrate or kill command and sends out\nthe requested command to it. Once the process is started on the slave, the slave returns the\nrequired output to the master which is printed on the terminal. The call made by the user is\nblocked until this happens.\nAlong with the handin, there are two other test files apart from Grepprocess.java. THey can be\nused to test the code with.\n\n\nHOW TO BUILD AND RUN IT\n1) We have assumed that there are 2 slave nodes and 1 master node. If you wish to\nuse more slave nodes, please create a copy of srcSlave1 or srcSlave2 and edit some\nhardcoded details (like the hostname/port of the machine) in the main file.\n2) The srcMaster folder must be used in the master node machine and srcSlave* must be used\nin the slave node machines. For our test, we used cs.wku.edu.\n3) In the srcMaster folder, there is a file called MasterMain.java in the framework folder. Open it\nup and customize the following line to the machine’s hostname addresses:\n\tSlave s1 = new Slave(\"SlaveOne\", \"cs1.wku.edu.\", 6000);\n\tSlave s2 = new Slave(\"SlaveTwo\", \"cs2.wku.edu.\", 6001);\nHere, machine names like “cs1.wku.edu.” can be changed to the machine name the\ncode is running on. Do this change for SlaveMain.java file for the other folders too.\n4) To compile each folder, just outside the srcMaster directory, enter:\n\tjavac srcMaster/framework/*.java srcMaster/process/*.java\n5) Perform the above step for the other folders too, eg.:\n\tjavac srcSlave1/framework/*.java srcSlave1/process/*.java\n\tjavac srcSlave2/framework/*.java srcSlave2/process/*.java\n6) Once the java code is compiled, for each of the nodes, enter their src folder, i.e. srcMaster,\nsrcSlave1, srcSlave2 and enter the following for each:\n\tjava cp\n\t. framework.MasterMain for\n\tsrcMaster Master\n\tnode\n\tjava cp\n\t. framework.SlaveMain for\n\tsrcSlave1 and srcSlave2 Slave\n\tnodes\n7) This should start the program and there will be a command prompt on the Master node. Use\nthe commands like launch, migrate, kill and peek to perform operations.\n\n\n## Example run log:\n\n## Steps\n![Migration](https://user-images.githubusercontent.com/21217148/225671473-b8e8cb62-2b91-4425-8d88-e771dc6ab105.JPG)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenawi%2Fprocess-migration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenawi%2Fprocess-migration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenawi%2Fprocess-migration/lists"}