You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by li...@apache.org on 2022/06/17 07:24:49 UTC

[pulsar] branch master updated: [improve][doc] Add docs for how to change Pulsar configs in Docker (#16085)

This is an automated email from the ASF dual-hosted git repository.

liuyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new 3db46c3054e [improve][doc] Add docs for how to change Pulsar configs in Docker  (#16085)
3db46c3054e is described below

commit 3db46c3054eb00b713c0618a60b4c489c882fcb9
Author: momo-jun <60...@users.noreply.github.com>
AuthorDate: Fri Jun 17 15:24:42 2022 +0800

    [improve][doc] Add docs for how to change Pulsar configs in Docker  (#16085)
---
 site2/docs/getting-started-docker.md               | 43 +++++++++++++---------
 .../version-2.10.0/getting-started-docker.md       | 43 +++++++++++++---------
 2 files changed, 50 insertions(+), 36 deletions(-)

diff --git a/site2/docs/getting-started-docker.md b/site2/docs/getting-started-docker.md
index c0723a61f25..bd0bc529d96 100644
--- a/site2/docs/getting-started-docker.md
+++ b/site2/docs/getting-started-docker.md
@@ -10,21 +10,31 @@ If you have not installed Docker, download the [Community edition](https://www.d
 
 ## Start Pulsar in Docker
 
-* For MacOS, Linux, and Windows:
+For macOS, Linux, and Windows, run the following command to start Pulsar within a Docker container.
 
-  ```shell
+```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
   
-  ```
+```
+
+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.
+
+```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"
 
-A few things to note about this command:
- * The data, metadata, and configuration are persisted on Docker volumes in order to not start "fresh" every 
-time the container is restarted. For details on the volumes you can use `docker volume inspect <sourcename>`
- * For Docker on Windows make sure to configure it to use Linux containers
- * The docker container will run as UID 10000 and GID 0, by default. You'll 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).
+```
+
+:::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).
+* The data, metadata, and configuration are persisted on Docker volumes in order to not start "fresh" every time the container is restarted. For details on the volumes, you can use `docker volume inspect <sourcename>`.
+* For Docker on Windows, make sure to configure it to use Linux containers.
+
+:::
 
-If you start Pulsar successfully, you will see `INFO`-level log messages like this:
+After starting Pulsar successfully, you can see `INFO`-level log messages like this:
 
 ```
 
@@ -43,15 +53,13 @@ When you start a local standalone cluster, a `public/default` namespace is creat
 
 ## Use Pulsar in Docker
 
-Pulsar offers client libraries for [Java](client-libraries-java.md), [Go](client-libraries-go.md), [Python](client-libraries-python) 
-and [C++](client-libraries-cpp). If you're running a local standalone cluster, you can
-use one of these root URLs to interact with your cluster:
+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). 
 
+If you're running a local standalone cluster, you can use one of these root URLs to interact with your cluster:
 * `pulsar://localhost:6650`
 * `http://localhost:8080`
 
-The following example will guide you get started with Pulsar quickly by using the [Python client API](client-libraries-python)
-client API.
+The following example guides you to get started with Pulsar by using the [Python client API](client-libraries-python.md) client API.
 
 Install the Pulsar Python client library directly from [PyPI](https://pypi.org/project/pulsar-client/):
 
@@ -84,7 +92,7 @@ client.close()
 
 ### Produce a message
 
-Now start a producer to send some test messages:
+Start a producer to send some test messages:
 
 ```python
 
@@ -102,8 +110,7 @@ client.close()
 
 ## Get the topic statistics
 
-In Pulsar, you can use REST, Java, or command-line tools to control every aspect of the system.
-For details on APIs, refer to [Admin API Overview](admin-api-overview).
+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).
 
 In the simplest example, you can use curl to probe the stats for a particular topic:
 
diff --git a/site2/website/versioned_docs/version-2.10.0/getting-started-docker.md b/site2/website/versioned_docs/version-2.10.0/getting-started-docker.md
index 3719463d23b..441a7b89727 100644
--- a/site2/website/versioned_docs/version-2.10.0/getting-started-docker.md
+++ b/site2/website/versioned_docs/version-2.10.0/getting-started-docker.md
@@ -11,21 +11,31 @@ If you have not installed Docker, download the [Community edition](https://www.d
 
 ## Start Pulsar in Docker
 
-* For MacOS, Linux, and Windows:
+For macOS, Linux, and Windows, run the following command to start Pulsar within a Docker container.
 
-  ```shell
+```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
   
-  ```
+```
+
+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.
+
+```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"
 
-A few things to note about this command:
- * The data, metadata, and configuration are persisted on Docker volumes in order to not start "fresh" every 
-time the container is restarted. For details on the volumes you can use `docker volume inspect <sourcename>`
- * For Docker on Windows make sure to configure it to use Linux containers
- * The docker container will run as UID 10000 and GID 0, by default. You'll 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).
+```
+
+:::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).
+* The data, metadata, and configuration are persisted on Docker volumes in order to not start "fresh" every time the container is restarted. For details on the volumes, you can use `docker volume inspect <sourcename>`.
+* For Docker on Windows, make sure to configure it to use Linux containers.
+
+:::
 
-If you start Pulsar successfully, you will see `INFO`-level log messages like this:
+After starting Pulsar successfully, you can see `INFO`-level log messages like this:
 
 ```
 
@@ -44,15 +54,13 @@ When you start a local standalone cluster, a `public/default` namespace is creat
 
 ## Use Pulsar in Docker
 
-Pulsar offers client libraries for [Java](client-libraries-java.md), [Go](client-libraries-go.md), [Python](client-libraries-python) 
-and [C++](client-libraries-cpp). If you're running a local standalone cluster, you can
-use one of these root URLs to interact with your cluster:
+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). 
 
+If you're running a local standalone cluster, you can use one of these root URLs to interact with your cluster:
 * `pulsar://localhost:6650`
 * `http://localhost:8080`
 
-The following example will guide you get started with Pulsar quickly by using the [Python client API](client-libraries-python)
-client API.
+The following example guides you to get started with Pulsar by using the [Python client API](client-libraries-python.md) client API.
 
 Install the Pulsar Python client library directly from [PyPI](https://pypi.org/project/pulsar-client/):
 
@@ -85,7 +93,7 @@ client.close()
 
 ### Produce a message
 
-Now start a producer to send some test messages:
+Start a producer to send some test messages:
 
 ```python
 
@@ -103,8 +111,7 @@ client.close()
 
 ## Get the topic statistics
 
-In Pulsar, you can use REST, Java, or command-line tools to control every aspect of the system.
-For details on APIs, refer to [Admin API Overview](admin-api-overview).
+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).
 
 In the simplest example, you can use curl to probe the stats for a particular topic: