32
tools/pulsar/docker/README.adoc
Normal file
32
tools/pulsar/docker/README.adoc
Normal file
@@ -0,0 +1,32 @@
|
||||
== Docker scripts for Pulsar
|
||||
|
||||
=== Pulsar Standalone
|
||||
Runs a local standalone Pulsar cluster in Docker.
|
||||
|
||||
* The broker is available at `pulsar://localhost:6650`.
|
||||
* The admin is available at `http://localhost:8080`
|
||||
* Two Docker volumes (`pulsardata`, `pulsarconf`) are created to store the data, metadata, and configuration in order to not start "fresh" every time the container is restarted.
|
||||
|
||||
|
||||
==== Start
|
||||
To start the cluster run the following script from project root dir:
|
||||
[source,shell]
|
||||
----
|
||||
./tools/pulsar/docker/standalone/pulsar-start.sh
|
||||
----
|
||||
|
||||
==== Stop
|
||||
To stop the cluster run the following script from project root dir:
|
||||
[source,shell]
|
||||
----
|
||||
./tools/pulsar/docker/standalone/pulsar-stop.sh
|
||||
----
|
||||
|
||||
==== Destroy
|
||||
To completely remove the cluster and volumes run the following script from project root dir:
|
||||
[source,shell]
|
||||
----
|
||||
./tools/pulsar/docker/standalone/pulsar-destroy.sh
|
||||
----
|
||||
|
||||
More information can be found in the official https://pulsar.apache.org/docs/next/getting-started-docker[Pulsar docs].
|
||||
7
tools/pulsar/docker/standalone/pulsar-destroy.sh
Executable file
7
tools/pulsar/docker/standalone/pulsar-destroy.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Finding and removing Pulsar container..."
|
||||
docker ps -a | grep "apachepulsar/pulsar" | awk '{print $1}' | xargs docker rm -f
|
||||
echo "Removing Pulsar volumes..."
|
||||
docker volume rm pulsardata pulsarconf
|
||||
echo "All traces of Pulsar standalone removed"
|
||||
7
tools/pulsar/docker/standalone/pulsar-start.sh
Executable file
7
tools/pulsar/docker/standalone/pulsar-start.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker run -it -p 6650:6650 -p 8080:8080 \
|
||||
--mount source=pulsardata,target=/pulsar/data \
|
||||
--mount source=pulsarconf,target=/pulsar/conf \
|
||||
apachepulsar/pulsar:2.10.1 \
|
||||
bin/pulsar standalone
|
||||
5
tools/pulsar/docker/standalone/pulsar-stop.sh
Executable file
5
tools/pulsar/docker/standalone/pulsar-stop.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Finding and stopping Pulsar container..."
|
||||
docker ps -a | grep "apachepulsar/pulsar" | awk '{print $1}' | xargs docker stop
|
||||
echo "Container stopped - you can run 'pulsar-start.sh' when/if you want to restart it"
|
||||
Reference in New Issue
Block a user