tree: f9929f1571b27b57228fe0749cee0352c67b811c [path history] [tgz]
  1. main/
  2. test/
  3. README.md
src/README.md

Pulsar manager backend

Pulsar manager backend is a supplement and improvement to Pulsar broker.

  • Handle complex query requests
  • Route requests (add, delete, update) to brokers
  • Support multi broker, dynamic change environment

Supported configurations of backend

NameDefaultDescription
server.port7750Port of backend service
pulsar-manager.accountpulsarLogin account
pulsar-manager.passwordpulsarLogin password
redirect.hostlocalhostIP address of front-end service
redirect.port9527Port of front-end service
insert.stats.interval30000msTime interval for collecting statistical information
clear.stats.interval300000msTime interval for cleaning statistics

How to set parameters when starting back-end services

./build/distributions/pulsar-manager/bin/pulsar-manager --redirect.host=http://localhost --redirect.port=9527 insert.stats.interval=600000

Use custom databases

If you have a large amount of data, you can use a custom database. The following is an example of PostgreSQL.

  1. Initialize database and table structures using file.

  2. Modify the configuration file and add PostgreSQL configuration

spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://127.0.0.1:5432/pulsar_manager
spring.datasource.username=postgres
spring.datasource.password=postgres
  1. Compile to generate a new executable jar package
./gradlew -x build -x test

Enable JWT Auth

If you want to turn on JWT authentication, configure the following parameters:

  • backend.jwt.token token for the superuser. You need to configure this parameter during cluster initialization.
  • jwt.broker.token.mode Two modes of generating token, SECRET and PRIVATE.
  • jwt.broker.public.key Configure this option if you are using the PRIVATE mode.
  • jwt.broker.private.key Configure this option if you are using the PRIVATE mode.
  • jwt.broker.secret.key Configure this option if you are using the SECRET mode.

For more information, see Apache Pulsar

  • Method 1: Use command-line tool
./build/distributions/pulsar-manager/bin/pulsar-manager --redirect.host=http://localhost --redirect.port=9527 insert.stats.interval=600000 --backend.jwt.token=token --jwt.broker.token.mode=PRIVATE --jwt.broker.private.key=file:///path/broker-private.key --jwt.broker.public.key=file:///path/broker-public.key
  • Method 2. Configure the application.properties file
backend.jwt.token=token

jwt.broker.token.mode=PRIVATE
jwt.broker.public.key=file:///path/broker-public.key
jwt.broker.private.key=file:///path/broker-private.key

or 
jwt.broker.token.mode=SECRET
jwt.broker.secret.key=file:///path/broker-secret.key
  • Method 3: Use Docker only use token.
export JWT_TOKEN="your-token"
docker run -it -p 9527:9527 -e REDIRECT_HOST=http://192.168.55.182 -e REDIRECT_PORT=9527 -e DRIVER_CLASS_NAME=org.postgresql.Driver -e URL='jdbc:postgresql://127.0.0.1:5432/pulsar_manager' -e USERNAME=pulsar -e PASSWORD=pulsar -e LOG_LEVEL=DEBUG -e JWT_TOKEN=$JWT_TOKEN -v $PWD:/data apachepulsar/pulsar-manager:v0.1.0 /bin/sh
  • Method 4: Use Docker with token, public key and private key.
export JWT_TOKEN="your-token"
export PRIVATE_KEY="file:///private-key-path"
export PUBLIC_KEY="file:///public-key-path"
docker run -it -p 9527:9527 -e REDIRECT_HOST=http://192.168.55.182 -e REDIRECT_PORT=9527 -e DRIVER_CLASS_NAME=org.postgresql.Driver -e URL='jdbc:postgresql://127.0.0.1:5432/pulsar_manager' -e USERNAME=pulsar -e PASSWORD=pulsar -e LOG_LEVEL=DEBUG -e JWT_TOKEN=$JWT_TOKEN -e PRIVATE_KEY=$PRIVATE_KEY -e PUBLIC_KEY=$PUBLIC_KEY -v $PWD:/data -v $PWD/private-key-path:/pulsar-manager/private-key-path -v $PWD/public-key-path:/pulsar-manager/public-key-path apachepulsar/pulsar-manager:v0.1.0 /bin/sh
  • Method 5: Use Docker with token, secret key.
export JWT_TOKEN="your-token"
export SECRET_KEY="file:///secret-key-path"
docker run -it -p 9527:9527 -e REDIRECT_HOST=http://192.168.55.182 -e REDIRECT_PORT=9527 -e DRIVER_CLASS_NAME=org.postgresql.Driver -e URL='jdbc:postgresql://127.0.0.1:5432/pulsar_manager' -e USERNAME=pulsar -e PASSWORD=pulsar -e LOG_LEVEL=DEBUG -e JWT_TOKEN=$JWT_TOKEN -e PRIVATE_KEY=$PRIVATE_KEY -e PUBLIC_KEY=$PUBLIC_KEY -v $PWD:/data -v $PWD/secret-key-path:/pulsar-manager/secret-key-path apachepulsar/pulsar-manager:v0.1.0 /bin/sh

Enable Github Login

Third party login options

# default empty, current options github
third.party.login.option=

Github login configuration

# The client ID you received from GitHub when you registered https://github.com/settings/applications/new.
github.client.id=your-client-id
# The client secret you received from GitHub for your GitHub App.
github.client.secret=your-client-secret
github.oauth.host=https://github.com/login/oauth/access_token
github.user.info=https://api.github.com/user
github.login.host=https://github.com/login/oauth/authorize
github.redirect.host=http://localhost:9527

# Expiration time of token for third party platform, unit second.
# 60 * 60 * 24 * 7
user.access.token.expire=604800