A CLI tool for the Apache Pulsar project.
Use homebrew to install pulsarctl
on the Mac operation system.
brew tap streamnative/streamnative
brew install pulsarctl
Use this command to install pulsarctl
on the Linux operation system.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/streamnative/pulsarctl/master/install.sh)"
To install pulsarctl
on the Windows operation system, follow these steps:
- Download the package from here.
- Add the
pulsarctl
directory to your system PATH. - Type
pulsarctl -h
at CMD to verify thatpulsarctl
is work.
Use go get
to install the pulsarctl
as dependency on your project:
# Using master branch
go get github.com/streamnative/pulsarctl@master
# Or using v2.10.1.3 tag
go get github.com/streamnative/[email protected]
# Or using v2.9.3.3 tag
go get github.com/streamnative/[email protected]
Note: We will not release v0.y.z
tags, so you need to specify the branch or tag.
-
Go 1.11 +
If you have not installed Go, install it according to the installation instruction.
Since the
go mod
package management tool is used in this project, Go 1.11 or higher version is required.
-
Download codes.
-
Clone the project from GitHub to your local.
git clone https://github.com/streamnative/pulsarctl.git
-
Use
go mod
to get the dependencies needed for the project.go mod download
After entering the
go mod download
command, if some libs can not be downloaded, then you can download them by referring to the proxy provided by GOPROXY.io.
-
-
Build pulsarctl
make pulsarctl
If you want to print version of
pulsarctl
, you can use follow commands:bin/pulsarctl --version
Output:
Release Version: v2.8.0.3 Git Commit Hash: add1e586e8d56fcc1cbd2fe94ed75b10d6c54672 Git Branch: HEAD UTC Build Time: 2021-06-26 06:39:16 Go Version: go version go1.16.3 darwin/amd64
If you want to enable autocompletion in shell, see enable_completion.
If you want to cache information of multiple clusters, and can switch between multiple clusters, see How to use pulsarctl context.
The following is an incomplete list of features that are not yet implemented:
- localrun
- localrun
- available-sources
- reload
- localrun
- available-sources
- reload
- extract
- delete-bookie-affinity-group
- get-bookie-affinity-group
- set-bookie-affinity-group
- racks-placement
- get-bookie-rack
- delete-bookie-rack
- set-bookie-rack
We move the subscription commands from the topics to the subscriptions in pulsarctl.
pulsar-admin | pulsarctl |
---|---|
bin/pulsar-admin topics create-subscription | pulsarctl subscription create |
bin/pulsar-admin topics unsubscribe | pulsarctl subscription delete |
bin/pulsar-admin topics skip | pulsarctl subscription skip |
bin/pulsar-admin topics expire-messages | pulsarctl subscription expire |
bin/pulsar-admin topics peek-messages | pulsarctl subscription peek |
bin/pulsar-admin topics reset-cursor | pulsarctl subscription seek |
bin/pulsar-admin topics subscriptions | pulsarctl subscription list |
Contributions are welcomed and greatly appreciated. For more information about how to submit a patch and the contribution workflow, see CONTRIBUTING.md.
Licensed under the Apache License Version 2.0: http://www.apache.org/licenses/LICENSE-2.0