producer.newMessage()
.deliverAt(new Date(2019, 06, 27, 23, 00, 00)
.getTime())
.value("Hello Pulsar at 11pm on 06/27/2019!")
.send();
producer.newMessage()
.deliverAfter(3L, TimeUnit.Minute)
.value("Hello Pulsar after 3 minutes!")
.send();
This doc demonstrates how to do geo-replication across multiple pulsar clusters without a global configuration store (zookeeper).
This demo is using docker-compose to start 3 pulsar clusters. Each pulsar cluster has 1 zk, 1 bk, and 1 broker. The docker compose file can be found at https://gist.github.com/sijie/63737459112471a82957ae20bd78adb5.
The information of all the three clusters is listed in the following table:
zk | configuration store | broker | |
---|---|---|---|
beijing | zk-beijing | zk-beijing | broker-beijing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |
- Create a directory
certs
. - Generated the TLS keys under
certs
directory. - Run the docker command.
docker run \
-p 6650:6650 -p 8080:8080 \
-p 8081:8081 -p 6651:6651 \
-p 8443:8443 \
-v $PWD/certs:/certs \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Follow the [instructions](http://pulsar.apache.org/docs/en/administration-dashboard/) to start the pulsar admin dashboard. | |
2. Create super user | |
1. ssh to the dashboard docker container: `docker exec -it <docker-id> bash` | |
2. go to `/pulsar/django` directory in the docker container: `cd /pulsar/django` | |
3. run python manage.py to create a superuser: `python manage.py createsuperuser --username admin` | |
4. once the superuser is created, you can go to [http://localhost/admin](http://localhost/admin) to login. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my global config | |
global: | |
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. | |
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. | |
# scrape_timeout is set to the global default (10s). | |
# Attach these labels to any time series or alerts when communicating with | |
# external systems (federation, remote storage, Alertmanager). | |
external_labels: | |
monitor: 'codelab-monitor' |