-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix multi daemon can't start on same node #2289
Conversation
src/daemons/MetaDaemon.cpp
Outdated
@@ -170,7 +171,8 @@ int main(int argc, char *argv[]) { | |||
} | |||
|
|||
google::SetVersionString(nebula::versionString()); | |||
folly::init(&argc, &argv, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove the init method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because folly::init is almost same with init gflags + glog + singleton
. You mean we init gflags twice?
I am confused, if you want to start multi instances on one host, each instance should have its own pid file in config file, right? |
Init gflags twice, one before |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* fix multi daemon can't start on same node * address comments
* fix multi daemon can't start on same node * address comments
Introduced in #2278, if we want to start multiple daemon with different flag file, the
FLAGS_pid_file
is the same because we have not initgflags
yet. (all of them is the default value ofFLAGS_pid_file
, not the one in flag file)So we need to init
gflags
,glogs
by manual instead offolly::init
.