Skip to content

Commit

Permalink
[improve][doc] SEO for "About" and "Get Started" (#664)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuobiao-zhou authored Aug 9, 2023
1 parent 0406887 commit 8a21f79
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 22 deletions.
1 change: 1 addition & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ slug: /
id: about
title: Welcome to the Apache Pulsar documentation portal
sidebar_label: "About"
description: Explore the Apache Pulsar documentation and join the knowledgeable Pulsar community.
---

import BlockLinks from "@site/src/components/ui/BlockLinks";
Expand Down
9 changes: 7 additions & 2 deletions docs/getting-started-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
id: getting-started-docker-compose
title: Run a Pulsar cluster locally with Docker Compose
sidebar_label: "Run Pulsar locally with Docker Compose"
description: Get started with Apache Pulsar on your local machine using Docker Compose.
---

## Configure the `compose.yml` template
To run Pulsar loccally with Docker Compose, follow the steps below.

## Step 1: Configure the `compose.yml` template

To get up and run a Pulsar cluster quickly, you can use the following template to create a `compose.yml` file by modifying or adding the configurations in the **environment** section.

Expand Down Expand Up @@ -108,14 +111,16 @@ services:
command: bash -c "bin/apply-config-from-env.py conf/broker.conf && exec bin/pulsar broker"
```
## Create a Pulsar cluster
## Step 2: Create a Pulsar cluster
To create a Pulsar cluster by using the `compose.yml` file, run the following command.

```bash
docker compose up -d
```

## Step 3: Destroy the Pulsar cluster

If you want to destroy the Pulsar cluster with all the containers, run the following command. It will also delete the network that the containers are connected to.

```bash
Expand Down
87 changes: 82 additions & 5 deletions docs/getting-started-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,103 @@
id: getting-started-docker
title: Run a standalone Pulsar cluster in Docker
sidebar_label: "Run Pulsar in Docker"
description: Get started with Apache Pulsar on your local machine using Docker.
---

````mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
````

For local development and testing, you can run Pulsar in standalone mode on your own machine within a Docker container.

If you have not installed Docker, download it following [the instructions](https://docs.docker.com/get-docker/) for your OS.

## Start Pulsar in Docker
To run Pulsar in Docker, follow the steps below.

## Step1: Start Pulsar in Docker

For macOS, Linux, and Windows, run the following command to start Pulsar within a Docker container.

````mdx-code-block
<Tabs groupId="os-choice"
defaultValue="macOS & Linux"
values={[{"label":"macOS & Linux","value":"macOS & Linux"},{"label":"Windows","value":"Windows"}]}>
<TabItem value="macOS & Linux">
```shell
-p 6650:6650 \
-p 8080:8080 \
--mount source=pulsardata,target=/pulsar/data \
--mount source=pulsarconf,target=/pulsar/conf \
apachepulsar/pulsar:@pulsar:version@ \
bin/pulsar standalone
```
</TabItem>
<TabItem value="Windows">
```shell
docker run -it -p 6650:6650 -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:@pulsar:version@ bin/pulsar standalone
docker run -it ^
-p 6650:6650 ^
-p 8080:8080 ^
--mount source=pulsardata,target=/pulsar/data ^
--mount source=pulsarconf,target=/pulsar/conf ^
apachepulsar/pulsar:@pulsar:version@ ^
bin/pulsar standalone
```
</TabItem>
</Tabs>
````

If you want to change Pulsar configurations and start Pulsar, run the following command by passing environment variables with the `PULSAR_PREFIX_` prefix. See [default configuration file](https://github.com/apache/pulsar/blob/e6b12c64b043903eb5ff2dc5186fe8030f157cfc/conf/standalone.conf) for more details.

````mdx-code-block
<Tabs groupId="os-choice"
defaultValue="macOS & Linux"
values={[{"label":"macOS & Linux","value":"macOS & Linux"},{"label":"Windows","value":"Windows"}]}>
<TabItem value="macOS & Linux">
```shell
docker run -it \
-e PULSAR_PREFIX_xxx=yyy \
-p 6650:6650 \
-p 8080:8080 \
--mount source=pulsardata,target=/pulsar/data \
--mount source=pulsarconf,target=/pulsar/conf \
apachepulsar/pulsar:2.10.0 sh \
-c "bin/apply-config-from-env.py \
conf/standalone.conf && \
bin/pulsar standalone"
```
</TabItem>
<TabItem value="Windows">
```shell
docker run -it -e PULSAR_PREFIX_xxx=yyy -p 6650:6650 -p 8080:8080 --mount source=pulsardata,target=/pulsar/data --mount source=pulsarconf,target=/pulsar/conf apachepulsar/pulsar:2.10.0 sh -c "bin/apply-config-from-env.py conf/standalone.conf && bin/pulsar standalone"
docker run -it ^
-e PULSAR_PREFIX_xxx=yyy ^
-p 6650:6650 ^
-p 8080:8080 ^
--mount source=pulsardata,target=/pulsar/data ^
--mount source=pulsarconf,target=/pulsar/conf ^
apachepulsar/pulsar:2.10.0 sh ^
-c "bin/apply-config-from-env.py ^
conf/standalone.conf && ^
bin/pulsar standalone"
```
</TabItem>
</Tabs>
````

:::tip

* The docker container runs as UID 10000 and GID 0 by default. You need to ensure the mounted volumes give write permission to either UID 10000 or GID 0. Note that UID 10000 is arbitrary, so it is recommended to make these mounts writable for the root group (GID 0).
Expand All @@ -46,7 +123,7 @@ After starting Pulsar successfully, you can see `INFO`-level log messages like t

:::

## Use Pulsar in Docker
## Step 2: Use Pulsar in Docker

Pulsar offers a variety of [client libraries](client-libraries.md), such as [Java](client-libraries-java.md), [Go](client-libraries-go.md), [Python](client-libraries-python.md), [C++](client-libraries-cpp.md).

Expand Down Expand Up @@ -96,7 +173,7 @@ for i in range(10):
client.close()
```

## Get the topic statistics
## Step 3: Get the topic statistics

In Pulsar, you can use REST API, Java, or command-line tools to control every aspect of the system. For details on APIs, refer to [Admin API Overview](admin-api-overview.md).

Expand Down
11 changes: 4 additions & 7 deletions docs/getting-started-helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@
id: getting-started-helm
title: Run a standalone Pulsar cluster in Kubernetes
sidebar_label: "Run Pulsar in Kubernetes"
description: Get started with Apache Pulsar on your local machine using Kubernetes.
---

This section guides you through every step of installing and running Apache Pulsar with Helm on Kubernetes quickly, including the following sections:

- Install the Apache Pulsar on Kubernetes using Helm
- Start and stop Apache Pulsar
- Create topics using `pulsar-admin`
- Produce and consume messages using Pulsar clients
- Monitor Apache Pulsar status with Prometheus and Grafana
This section guides you through every step of installing and running Apache Pulsar with Helm on Kubernetes quickly.

For deploying a Pulsar cluster for production usage, read the documentation on [how to configure and install a Pulsar Helm chart](helm-deploy.md).

Expand All @@ -26,6 +21,8 @@ For the following steps, step 2 and step 3 are for **developers** and step 4 and

:::

To run Pulsar with Helm on Kubernetes, follow the steps below.

## Step 0: Prepare a Kubernetes cluster

Before installing a Pulsar Helm chart, you have to create a Kubernetes cluster. You can follow [the instructions](helm-prepare.md) to prepare a Kubernetes cluster.
Expand Down
19 changes: 11 additions & 8 deletions docs/getting-started-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
id: getting-started-standalone
title: Run a standalone Pulsar cluster locally
sidebar_label: "Run Pulsar locally"
description: Get started with Apache Pulsar on your local machine.
---

For local development and testing, you can run Pulsar in standalone mode on your machine. The standalone mode runs all components inside a single Java Virtual Machine (JVM) process.
Expand All @@ -12,11 +13,13 @@ If you're looking to run a full production Pulsar installation, see the [Deployi

:::

## Prerequisites
To run Pulsar in standalone mode on your machine, follow the steps below.

## Step 0: Prerequisites

- JRE (64-bit). Different Pulsar versions rely on different JRE versions. For how to choose the JRE version, see [Pulsar Runtime Java Version Recommendation](https://github.com/apache/pulsar/blob/master/README.md#pulsar-runtime-java-version-recommendation).

## Download Pulsar distribution
## Step 1: Download Pulsar distribution

Download the official Apache Pulsar distribution:

Expand Down Expand Up @@ -52,7 +55,7 @@ The following directories are created:
| **examples** | [Pulsar Functions](functions-overview.md) examples |
| **instances** | Artifacts for [Pulsar Functions](functions-overview.md) |

## Start a Pulsar standalone cluster
## Step 2: Start a Pulsar standalone cluster

Run this command to start a standalone Pulsar cluster:

Expand All @@ -74,7 +77,7 @@ When the Pulsar cluster starts, the following directories are created:

:::

## Create a topic
## Step 3: Create a topic

Pulsar stores messages in topics. It's a good practice to explicitly create topics before using them, even if Pulsar can automatically create topics when they are referenced.

Expand All @@ -84,7 +87,7 @@ To create a new topic, run this command:
bin/pulsar-admin topics create persistent://public/default/my-topic
```

## Write messages to the topic
## Step 4: Write messages to the topic

You can use the `pulsar` command line tool to write messages to a topic. This is useful for experimentation, but in practice you'll use the Producer API in your application code, or Pulsar IO connectors for pulling data in from other systems to Pulsar.

Expand All @@ -94,7 +97,7 @@ Run this command to produce a message:
bin/pulsar-client produce my-topic --messages 'Hello Pulsar!'
```

## Read messages from the topic
## Step 5: Read messages from the topic

Now that some messages have been written to the topic, run this command to launch the consumer and read those messages back:

Expand All @@ -113,7 +116,7 @@ You'll see the messages you produce in the previous step:
key:[null], properties:[], content:Hello Pulsar!
```

## Write some more messages
## Step 6: Write some more messages

Leave the consume command from the previous step running. If you've already closed it, just re-run it.

Expand All @@ -125,7 +128,7 @@ bin/pulsar-client produce my-topic --messages "$(seq -s, -f 'Message NO.%g' 1 10

Note how they are displayed almost instantaneously in the consumer terminal.

## Stop the Pulsar cluster
## Step 7: Stop the Pulsar cluster

Once you've finished you can shut down the Pulsar cluster. Press **Ctrl-C** in the terminal window in which you started the cluster.

Expand Down

0 comments on commit 8a21f79

Please sign in to comment.