Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy multiple power workers on the same machine. #40

Closed
jjnnzb opened this issue Jul 31, 2020 · 3 comments
Closed

Deploy multiple power workers on the same machine. #40

jjnnzb opened this issue Jul 31, 2020 · 3 comments
Assignees
Labels
new feature new feature

Comments

@jjnnzb
Copy link
Member

jjnnzb commented Jul 31, 2020

Is your feature request related to a problem? Please describe.

 public class OmsWorkerFileUtils {

    private static final String USER_HOME = System.getProperty("user.home", "powerjob");
    private static final String WORKER_DIR = USER_HOME + "/powerjob/";

    public static String getScriptDir() {
        return WORKER_DIR + "script/";
    }

    public static String getContainerDir() {
        return WORKER_DIR + "container/";
    }

    public static String getH2Dir() {
        return WORKER_DIR + "h2/";
    }
}

The working directory of the project is set to ${user.home}/powerjob/h2,and the database file name is always powerjob_worker_db.mv.db. So I am wondering if I deploy multiple workers for different works on the same machine, would any conflicts occur?

Describe the solution you'd like
Powerjob worker automatically reads spring.application.name from application.properties?

Describe alternatives you've considered
Generate different paths for different projects, or read path from application.properties, or set different names for different databases?

Additional context
Many thanks!

@jjnnzb jjnnzb added the new feature new feature label Jul 31, 2020
@KFCFans KFCFans self-assigned this Jul 31, 2020
@KFCFans KFCFans added this to To do in PowerJob Work Plan via automation Jul 31, 2020
@KFCFans
Copy link
Member

KFCFans commented Jul 31, 2020

通过接入的应用名来隔离运行时文件是一个非常好的 idea!
下个版本 worker 的工作路径会改成 ~/powerjob/$appName/UUID/powerjob/h2
感谢支持,敬请期待~
(预计本周末发布新版本

@KFCFans KFCFans moved this from To do to In progress in PowerJob Work Plan Jul 31, 2020
@dudiao
Copy link
Member

dudiao commented Jul 31, 2020

UUID改成port是不是更好点: ~/powerjob/$appName/port/powerjob/h2

@KFCFans
Copy link
Member

KFCFans commented Aug 2, 2020

since v3.2.2

@KFCFans KFCFans closed this as completed Aug 2, 2020
PowerJob Work Plan automation moved this from In progress to Done Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature new feature
Projects
Development

No branches or pull requests

3 participants