You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by guo jiwei <te...@apache.org> on 2023/06/20 06:00:29 UTC

[DISCUSS] PIP-277: Clusters list API return clusters with local flag

Hi community:
    After configuring the geo-replication on Pulsar clusters, the `clusters
list` API will return multiple clusters, including the local Pulsar cluster
and remote clusters like

```
bin/pulsar-admin clusters list
us-west
us-east
us-cent
```
But in this return, you can't distinguish the local and the remote cluster.
When you need to remove the geo-replication configuration, it will be hard
to decide which cluster should be removed on replicated tenants and
namespaces unless you record the cluster information.


### Modification
Add `local` flag to distinguish clusters
```
bin/pulsar-admin clusters list
us-west(local)
us-east
us-cent
```

PIP: https://github.com/apache/pulsar/pull/20614


Regards
Jiwei Guo (Tboy)

Re: [DISCUSS] PIP-277: Clusters list API return clusters with local flag

Posted by guo jiwei <te...@apache.org>.
Thanks. addressed in the PIP


Regards
Jiwei Guo (Tboy)


On Sun, Jun 25, 2023 at 6:05 PM PengHui Li <pe...@apache.org> wrote:

> Hi Jiwei,
>
> Do you need to change the REST API? or will it just apply to the Admin CLI?
> If it requires REST API changes, you should also reflect them in the
> proposal.
>
> And yes, using the local and remote will be confusing because users can
> have
> multiple clusters without geo-replication. Maybe we should use the
> --current option
> to show which cluster are requesting. So that we will not introduce any
> break changes.
> If we don't have compatibility issue, I don't like the --current option :)
>
> With the --current option:
>
> ```
> bin/pulsar-admin clusters list --current
>
> us-west(*)
> us-east
> us-cent
> ```
>
> It looks like (*) is commonly used, e.g. kubectl config get-contexts ...
>
> Regards,
> Penghui
>
> On Sun, Jun 25, 2023 at 3:53 PM Zixuan Liu <no...@gmail.com> wrote:
>
> > +1, this is a good improvement.
> >
> > In the proposal, I don't suggest you append the `local` to the cluster
> > name:
> >
> > 1. It will be confusing when the original cluster name includes the
> > `local` name
> > 2. In some cases, it is not easy to distinguish between local and
> > remote clusters
> >
> > so I suggest we should add the `local` and `remote` flags like:
> >
> > ```
> > # list remote clusters
> > bin/pulsar-admin clusters list --remote
> > us-east
> > us-cent
> >
> > # list local clustes
> > bin/pulsar-admin clusters list --local
> > us-west
> >
> > # list all clusters
> > bin/pulsar-admin clusters list
> > us-east
> > us-cent
> > us-west
> > ```
> >
> > Thanks,
> > Zixuan
> >
> > guo jiwei <te...@apache.org> 于2023年6月20日周二 14:00写道:
> > >
> > > Hi community:
> > >     After configuring the geo-replication on Pulsar clusters, the
> > `clusters
> > > list` API will return multiple clusters, including the local Pulsar
> > cluster
> > > and remote clusters like
> > >
> > > ```
> > > bin/pulsar-admin clusters list
> > > us-west
> > > us-east
> > > us-cent
> > > ```
> > > But in this return, you can't distinguish the local and the remote
> > cluster.
> > > When you need to remove the geo-replication configuration, it will be
> > hard
> > > to decide which cluster should be removed on replicated tenants and
> > > namespaces unless you record the cluster information.
> > >
> > >
> > > ### Modification
> > > Add `local` flag to distinguish clusters
> > > ```
> > > bin/pulsar-admin clusters list
> > > us-west(local)
> > > us-east
> > > us-cent
> > > ```
> > >
> > > PIP: https://github.com/apache/pulsar/pull/20614
> > >
> > >
> > > Regards
> > > Jiwei Guo (Tboy)
> >
>

Re: [DISCUSS] PIP-277: Clusters list API return clusters with local flag

Posted by PengHui Li <pe...@apache.org>.
Hi Jiwei,

Do you need to change the REST API? or will it just apply to the Admin CLI?
If it requires REST API changes, you should also reflect them in the
proposal.

And yes, using the local and remote will be confusing because users can have
multiple clusters without geo-replication. Maybe we should use the
--current option
to show which cluster are requesting. So that we will not introduce any
break changes.
If we don't have compatibility issue, I don't like the --current option :)

With the --current option:

```
bin/pulsar-admin clusters list --current

us-west(*)
us-east
us-cent
```

It looks like (*) is commonly used, e.g. kubectl config get-contexts ...

Regards,
Penghui

On Sun, Jun 25, 2023 at 3:53 PM Zixuan Liu <no...@gmail.com> wrote:

> +1, this is a good improvement.
>
> In the proposal, I don't suggest you append the `local` to the cluster
> name:
>
> 1. It will be confusing when the original cluster name includes the
> `local` name
> 2. In some cases, it is not easy to distinguish between local and
> remote clusters
>
> so I suggest we should add the `local` and `remote` flags like:
>
> ```
> # list remote clusters
> bin/pulsar-admin clusters list --remote
> us-east
> us-cent
>
> # list local clustes
> bin/pulsar-admin clusters list --local
> us-west
>
> # list all clusters
> bin/pulsar-admin clusters list
> us-east
> us-cent
> us-west
> ```
>
> Thanks,
> Zixuan
>
> guo jiwei <te...@apache.org> 于2023年6月20日周二 14:00写道:
> >
> > Hi community:
> >     After configuring the geo-replication on Pulsar clusters, the
> `clusters
> > list` API will return multiple clusters, including the local Pulsar
> cluster
> > and remote clusters like
> >
> > ```
> > bin/pulsar-admin clusters list
> > us-west
> > us-east
> > us-cent
> > ```
> > But in this return, you can't distinguish the local and the remote
> cluster.
> > When you need to remove the geo-replication configuration, it will be
> hard
> > to decide which cluster should be removed on replicated tenants and
> > namespaces unless you record the cluster information.
> >
> >
> > ### Modification
> > Add `local` flag to distinguish clusters
> > ```
> > bin/pulsar-admin clusters list
> > us-west(local)
> > us-east
> > us-cent
> > ```
> >
> > PIP: https://github.com/apache/pulsar/pull/20614
> >
> >
> > Regards
> > Jiwei Guo (Tboy)
>

Re: [DISCUSS] PIP-277: Clusters list API return clusters with local flag

Posted by Zixuan Liu <no...@gmail.com>.
+1, this is a good improvement.

In the proposal, I don't suggest you append the `local` to the cluster name:

1. It will be confusing when the original cluster name includes the `local` name
2. In some cases, it is not easy to distinguish between local and
remote clusters

so I suggest we should add the `local` and `remote` flags like:

```
# list remote clusters
bin/pulsar-admin clusters list --remote
us-east
us-cent

# list local clustes
bin/pulsar-admin clusters list --local
us-west

# list all clusters
bin/pulsar-admin clusters list
us-east
us-cent
us-west
```

Thanks,
Zixuan

guo jiwei <te...@apache.org> 于2023年6月20日周二 14:00写道:
>
> Hi community:
>     After configuring the geo-replication on Pulsar clusters, the `clusters
> list` API will return multiple clusters, including the local Pulsar cluster
> and remote clusters like
>
> ```
> bin/pulsar-admin clusters list
> us-west
> us-east
> us-cent
> ```
> But in this return, you can't distinguish the local and the remote cluster.
> When you need to remove the geo-replication configuration, it will be hard
> to decide which cluster should be removed on replicated tenants and
> namespaces unless you record the cluster information.
>
>
> ### Modification
> Add `local` flag to distinguish clusters
> ```
> bin/pulsar-admin clusters list
> us-west(local)
> us-east
> us-cent
> ```
>
> PIP: https://github.com/apache/pulsar/pull/20614
>
>
> Regards
> Jiwei Guo (Tboy)