Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sijie/63737459112471a82957ae20bd78adb5 to your computer and use it in GitHub Desktop.
Save sijie/63737459112471a82957ae20bd78adb5 to your computer and use it in GitHub Desktop.
Docker compose file to start 3 pulsar clusters without a global configuration store
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
## original file could be find here: https://github.com/apache/pulsar/tree/master/tests/compose/multi
version: '2.1'
networks:
pulsar:
driver: bridge
services:
## instances for Beijing
zk-beijing:
hostname: zk-beijing
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk-beijing
networks:
pulsar:
init-beijing:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: beijing
zkServers: zk-beijing
configurationStore: zk-beijing
pulsarNode: broker-beijing
networks:
pulsar:
bk-beijing:
hostname: bk-beijing
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: beijing
zkServers: zk-beijing
networks:
pulsar:
broker-beijing:
hostname: broker-beijing
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: beijing
zookeeperServers: zk-beijing
configurationStoreServers: zk-beijing
managedLedgerDefaultEnsembleSize: 1
managedLedgerDefaultWriteQuorum: 1
managedLedgerDefaultAckQuorum: 1
networks:
pulsar:
## instances for Shanghai
zk-shanghai:
hostname: zk-shanghai
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk-shanghai
networks:
pulsar:
init-shanghai:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: shanghai
zkServers: zk-shanghai
configurationStore: zk-shanghai
pulsarNode: broker-shanghai
networks:
pulsar:
bk-shanghai:
hostname: bk-shanghai
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: shanghai
zkServers: zk-shanghai
networks:
pulsar:
broker-shanghai:
hostname: broker-shanghai
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: shanghai
zookeeperServers: zk-shanghai
configurationStoreServers: zk-shanghai
managedLedgerDefaultEnsembleSize: 1
managedLedgerDefaultWriteQuorum: 1
managedLedgerDefaultAckQuorum: 1
networks:
pulsar:
## instances for Guangzhou
zk-guangzhou:
hostname: zk-guangzhou
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk-guangzhou
networks:
pulsar:
init-guangzhou:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: guangzhou
zkServers: zk-guangzhou
configurationStore: zk-guangzhou
pulsarNode: broker-guangzhou
networks:
pulsar:
bk-guangzhou:
hostname: bk-guangzhou
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: guangzhou
zkServers: zk-guangzhou
networks:
pulsar:
broker-guangzhou:
hostname: broker-guangzhou
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: guangzhou
zookeeperServers: zk-guangzhou
configurationStoreServers: zk-guangzhou
managedLedgerDefaultEnsembleSize: 1
managedLedgerDefaultWriteQuorum: 1
managedLedgerDefaultAckQuorum: 1
networks:
pulsar:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment