cockroachdb / cockroachdb/cockroach
cli: unable to specify separate SQL and gRPC port via static environment variables
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
With the release of 22.2, having a unified SQL and gRPC port has been deprecated, thus in our cloud deployments we use separated SQL and gRPC ports. However it currently isn't possible to be able to specify with static environment variables what ports `cockroach` CLI commands should use.
For example, if I want to access SQL shell I would have to do
```COCKROACH_URL="postgresql://root@127.0.0.1:26257" cockroach sql```
but in order to take a debug zip with a gRPC port listening on 26258 it would be
```COCKROACH_URL="postgresql://root@127.0.0.1:26258" cockroach debug zip ./debug.zip```
It's also sometimes not obvious what commands use the gRPC port vs what commands use the SQL port (maybe there are some that use both?). So far my current workaround has been to write a wrapper that replaces the environment variable depending on the command used but this isn't ideal.
It would be good if I didn't need to worry about that and am able to set a static environment variable for gRPC use, preferably in the form of a separate URL, like `COCKROACH_GRPC_URL`.
Jira issue: CRDB-27406
Contributor guide
Assessment
This issue has not been assessed yet.