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

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new db695a43ebd Fix docker compose example to work with 0 errors (#441)
db695a43ebd is described below

commit db695a43ebd48089e60fbeeec870e9c0d7bba513
Author: Asaf Mesika <[email protected]>
AuthorDate: Wed Mar 22 04:11:27 2023 +0200

    Fix docker compose example to work with 0 errors (#441)
    
    * Fix docker compose to work with 0 errors
    
    * update docker compose in its new location
    
    * Removed docker compose from deploy docker
---
 docs/deploy-docker.md                  |  5 ++---
 docs/getting-started-docker-compose.md | 24 ++++++++++++++----------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/docs/deploy-docker.md b/docs/deploy-docker.md
index 147a4c215d1..3b3367162e8 100644
--- a/docs/deploy-docker.md
+++ b/docs/deploy-docker.md
@@ -14,8 +14,7 @@ To deploy a Pulsar cluster on Docker using Docker commands, 
you need to complete
 To run Pulsar on Docker, you need to create a container for each Pulsar 
component: ZooKeeper, bookie, and the broker. You can pull the images of 
ZooKeeper and bookie separately on Docker Hub, and pull the Pulsar image for 
the broker. You can also pull only one Pulsar image and create three containers 
with this image. This tutorial takes the second option as an example.
 
 You can pull a Pulsar image from Docker Hub with the following command. If you 
do not want to use some connectors, you can use `apachepulsar/pulsar:latest` 
there.
-
-```java
+```bash
 docker pull apachepulsar/pulsar-all:latest
 ```
 
@@ -81,4 +80,4 @@ Create a broker container and start the broker service.
 
 ```bash
 docker run -d -p 6650:6650 -p 8080:8080 --net=pulsar  -e 
metadataStoreUrl=zk:zookeeper:2181  -e zookeeperServers=zookeeper:2181 -e 
clusterName=cluster-a  -e managedLedgerDefaultEnsembleSize=1 -e 
managedLedgerDefaultWriteQuorum=1   -e managedLedgerDefaultAckQuorum=1 --name 
broker --hostname broker apachepulsar/pulsar-all:latest bash -c 
"bin/apply-config-from-env.py conf/broker.conf && exec bin/pulsar broker"
-```
\ No newline at end of file
+```
diff --git a/docs/getting-started-docker-compose.md 
b/docs/getting-started-docker-compose.md
index aa9c3b41967..ca3ebb82d6e 100644
--- a/docs/getting-started-docker-compose.md
+++ b/docs/getting-started-docker-compose.md
@@ -14,7 +14,7 @@ networks:
   pulsar:
     driver: bridge
 services:
-# Start zookeeper
+  # Start zookeeper
   zookeeper:
     image: apachepulsar/pulsar:latest
     container_name: zookeeper
@@ -25,6 +25,7 @@ services:
       - ./data/zookeeper:/pulsar/data/zookeeper
     environment:
       - metadataStoreUrl=zk:zookeeper:2181
+      - PULSAR_MEM=-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m
     command: >
       bash -c "bin/apply-config-from-env.py conf/zookeeper.conf && \
              bin/generate-zookeeper-config.sh conf/zookeeper.conf && \
@@ -35,7 +36,7 @@ services:
       timeout: 5s
       retries: 30
 
-# Init cluster metadata
+  # Init cluster metadata
   pulsar-init:
     container_name: pulsar-init
     hostname: pulsar-init
@@ -53,7 +54,7 @@ services:
       zookeeper:
         condition: service_healthy
 
-# Start bookie
+  # Start bookie
   bookie:
     image: apachepulsar/pulsar:latest
     container_name: bookie
@@ -64,18 +65,21 @@ services:
       - clusterName=cluster-a
       - zkServers=zookeeper:2181
       - metadataServiceUri=metadata-store:zk:zookeeper:2181
+      # otherwise every time we run docker compose uo or down we fail to start 
due to Cookie
+      # See: 
https://github.com/apache/bookkeeper/blob/405e72acf42bb1104296447ea8840d805094c787/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java#L57-68
+      - advertisedAddress=bookie
+      - BOOKIE_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
     depends_on:
       zookeeper:
         condition: service_healthy
       pulsar-init:
         condition: service_completed_successfully
-  # Map the local directory to the container to avoid bookie startup failure 
due to insufficient container disks.
+    # Map the local directory to the container to avoid bookie startup failure 
due to insufficient container disks.
     volumes:
       - ./data/bookkeeper:/pulsar/data/bookkeeper
-    command: bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf
-      && exec bin/pulsar bookie"
+    command: bash -c "bin/apply-config-from-env.py conf/bookkeeper.conf && 
exec bin/pulsar bookie"
 
-# Start broker
+  # Start broker
   broker:
     image: apachepulsar/pulsar:latest
     container_name: broker
@@ -92,6 +96,7 @@ services:
       - managedLedgerDefaultAckQuorum=1
       - advertisedAddress=broker
       - advertisedListeners=external:pulsar://127.0.0.1:6650
+      - PULSAR_MEM=-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m
     depends_on:
       zookeeper:
         condition: service_healthy
@@ -100,8 +105,7 @@ services:
     ports:
       - "6650:6650"
       - "8080:8080"
-    command: bash -c "bin/apply-config-from-env.py conf/broker.conf
-      &&  exec bin/pulsar broker"
+    command: bash -c "bin/apply-config-from-env.py conf/broker.conf && exec 
bin/pulsar broker"
 ```
 
 ## Create a Pulsar cluster
@@ -116,4 +120,4 @@ If you want to destroy the Pulsar cluster with all the 
containers, run the follo
 
 ```bash
 docker compose down
-```
\ No newline at end of file
+```

Reply via email to