Pulsar 仪表板是一个网页应用程序,使用户能够以表格形式监测所有 主题 的实时状态。

Dashboard 是一个数据收集器,可以从单个 Pulsar 实例(跨多个集群)的所有 broker 中轮询统计信息,并将信息存储在 PostgreSQL 数据库中。

A Django web app is used to render the collected data.

安装

使用dashboard的最简单方法是在 Docker 容器中运行它。 A Dockerfile to generate the image is provided.

生成Docker镜像:

  1. $ docker build -t apachepulsar/pulsar-dashboard dashboard

运行dashboard:

  1. $ SERVICE_URL=http://broker.example.com:8080/
  2. $ docker run -p 80:80 \
  3. -e SERVICE_URL=$SERVICE_URL \
  4. apachepulsar/pulsar-dashboard

If token authentication is enabled:

Provided token should have super-user access.

  1. $ SERVICE_URL=http://broker.example.com:8080/
  2. $ JWT_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
  3. $ docker run -p 80:80 \
  4. -e SERVICE_URL=$SERVICE_URL \
  5. -e JWT_TOKEN=$JWT_TOKEN \
  6. apachepulsar/pulsar-dashboard

You need to specify only one service URL for a Pulsar cluster. Internally, the collector will figure out all the existing clusters and the brokers from where it needs to pull the metrics. If you’re connecting the dashboard to Pulsar running in standalone mode, the URL will be http://<broker-ip>:8080 by default. <broker-ip> is the ip address or hostname of the machine running Pulsar standalone. The ip address or hostname should be accessible from the docker instance running dashboard.

Once the Docker container is running, the web dashboard will be accessible via localhost or whichever host is being used by Docker.

dashboard所使用的brokerSERVICE_URL 必须可以在Docker容器内进行访问.

If the Pulsar service is running in standalone mode in localhost, the SERVICE_URL would have to be the IP of the machine.

Similarly, given the Pulsar standalone advertises itself with localhost by default, we need to explicitely set the advertise address to the host IP. 例如:

  1. $ bin/pulsar standalone --advertised-address 1.2.3.4

已知问题

Only Pulsar Token authentication is supported as of now.