Skip to content

Commit

Permalink
[website]Add content of pulsar-manager in website(include release not…
Browse files Browse the repository at this point in the history
…es, download link) (apache#5741)

### Motivation

As a sub-project of the pulsar, pulsar-manager should update relevant content on the website after the first release is completed, so as to facilitate users' use.

### Modifications

* Add pulsar-manager release notes page
* Add pulsar-manager download page
* Add a document in sidebar

### Verifying this change

yarn build pass
  • Loading branch information
tuteng authored and jiazhai committed Nov 29, 2019
1 parent d9c2b8b commit e4fc609
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 0 deletions.
132 changes: 132 additions & 0 deletions site2/docs/administration-pulsar-manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
---
id: administration-pulsar-manager
title: Pulsar Manager
sidebar_label: Pulsar Manager
---

Pulsar Manager is a web-based GUI management and monitoring tool that helps administrators and users manage and monitor tenants, namespaces, topics, subscriptions, brokers, clusters, and so on, and supports dynamic configuration of multiple environments.

## Install

The easiest way to use the Pulsar Manager is to run it inside a [Docker](https://www.docker.com/products/docker) container.


```
docker pull apachepulsar/pulsar-manager:v0.1.0
docker run -it -p 9527:9527 -e REDIRECT_HOST=http://192.168.0.104 -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 -v $PWD:/data apachepulsar/pulsar-manager:v0.1.0 /bin/sh
```

* REDIRECT_HOST: the IP address of the front-end server.

* REDIRECT_PORT: the port of the front-end server.

* DRIVER_CLASS_NAME: the driver class name of PostgreSQL.

* URL: the URL of PostgreSQL JDBC, For example, `jdbc:postgresql://127.0.0.1:5432/pulsar_manager`.

* USERNAME: the username of PostgreSQL.

* PASSWORD: the password of PostgreSQL.

* LOG_LEVEL: level of log.

You can find the in the [Docker](https://github.com/apache/pulsar-manager/tree/master/docker) directory and build an image from scratch as well:

```
git clone https://github.com/apache/pulsar-manager
cd pulsar-manager
./gradlew build -x test
cd front-end
npm install --save
npm run build:prod
cd ..
docker build -f docker/Dockerfile --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` --build-arg VCS_REF=`latest` --build-arg VERSION=`latest` -t apachepulsar/pulsar-manager .
```

### 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 the [file](https://github.com/apache/pulsar-manager/tree/master/src/main/resources/META-INF/sql/postgresql-schema.sql).

2. Modify the [configuration file](https://github.com/apache/pulsar-manager/blob/master/src/main/resources/application.properties) 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
```

3. Compile to generate a new executable jar package.

```
./gradlew -x build -x test
```

### Enable JWT authentication

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 [Token Authentication Admin of Pulsar](http://pulsar.apache.org/docs/en/security-token-admin/).


If you want to enable JWT authentication, use one of the following methods.


* 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 and turn on token authentication.

```
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 and turn on **token authentication** and **token management** by private key and public 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 and turn on **token authentication** and **token management** by 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
```

* For more information about backend configurations, see [here](https://github.com/apache/pulsar-manager/blob/8b1f26f7d7c725e6d056c41b98235fbc5deb9f49/src/README.md).
* For more information about frontend configurations, see [here](https://github.com/apache/pulsar-manager/blob/master/front-end/README.md).

## Log in

Visit http://localhost:9527 to log in.
56 changes: 56 additions & 0 deletions site2/website/pages/en/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const translate = require('../../server/translate.js').translate;

const siteConfig = require(`${CWD}/siteConfig.js`);
const releases = require(`${CWD}/releases.json`);
const pulsarManagerReleases = require(`${CWD}/pulsar-manager-release.json`)
const connectors = require(`${CWD}/data/connectors.js`);

function getLatestArchiveMirrorUrl(version, type) {
Expand Down Expand Up @@ -45,13 +46,26 @@ function connectorDownloadUrl(name, version) {
return `https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-${version}/connectors/pulsar-io-${name}-${version}.nar`
}

function getLatestPulsarManagerArchiveMirrorUrl(version, type) {
return `https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-manager/apache-pulsar-manager-${version}-${type}.tar.gz`
}

function pulsarManagerDistUrl(version, type) {
return `https://www.apache.org/dist/pulsar/pulsar-manager/pulsar-manager-${version}/apache-pulsar-manager-${version}-${type}.tar.gz`
}

class Download extends React.Component {
render() {
const latestVersion = releases[0];
const latestPulsarManagerVersion = pulsarManagerReleases[0];
const latestArchiveMirrorUrl = getLatestArchiveMirrorUrl(latestVersion, 'bin');
const latestSrcArchiveMirrorUrl = getLatestArchiveMirrorUrl(latestVersion, 'src');
const latestPulsarManagerArchiveMirrorUrl = getLatestPulsarManagerArchiveMirrorUrl(latestPulsarManagerVersion, 'bin');
const latestPulsarManagerSrcArchiveMirrorUrl = getLatestPulsarManagerArchiveMirrorUrl(latestPulsarManagerVersion, 'src');
const latestArchiveUrl = distUrl(latestVersion, 'bin');
const latestSrcArchiveUrl = distUrl(latestVersion, 'src')
const pulsarManagerLatestArchiveUrl = pulsarManagerDistUrl(latestPulsarManagerVersion, 'bin');
const pulsarManagerLatestSrcArchiveUrl = pulsarManagerDistUrl(latestPulsarManagerVersion, 'src');

const releaseInfo = releases.map(version => {
return {
Expand Down Expand Up @@ -256,6 +270,48 @@ class Download extends React.Component {
)}
</tbody>
</table>
<header className="postHeader">
<h1><translate>Apache Pulsar Manager downloads</translate></h1>
<hr />
</header>
<h2><translate>Release notes</translate></h2>
<div>
<p>
<a href={`${siteConfig.baseUrl}${this.props.language}/pulsar-manager-release-notes`}>Release notes</a> for all pulsar-manager's versions
</p>
</div>
<h2 id="latest"><translate>Current version (Stable)</translate> {latestPulsarManagerVersion}</h2>
<table className="versions" style={{width:'100%'}}>
<thead>
<tr>
<th><translate>Release</translate></th>
<th><translate>Link</translate></th>
<th><translate>Crypto files</translate></th>
</tr>
</thead>
<tbody>
<tr key={'binary'}>
<th><translate>Binary</translate></th>
<td>
<a href={latestPulsarManagerArchiveMirrorUrl}>apache-pulsar-manager-{latestPulsarManagerVersion}-bin.tar.gz</a>
</td>
<td>
<a href={`${pulsarManagerLatestArchiveUrl}.asc`}>asc</a>,&nbsp;
<a href={`${pulsarManagerLatestArchiveUrl}.sha512`}>sha512</a>
</td>
</tr>
<tr key={'source'}>
<th><translate>Source</translate></th>
<td>
<a href={latestPulsarManagerSrcArchiveMirrorUrl}>apache-pulsar-manager-{latestPulsarManagerVersion}-src.tar.gz</a>
</td>
<td>
<a href={`${pulsarManagerLatestSrcArchiveUrl}.asc`}>asc</a>,&nbsp;
<a href={`${pulsarManagerLatestSrcArchiveUrl}.sha512`}>sha512</a>
</td>
</tr>
</tbody>
</table>
</div>
</Container>
</div>
Expand Down
35 changes: 35 additions & 0 deletions site2/website/pages/en/pulsar-manager-release-notes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const React = require('react');

const CompLibrary = require('../../core/CompLibrary');
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;

const CWD = process.cwd();

const siteConfig = require(`${CWD}/siteConfig.js`);

const releaseNotes = require('fs').readFileSync(`${CWD}/pulsar-manager-release-notes.md`, 'utf8')

class ReleaseNotes extends React.Component {
render() {

return (
<div className="pageContainer">
<Container className="mainContainer documentContainer postContainer">
<div className="post">
<header className="postHeader">
<h1>Apache Pulsar Manager Release Notes</h1>
<hr />
</header>
<MarkdownBlock>
{releaseNotes}
</MarkdownBlock>
</div>
</Container>
</div>
);
}
}

module.exports = ReleaseNotes;
19 changes: 19 additions & 0 deletions site2/website/pulsar-manager-release-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Apache Pulsar Manager

### 0.1.0 &mdash; 2019-11-25 <a id="0.1.0"></a>

#### Fixes

* Remove streamnative from the project [#213](https://github.com/apache/pulsar-manager/pull/213)
* Add license file for pulsar-manager [#209](https://github.com/apache/pulsar-manager/pull/209)
* Support management of jwt for pulsar-manager [#205](https://github.com/apache/pulsar-manager/pull/205)
* Support redirect.scheme [#204](https://github.com/apache/pulsar-manager/pull/204)
* Fix reset cursor by time [#179](https://github.com/apache/pulsar-manager/pull/179)
* Fix wrong broker display error [#187](https://github.com/apache/pulsar-manager/pull/187)
* Remove dependency package jszip [#189](https://github.com/apache/pulsar-manager/pull/189)
* Add developer guide [#186](https://github.com/apache/pulsar-manager/pull/186)
* Keep table and column name fields lowercase [#190](https://github.com/apache/pulsar-manager/pull/190)
* Fix loggin level [#191](https://github.com/apache/pulsar-manager/pull/191)
* Fix wrong place for license scan badge [#193](https://github.com/apache/pulsar-manager/pull/193)
* Add support for HerdDB database [#183](https://github.com/apache/pulsar-manager/pull/183)
* Make default environment persistent [#197](https://github.com/apache/pulsar-manager/pull/197)
3 changes: 3 additions & 0 deletions site2/website/pulsar-manager-release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"0.1.0"
]
1 change: 1 addition & 0 deletions site2/website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"administration-zk-bk",
"administration-geo",
"administration-dashboard",
"administration-pulsar-manager",
"administration-stats",
"administration-load-balance",
"administration-proxy",
Expand Down

0 comments on commit e4fc609

Please sign in to comment.