This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Zookeeper to Zookeeper

Synchronize Zookeeper data between two clusters

1 - Introduction

Synchronize Zookeeper data between clusters

You can synchronize Zookeeper data between two clusters using the Zookeeper protocol.

Supported models

One time synchronization

You can synchronize the data just once with the Synchronization Kubernetes object.

Periodic synchronization

You can synchronize periodically the SynchronizationPlan Kubernetes object.

Samples

Synchronize once

Synchronize the data once only in the /test path:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  generateName: synchronize-zookeeper-
spec:
  plugin: zookeeper-to-zookeeper-nodes
  config:
    sourceName: zookeeper-source
    destinationName: zookeeper-destination
    rootPath: /test
    createRoutePath: true

Scheduled synchronization

Synchronize data every hour in the /test path:

apiVersion: automation.astronetes.io/v1alpha1
kind: SynchronizationPlan
metadata:
  name: synchronize-zookeeper
spec:
  schedule: "0 * * * *"
  template:
    spec:
      plugin: zookeeper-to-zookeeper-nodes
      config: 
        sourceName: zookeeper-source
        destinationName: zookeeper-destination
        rootPath: /test

2 - Configuration

Plugin parameters and accepted values

Required configuration

Source and destination

The source and the destination clusters can be specified using the .spec.config.sourceName and .spec.config.destinationName properties. Both Database objects should exists in the same Namespace where the synchronization is being created.

Example:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  name: example
spec:
  plugin: zookeeper-nodes-to-zookeeper
  config:
    sourceName: cluster-1
    destinationName: cluster-2
    ...

Root path

The root path to be used to only synchronize a specific part of the Zookeeper database.

Example:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  name: example
spec:
  plugin: zookeeper-nodes-to-zookeeper
  config:
    ...
    rootPath: /test

Optional configuration

Create root path

Create the Root Path in the destination database if it doesn’t exist.

Example:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  name: example
spec:
  plugin: zookeeper-nodes-to-zookeeper
  config:
    ...
    createRootPath: true

Ignore ephemeral

Don’t synchronize ephemeral data in the destination cluster..

Example:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  name: example
spec:
  plugin: zookeeper-nodes-to-zookeeper
  config:
    ...
    ignoreEphemeral: true

Exclude paths

Exclude data from being synchronized to the destination cluster filtering on path using regex.

Example:

apiVersion: automation.astronetes.io/v1alpha1
kind: Synchronization
metadata:
  name: example
spec:
  plugin: zookeeper-nodes-to-zookeeper
  config:
    ...
    excludeRegex: ..

3 - API Reference

Configuration details

Config

Configuration for Zookeeper to Zookeeper synchronization

NameDescriptionTypeRequired
sourceNameZookeeper instance acting as sourcestringyes
destinationNameZookeeper instance acting as destinationstringyes
rootPathRoot Path of the contents to synchronizestringyes
createRootPathWhether to create the Root Path in the destination databasebooleanno
ignoreEphemeralWhether to ignore ephemeralbooleanno
excludePathRegexpRegular expression for keys to exclude while synchronizingstringno