-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Introduce ad-hoc Erlang cookie configuration for the dev
scripts
#4445
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,6 +226,12 @@ def get_args_parser(): | |
default=[], | ||
help="Path to config to place in 'local.d'. Can be repeated", | ||
) | ||
parser.add_option( | ||
"--erlang-cookie", | ||
metavar="COOKIE_STRING", | ||
dest="erlang_cookie", | ||
help="Set Erlang cookie explicitly for inter-node communication", | ||
) | ||
return parser | ||
|
||
|
||
|
@@ -255,6 +261,7 @@ def setup_context(opts, args): | |
"procs": [], | ||
"auto_ports": opts.auto_ports, | ||
"locald_configs": opts.locald_configs, | ||
"erlang_cookie": opts.erlang_cookie, | ||
} | ||
|
||
|
||
|
@@ -290,6 +297,7 @@ def setup_configs(ctx): | |
cluster_port, backend_port, prometheus_port = get_ports( | ||
ctx, idx + ctx["node_number"] | ||
) | ||
cookie = ctx["erlang_cookie"] | ||
env = { | ||
"prefix": toposixpath(ctx["rootdir"]), | ||
"package_author_name": "The Apache Software Foundation", | ||
|
@@ -303,6 +311,7 @@ def setup_configs(ctx): | |
ensure_dir_exists(ctx["devdir"], "lib", node, "data") | ||
), | ||
"node_name": "-name %[email protected]" % node, | ||
"erlang_cookie": "-setcookie %s" % cookie if cookie else "", | ||
"cluster_port": cluster_port, | ||
"backend_port": backend_port, | ||
"prometheus_port": prometheus_port, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,7 @@ | |
{{node_name}} | ||
|
||
# All nodes must share the same magic cookie for distributed Erlang to work. | ||
# Uncomment the following line and append a securely generated random value. | ||
# -setcookie | ||
{{erlang_cookie}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, can this change break "couchdb-pkg" somewhere, if we are maybe grepping for "-setcookie"? @rnewson There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have not worked with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @jan for the references. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package scripts should be (needs to be) robust against this kind of thing and I believe they are. If the commented-out setcookie line is no longer present after this change the packaging scripts will append a setcookie line to the end of the file. That's less tidy than it being where we planned for it to be, but it will still work. I would, however, prefer for this change not to have unintended side-effects at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. |
||
|
||
# Which interfaces should the node listen on? | ||
-kernel inet_dist_use_interface {127,0,0,1} | ||
|
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.
any reason for the else clause when empty is the default?
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.
No, there is not any :-) Thanks for catching this.