In a distributed program, how to recovey its corresponding data when a process crashes

33 Views Asked by At

I have a distributed program, for example, it has ten process, and all of them will execute some job, all job info will storage to a same MySQL database. At a same moment, there was a lot of running job in database, and they are belong to different process. When one process crash, how can I recovery it running job info in a new process. By the way, my enviroment has MySQL and zookeeper.

1

There are 1 best solutions below

0
On

You should set an ID to every running process You should set an ID to every running job You should put code process in try...catch...finally , to know which ID trashed You should manage relations between process ID and its IDs jobs