pulsarctl context use
command.
pulsarconfig
.pulsarctl
command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one fully-managed Pulsar cluster on StreamNative Cloud, spin a self-managed StreamNative Private Cloud cluster, or run a standalone Pulsar cluster locally.
To check that pulsarctl
is installed, run pulsarctl --version
.
development
cluster is self-managed in your own datacenter, using Token authentication, while the production
cluster is fully-managed on StreamNative Cloud, using OAuth2 authentication.
Now, you can use pulsarctl context set
to define your clusters and the corresponding authentication information.
First, you can create a development
context to access your development cluster running at https://1.2.3.4
using token stored in file /path/to/token
.
production
context to access your production cluster running at https://5.6.7.8
on StreamNative Cloud using the OAuth2 private key file /path/to/credentials.json
.
snctl x update-pulsar-config
to add the cluster to the pulsarconfig file.Please note that x
in snctl x
is a sub command for a group of experimental commands.pulsarctl context get
to retrieve the list of available contexts configured for pulsarctl
. You should be able to see similar output as below.
${HOME}/.config/pulsar/config
. Run the following command to check the context of pulsarconfig file.
${HOME}/.config/pulsar/config
, you can quickly switch between clusters by using the following command (suppose you want to use the development cluster):
development
cluster. And you can validate the current context by using pulsarctl context current
command.
If you don’t know the current available list of contexts, you can use the following command: