Skip to content

Commit

Permalink
Docker compose files for setting up pulsar cluster (apache#1134)
Browse files Browse the repository at this point in the history
This patch contains docker compose configuration files to quickly
bring up a pulsar cluster locally.
  • Loading branch information
ivankelly authored and sijie committed Jul 26, 2018
1 parent 56affb9 commit 4fcbe5e
Show file tree
Hide file tree
Showing 3 changed files with 262 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This are docker compose files to quickly bring up a pulsar
cluster. They use the pulsar testing docker image. To generate this,
run ```mvn install -DskipTests -Pdocker``` in the top-level directory
of the project.

To run, change directory into multi or simple, and run:
```
docker-compose up
```
167 changes: 167 additions & 0 deletions tests/compose/multi/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
#
# 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.
#

version: '2.1'
networks:
pulsar:
driver: bridge

services:
conf-eu:
hostname: conf-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-global-zk.sh
environment:
ZOOKEEPER_SERVERS: conf-eu,conf-us
networks:
pulsar:

zk-eu:
hostname: zk-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk-eu
networks:
pulsar:

init-eu:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: eu
zkServers: zk-eu
configurationStore: conf-eu:2184,conf-us:2184
pulsarNode: pulsar1-eu
networks:
pulsar:

bk1-eu:
hostname: bk1-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: eu
zkServers: zk-eu
networks:
pulsar:

bk2-eu:
hostname: bk2-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: eu
zkServers: zk-eu
networks:
pulsar:

pulsar1-eu:
hostname: pulsar1-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: eu
zookeeperServers: zk-eu
configurationStoreServers: conf-eu:2184
networks:
pulsar:

proxy-eu:
hostname: proxy-eu
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-proxy.sh
environment:
clusterName: eu
zookeeperServers: zk-eu
configurationStoreServers: conf-eu:2184
networks:
pulsar:

conf-us:
hostname: conf-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-global-zk.sh
environment:
ZOOKEEPER_SERVERS: conf-eu,conf-us
networks:
pulsar:

zk-us:
hostname: zk-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk-us
networks:
pulsar:

init-us:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: us
zkServers: zk-us
configurationStore: conf-eu:2184,conf-us:2184
pulsarNode: pulsar1-us
networks:
pulsar:

bk1-us:
hostname: bk1-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: us
zkServers: zk-us
networks:
pulsar:

bk2-us:
hostname: bk2-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: us
zkServers: zk-us
networks:
pulsar:

pulsar1-us:
hostname: pulsar1-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: us
zookeeperServers: zk-us
configurationStoreServers: conf-us:2184
networks:
pulsar:

proxy-us:
hostname: proxy-us
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-proxy.sh
environment:
clusterName: us
zookeeperServers: zk-us
configurationStoreServers: conf-us:2184
networks:
pulsar:

86 changes: 86 additions & 0 deletions tests/compose/simple/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#
# 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.
#

version: '2.1'
networks:
pulsar:
driver: bridge

services:
zk:
hostname: zk
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-local-zk.sh
environment:
ZOOKEEPER_SERVERS: zk
networks:
pulsar:

init:
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/init-cluster.sh
environment:
clusterName: test
zkServers: zk
configurationStore: zk:2181
pulsarNode: pulsar1
networks:
pulsar:

bk1:
hostname: bk1
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: test
zkServers: zk
networks:
pulsar:

bk2:
hostname: bk2
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: test
zkServers: zk
networks:
pulsar:

bk3:
hostname: bk3
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-bookie.sh
environment:
clusterName: test
zkServers: zk
networks:
pulsar:

pulsar1:
hostname: pulsar1
image: apachepulsar/pulsar-test-latest-version:latest
command: bin/run-broker.sh
environment:
clusterName: test
zookeeperServers: zk
configurationStoreServers: zk:2181
networks:
pulsar:

0 comments on commit 4fcbe5e

Please sign in to comment.