Pulsar常用命令记录

简介: Pulsar常用命令记录

记录工作学习中常用到的Pulsar命令。

持续更新中… …

一、日常常用

  1. 删除Topic
bin/pulsar-admin topics delete  persistent://public/xxx命名空间/xxxTopic名称
  1. 创建Topic
bin/pulsar-admin topics create persistent://public/xxx命名空间/xxxTopic名称
  1. 查看Topic
bin/pulsar-admin topics stats persistent://public/xxx命名空间/xxxTopic名称
  1. 查看Topic内部状态
bin/pulsar-admin topics stats-internal persistent://public/xxx命名空间/xxxTopic名称
  1. 删除Topic下的订阅
bin/pulsar-admin topics unsubscribe -s "订阅名称" persistent://public/xxx命名空间/xxxTopic名称
  1. 清空Topic
bin/pulsar-admin topics truncate persistent://public/xxx命名空间/xxxTopic名称

Truncate a topic. The truncate operation will move all cursors to

the end of the topic and delete all inactive ledgers. Usage: truncate

persistent://tenant/namespace/topic

这条命令还没有试验过… …

二、项目常用

  1. 查看pulsar broker zookeeper bookkeeper进程
ps -eaf | grep pulsar

如果 broker、zookeeper、bookkeeper进程正常,则集群正常

  1. 查看集群存活的bookkeeper
bin/bookkeeper shell listbookies -readwrite
  1. 启动bookkeeper进程
bin/pulsar-daemon start bookie
  1. 测试生产10条消息
bin/pulsar-client produce persistent://public/default/test -n 10  -m "hello pulsar" 
  1. 测试消费10条消息
bin/pulsar-client consume persistent://public/default/test -n 10 -s "consumer-test" 


相关文章
|
10月前
|
消息中间件 Java Linux
聊聊 Pulsar: 在 Linux 环境上搭建 Pulsar
聊聊 Pulsar: 在 Linux 环境上搭建 Pulsar
341 0
|
存储 消息中间件 监控
Pulsar 介绍与部署
Pulsar 介绍与部署
4035 0
Pulsar 介绍与部署
|
4天前
|
负载均衡 API Apache
pulsar需要记录偏移量吗
【6月更文挑战第27天】pulsar需要记录偏移量吗
5 0
|
2月前
|
存储 缓存 Unix
sar命令详解
`sar`是Linux性能分析工具,用于收集和报告CPU使用率、内存、磁盘I/O、网络和进程活动等系统性能数据。基本语法:`sar [options] [interval] [count]`。例如,`sar -u 5`每5秒显示CPU使用情况。`-A`显示所有报告,`-o file`将结果保存到文件。要使用`sar`,需先安装`sysstat`包。不同发行版支持的选项可能有差异,建议查阅手册页。
29 2
|
11月前
Pulsar常用命令记录
Pulsar常用命令记录
|
缓存 Linux
Linux基础命令---sar显示系统活动信息
sar      sar指令用来收集、报告、保存系统的活动信息。sar命令将操作系统中选定的累积活动计数器的内容写入标准输出。会计系统根据参数“interval”、“count”中的值,写入以秒为单位的指定间隔的指定次数的信息。
1081 0