-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
cli: hint client flags in the output of cockroach start
#28198
Conversation
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale)
pkg/cli/start.go, line 569 at r1 (raw file):
fmt.Fprintf(tw, "webui:\t%s\n", serverCfg.AdminURL()) fmt.Fprintf(tw, "sql:\t%s\n", pgURL) fmt.Fprintf(tw, "client cmd:\t%s\n", clientFlags())
Nit: the commit message says client flags
, but here you have client cmd
. I wonder if this should be cli flags
. @piyush-singh ?
I agree with |
71c0dea
to
fbaa826
Compare
Done. Used the word "client" because "cli flag" would be inclusive of "cockroach start". |
|
What do you want me to do here?
Now consider this: I used |
I'm not thrilled with any of the options. |
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.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale)
pkg/cli/start.go, line 794 at r2 (raw file):
flags := []string{ os.Args[0], "--host=" + serverAdvertiseHost,
If I just run cockroach start
without specifying --host
or --advertise-host
, won't serverAdvertiseHost
be empty? I'd think we'd want to omit --host
in such cases (or always use localhost or the hostname or something)..
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 2 stale)
pkg/cli/start.go, line 794 at r2 (raw file):
Previously, a-robinson (Alex Robinson) wrote…
If I just run
cockroach start
without specifying--host
or--advertise-host
, won'tserverAdvertiseHost
be empty? I'd think we'd want to omit--host
in such cases (or always use localhost or the hostname or something)..
Although I guess that's ok, so nevermind.
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale)
@a-robinson good catch I wasn't looking at the right var to generate the flags. Fixed. |
Requested by @sploiselle. When one starts a node with the --host/--advertise flag, all future clients commands require the same value in --host. However, there is no in-app messaging that communicates this requirement, nor is there a command that you can run to find out what the --host flag was set to. Ditto for --certs-dir. This patch enhances the situation by announcing the command prefix to use for client commands in the output of `cockroach start`. For example: ``` % ./cockroach start --certs-dir=certs --host=localhost CockroachDB node starting [...] ... client flags: ./cockroach --host=localhost --port=26257 --certs-dir=certs ... ``` ``` % ./cockroach start --certs-dir=certs --host=localhost --advertise-host=kenax CockroachDB node starting [...] ... client flags: ./cockroach --host=kenax --port=26257 --certs-dir=certs ... ``` Release note (cli change): `cockroach start` now informs the user of which command-line flags to use to access the newly started node in client commands (e.g. `cockroach quit` etc.).
fbaa826
to
39d8b03
Compare
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.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 2 stale)
thanks! bors r+ |
28198: cli: hint client flags in the output of `cockroach start` r=knz a=knz Fixes #14325. Requested by @sploiselle. When one starts a node with the --host/--advertise flag, all future clients commands require the same value in --host. However, there is no in-app messaging that communicates this requirement, nor is there a command that you can run to find out what the --host flag was set to. Ditto for --certs-dir. This patch enhances the situation by announcing the command prefix to use for client commands in the output of `cockroach start`. For example: ``` % ./cockroach start --certs-dir=certs --host=localhost CockroachDB node starting [...] ... client flags: ./cockroach --host=localhost --port=26257 --certs-dir=certs ... ``` ``` % ./cockroach start --certs-dir=certs --host=localhost --advertise-host=kenax CockroachDB node starting [...] ... client flags: ./cockroach --host=kenax --port=26257 --certs-dir=certs ... ``` Release note (cli change): `cockroach start` now informs the user of which command-line flags to use to access the newly started node in client commands (e.g. `cockroach quit` etc.). Co-authored-by: Raphael 'kena' Poss <[email protected]>
Build succeeded |
Fixes #14325.
Requested by @sploiselle.
When one starts a node with the --host/--advertise flag, all future
clients commands require the same value in --host. However, there is
no in-app messaging that communicates this requirement, nor is there a
command that you can run to find out what the --host flag was set to.
Ditto for --certs-dir.
This patch enhances the situation by announcing the command prefix to
use for client commands in the output of
cockroach start
. Forexample:
Release note (cli change):
cockroach start
now informs the user ofwhich command-line flags to use to access the newly started node in
client commands (e.g.
cockroach quit
etc.).