pingcap / pingcap/tiup

Add `tiup cluster pdctl` command

Open
#2,083 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/feature-request
Dominant language
Go
Stars
466
Forks
338
Avg merge
3d 7h
Merged PRs (30d)
8

Description

Feature Request

Is your feature request related to a problem? Please describe:

We use pd-ctl frequently. For example, to get a list of stores, we need to use:

tiup ctl:<cluster_version> pd -u http://<pd_address>:2379 store

In order to execute the command, I need to look up the cluster_version and the pd_address first, by something like:

tiup cluster display my_cluster

It is not very convenient.

Describe the feature you'd like:

Introduce a new command for tiup cluster, so that we can just:

tiup cluster pdctl <cluster_name> <commands>

like:

tiup cluster pdctl my_cluster store

Considering that only pd-ctl may omit the PD address, and other ctls (like tikv-ctl) still need to explicit assign an address, may be we can just introduce this shortcut for pd-ctl only.

In future we can also have a shortcut for etcdctl, if necessary:

tiup cluster etcdctl my_cluster get ...

Considering that etcd-ctl is rarely used, I think it is fine to just have pdctl.

Why the featue is needed:

Describe alternatives you've considered:

Teachability, Documentation, Adoption, Migration Strategy:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing tiup cluster display command and the tiup ctl:<cluster_version> pd invocation described in the issue. Determine how the cluster name can supply the PD address and version, then add tiup cluster pdctl <cluster_name> <commands> with the example store operation working as the definition of done.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.