|
| 1 | +--- |
| 2 | +title: Global Cluster Setup |
| 3 | + |
| 4 | +top-nav-group: deployment |
| 5 | +top-nav-pos: 1 |
| 6 | +top-nav-title: Global Cluster Setup |
| 7 | + |
| 8 | +# Sub-level navigation |
| 9 | +sub-nav-group: admin-guide |
| 10 | +sub-nav-id: cluster-deployment |
| 11 | +sub-nav-parent: admin-guide |
| 12 | +sub-nav-group-title: Global Cluster Setup |
| 13 | +sub-nav-pos: 1 |
| 14 | +sub-nav-title: Global Cluster Setup |
| 15 | + |
| 16 | +layout: default |
| 17 | +--- |
| 18 | + |
| 19 | +.. contents:: This page provides instructions on how to run **DistributedLog** across multiple regions. |
| 20 | + |
| 21 | + |
| 22 | +Cluster Setup & Deployment |
| 23 | +========================== |
| 24 | + |
| 25 | +Setting up `globally replicated DistributedLog <../user_guide/globalreplicatedlog/main>`_ is very similar to setting up local DistributedLog. |
| 26 | +The most important change is use a ZooKeeper cluster configured across multiple-regions. Once set up, DistributedLog |
| 27 | +and BookKeeper are configured to use the global ZK cluster for all metadata storage, and the system will more or |
| 28 | +less work. The remaining steps are necessary to ensure things like durability in the face of total region failure. |
| 29 | + |
| 30 | +The key differences with standard cluster setup are summarized below: |
| 31 | + |
| 32 | +- The zookeeper cluster must be running across all of the target regions, say A, B, C. |
| 33 | + |
| 34 | +- Region aware placement policy and a few other options must be configured in DL config. |
| 35 | + |
| 36 | +- DistributedLog clients should be configured to talk to all regions. |
| 37 | + |
| 38 | +We elaborate on these steps in the following sections. |
| 39 | + |
| 40 | + |
| 41 | +Global Zookeeper |
| 42 | +---------------- |
| 43 | + |
| 44 | +When defining your server and participant lists in zookeeper configuration, a sufficient number of nodes from each |
| 45 | +region must be included. |
| 46 | + |
| 47 | +Please consult the ZooKeeper documentation for detailed Zookeeper setup instructions. |
| 48 | + |
| 49 | + |
| 50 | +DistributedLog Configuration |
| 51 | +---------------------------- |
| 52 | + |
| 53 | +In multi-region DistributedLog several DL config changes are needed. |
| 54 | + |
| 55 | +Placement Policy |
| 56 | +++++++++++++++++ |
| 57 | + |
| 58 | +The region-aware placement policy must be configured. Below, it is configured to place replicas across 3 regions, A, B, and C. |
| 59 | + |
| 60 | +:: |
| 61 | + |
| 62 | + # placement policy |
| 63 | + bkc.ensemblePlacementPolicy=org.apache.bookkeeper.client.RegionAwareEnsemblePlacementPolicy |
| 64 | + bkc.reppRegionsToWrite=A;B;C |
| 65 | + bkc.reppMinimumRegionsForDurability=2 |
| 66 | + bkc.reppEnableDurabilityEnforcementInReplace=true |
| 67 | + bkc.reppEnableValidation=true |
| 68 | + |
| 69 | +Connection Timeouts |
| 70 | ++++++++++++++++++++ |
| 71 | + |
| 72 | +In global replicated mode, the proxy nodes will be writing to the entire ensemble, which exists in multiple regions. |
| 73 | +If cross-region latency is higher than local region latency (i.e. if its truly cross-region) then it is advisable to |
| 74 | +use a higher BookKeeper client connection tiemout. |
| 75 | + |
| 76 | +:: |
| 77 | + |
| 78 | + # setting connect timeout to 1 second for global cluster |
| 79 | + bkc.connectTimeoutMillis=1000 |
| 80 | + |
| 81 | +Quorum Size |
| 82 | ++++++++++++ |
| 83 | + |
| 84 | +It is advisable to run with a larger ensemble to ensure cluster health in the event of region loss (the ensemble |
| 85 | +will be split across all regions). |
| 86 | + |
| 87 | +The values of these settings will depend on your operational and durability requirements. |
| 88 | + |
| 89 | +:: |
| 90 | + |
| 91 | + ensemble-size=9 |
| 92 | + write-quorum-size=9 |
| 93 | + ack-quorum-size=5 |
| 94 | + |
| 95 | +Client Configuration |
| 96 | +-------------------- |
| 97 | + |
| 98 | +Although not required, it is recommended to configure the write client to use all available regions. Several methods |
| 99 | +in DistributedLogClientBuilder can be used to achieve this. |
| 100 | + |
| 101 | +.. code-block:: java |
| 102 | +
|
| 103 | + DistributedLogClientBuilder.serverSets |
| 104 | + DistributedLogClientBuilder.finagleNameStrs |
| 105 | +
|
| 106 | +
|
| 107 | +Additional Steps |
| 108 | +================ |
| 109 | + |
| 110 | +Other clients settings may need to be tuned - for example in the write client, timeouts will likely need to be |
| 111 | +increased. |
| 112 | + |
| 113 | +Aside from this however, cluster setup is exactly the same as `single region setup <cluster>`_. |
0 commit comments