Let's assume we have 3 regions: [a
, b
, c
]
We want to start Pulsar standalone in each region and setup geo-replication between them, without involving the deployment of a global-zookeeper instance.
In each machine, configure the standalone to use a specific cluster name:
in conf/standalone.conf
edit:
clusterName=a
with the right cluster name for each region
Start the standalone:
bin/pulsar standalone
Each standalone needs to know where are the other located.
For example, for cluster a
we need to let him know where b
and c
are.
bin/pulsar-admin clusters create b --url pulsar://${IP_B}:6650
bin/pulsar-admin clusters create c --url pulsar://${IP_C}:6650
In region b
, similarly:
bin/pulsar-admin clusters create a --url pulsar://${IP_A}:6650
bin/pulsar-admin clusters create c --url pulsar://${IP_C}:6650
and so on.
We need now to create a namespace and configure so that data will be replicated across the 3 regions.
Since we don't have global-zookeeper, we need to run the following commands on each region:
# Create a tenant that is allowed to use these 3 clusters
bin/pulsar-admin properties create my-tenant \
--admin-roles test --allowed-clusters a,b,c
# Create namespace
bin/pulsar-admin namespaces create my-tenant/global/my-namespace
# Configure replication
bin/pulsar-admin namespaces set-clusters \
my-tenant/global/my-namespace --clusters a,b,c