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

tiup ctl etcd doesn't work without extra steps #2080

Closed
dveeden opened this issue Nov 17, 2022 · 1 comment · Fixed by #2081
Closed

tiup ctl etcd doesn't work without extra steps #2080

dveeden opened this issue Nov 17, 2022 · 1 comment · Fixed by #2081
Labels
type/bug Categorizes issue as related to a bug.

Comments

@dveeden
Copy link
Contributor

dveeden commented Nov 17, 2022

Bug Report

tiup uses etcdctl version 3.3.10 which defaults to etcctl API v2, which doesn't work with PD v6.3.0.

https://etcd.io/docs/v3.5/dev-guide/interacting_v3/ says:
"By default, etcdctl on master (3.4) uses the v3 API and earlier versions (3.3 and earlier) default to the v2 API."

$ tiup ctl:v6.4.0 etcd | grep -A2 WARNING
Starting component `ctl`: /home/dvaneeden/.tiup/components/ctl/v6.4.0/ctl etcd
WARNING:
   Environment variable ETCDCTL_API is not set; defaults to etcdctl v2.
   Set environment variable ETCDCTL_API=3 to use v3 API or ETCDCTL_API=2 to use v2 API.
$ find ~/.tiup -name etcdctl -print -exec {} -version \;
/home/dvaneeden/.tiup/components/ctl/v6.3.0/etcdctl
etcdctl version: 3.3.10
API version: 2
/home/dvaneeden/.tiup/components/ctl/v6.4.0/etcdctl
etcdctl version: 3.3.10
API version: 2

Two possible solutions:

  1. Set the ETCDCTL_API variable to 3
  2. Upgrade etcdctl to the latest version.
@dveeden dveeden added the type/bug Categorizes issue as related to a bug. label Nov 17, 2022
@dveeden
Copy link
Contributor Author

dveeden commented Nov 17, 2022

Example with TiDB:

$ ETCDCTL_API=3 tiup ctl:v6.4.0 etcd get --prefix /topology/grafana --print-value-only | jq .
Starting component `ctl`: /home/dvaneeden/.tiup/components/ctl/v6.4.0/ctl etcd get --prefix /topology/grafana --print-value-only
{
  "ip": "127.0.0.1",
  "port": 3000,
  "binary_path": "/home/dvaneeden/.tiup/components/grafana/v6.3.0/bin/grafana-server"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Categorizes issue as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant