From e4fc60981625d77fb00e137ab5a154aeed9a63f1 Mon Sep 17 00:00:00 2001 From: tuteng Date: Fri, 29 Nov 2019 18:56:08 +0800 Subject: [PATCH] [website]Add content of pulsar-manager in website(include release notes, download link) (#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 --- site2/docs/administration-pulsar-manager.md | 132 ++++++++++++++++++ site2/website/pages/en/download.js | 56 ++++++++ .../pages/en/pulsar-manager-release-notes.js | 35 +++++ site2/website/pulsar-manager-release-notes.md | 19 +++ site2/website/pulsar-manager-release.json | 3 + site2/website/sidebars.json | 1 + 6 files changed, 246 insertions(+) create mode 100644 site2/docs/administration-pulsar-manager.md create mode 100644 site2/website/pages/en/pulsar-manager-release-notes.js create mode 100644 site2/website/pulsar-manager-release-notes.md create mode 100644 site2/website/pulsar-manager-release.json diff --git a/site2/docs/administration-pulsar-manager.md b/site2/docs/administration-pulsar-manager.md new file mode 100644 index 0000000000000..af89091b4a5dd --- /dev/null +++ b/site2/docs/administration-pulsar-manager.md @@ -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. diff --git a/site2/website/pages/en/download.js b/site2/website/pages/en/download.js index 4ad16735aa9d8..8922084a88dfa 100644 --- a/site2/website/pages/en/download.js +++ b/site2/website/pages/en/download.js @@ -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) { @@ -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 { @@ -256,6 +270,48 @@ class Download extends React.Component { )} +
+

Apache Pulsar Manager downloads

+
+
+

Release notes

+
+

+ Release notes for all pulsar-manager's versions +

+
+

Current version (Stable) {latestPulsarManagerVersion}

+ + + + + + + + + + + + + + + + + + + + +
ReleaseLinkCrypto files
Binary + apache-pulsar-manager-{latestPulsarManagerVersion}-bin.tar.gz + + asc,  + sha512 +
Source + apache-pulsar-manager-{latestPulsarManagerVersion}-src.tar.gz + + asc,  + sha512 +
diff --git a/site2/website/pages/en/pulsar-manager-release-notes.js b/site2/website/pages/en/pulsar-manager-release-notes.js new file mode 100644 index 0000000000000..89eb0ca73ee13 --- /dev/null +++ b/site2/website/pages/en/pulsar-manager-release-notes.js @@ -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 ( +
+ +
+
+

Apache Pulsar Manager Release Notes

+
+
+ + {releaseNotes} + +
+
+
+ ); + } +} + +module.exports = ReleaseNotes; diff --git a/site2/website/pulsar-manager-release-notes.md b/site2/website/pulsar-manager-release-notes.md new file mode 100644 index 0000000000000..4fb9c45a42729 --- /dev/null +++ b/site2/website/pulsar-manager-release-notes.md @@ -0,0 +1,19 @@ +## Apache Pulsar Manager + +### 0.1.0 — 2019-11-25 + +#### 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) \ No newline at end of file diff --git a/site2/website/pulsar-manager-release.json b/site2/website/pulsar-manager-release.json new file mode 100644 index 0000000000000..7b999c75006de --- /dev/null +++ b/site2/website/pulsar-manager-release.json @@ -0,0 +1,3 @@ +[ + "0.1.0" +] diff --git a/site2/website/sidebars.json b/site2/website/sidebars.json index 583ce70d659cc..6206ff1af7716 100644 --- a/site2/website/sidebars.json +++ b/site2/website/sidebars.json @@ -65,6 +65,7 @@ "administration-zk-bk", "administration-geo", "administration-dashboard", + "administration-pulsar-manager", "administration-stats", "administration-load-balance", "administration-proxy",