Waltz

Waltz

  • Docs

›Administration

Design

  • Introduction
  • Terminology and Components
  • Application Programming Model
  • Client-Server Communication
  • Server-Storage Communication
  • On-Disk Data Structures
  • Concurrency Control (Optimistic Locking)
  • Back Pressure
  • Waltz Client
  • Waltz Server
  • Waltz Storage

Administration

  • Waltz Setup

Waltz Setup

Dependency

  • ZooKeeper

Things to decide before setup

  • the cluster name
  • the cluster root path (the path to the znode that represents the cluster)
  • the number of partitions
  • the number of replicas
  • the placement of storage nodes (zone/region) ** the size of disks (persistent disks in which storage nodes store data)

Creating a Waltz Cluster

There are 3 steps to setup a Waltz cluster.

(Note: The cli_config_path file should contain information about other config parameters such as "zookeeper.connectString", "cluster.root", "zookeeper.sessionTimeout" and ssl config prefix i.e. "ssl." (wherever required).

Step 1: Use create command to create a cluster

waltz_uber=/path/to/waltz-uber-X.Y.Z.jar
java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    create \
    --name ${cluster_name?} \
    --partitions ${partition_count?} \
    --cli-config-path ${cli_config_path?}

Step 2: Use add-storage-node command to add storage node(s)

java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    add-storage-node \
    --storage ${storage_node?} \
    --group ${group?} \
    --cli-config-path ${cli_config_path?}

where group is meant to represent a collection of storage nodes that should contain a complete replica of the data. This is meant to map to a region; for example, group="us-central"

Step 3: Use auto-assign command to assign partitions to storage node(s) in group (with Round Robin)

java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    auto-assign \
    --group ${group?} \
    --cli-config-path ${cli_config_path?}

At this point, start up only the storage nodes.

Step 4: Use add-partition command to assign partitions to storage node(s) based on what was assigned in ZooKeeper:

java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.storage.StorageCli \
    add-partition \
    --partition ${partition?} \
    --storage ${storage_node?} \
    --cli-config-path ${cli_config_path?}

The SSL config should be specified in cli_config_path file. The storage parameter should point to the storage node's admin port.

You will need to do this for every single replica assignment on every storage node. To get a list of replica assignments, you can run the list command to dump server metadata from ZooKeeper.

java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    list \
    --cli-config-path ${cli_config_path?}

Once all replicas have been added to all storage nodes, you can start the Waltz servers. Running the list command again should show the servers now.

To manually assign a partition to storage node(s), you can use assign-partition command.

java ${waltz_uber+-cp ${waltz_uber}} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    assign-partition \
    --partition ${partition?} \
    --storage ${storage_node?} \
    --cli-config-path ${cli_config_path?}

To manually un-assign a partition from storage node(s), you can use unassign-partition command.

java ${waltz_uber+-cp $waltz_uber} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    unassign-partition \
    --partition ${partition?} \
    --storage ${storage_node?} \
    --cli-config-path ${cli_config_path?}

To remove a storage node from cluster, you can use remove-storage-node command.

java ${waltz_uber+-cp $waltz_uber} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    remove-storage-node \
    --storage ${storage_node?} \
    --cli-config-path ${cli_config_path?}

To delete server metadata, you can use delete command.

java ${waltz_uber+-cp $waltz_uber} \
    com.wepay.waltz.tools.zk.ZooKeeperCli \
    delete \
    --name ${cluster_name?} \
    --force \ # force delete even if cluster name don't match
    --cli-config-path ${cli_config_path?}

Configuration Parameters

Waltz uses YAML for configuration files. Configuration parameters have the form of dot-delimited names. When assigning a value "V" to a parameter "A.B.C", all of the following YAML is valid.

A.B.C: V
A.B:
  C: V
A:
  B.C: V
A:
  B:
    C: V

Configuring WaltzServer

Minimum Configuration Parameters

The following is the minimum required configuration parameters.

Parameter NameDescriptionDefault Value
zookeeper.connectStringzookeeper connect string
zookeeper.sessionTimeoutzookeeper session timeout
cluster.rootcluster root path in Zookeeper
server.portserver port number

Parameters for Metrics

This setting enables the following endpoints.

  • /ping
  • /buildinfo
  • /metrics
  • /health
Parameter NameDescriptionDefault Value
server.jetty.portserver jetty port number

Security Configuration Parameters

It is strongly recommended to set security configuration parameters in production.

Configuration parameters for the client-server communication

Parameter NameDescriptionDefault Value
server.ssl.keyStore.locationkey store location path
server.ssl.keyStore.passwordkey store password
server.ssl.keyStore.typekey store typeJKS
server.ssl.trustStore.locationtrust store location path
server.ssl.trustStore.passwordtrust store password
server.ssl.trustStore.typetrust store typeJKS
server.ssl.keyManager.algorithmalgorithm used when creating a KeyManagerFactorySunX509
server.ssl.trustManager.algorithmalgorithm used when creating a TrustManagerFactorySunX509

Configuration parameters for the server-storage communication

Parameter NameDescriptionDefault Value
storage.ssl.keyStore.locationkey store location path
storage.ssl.keyStore.passwordkey store password
storage.ssl.keyStore.typekey store typeJKS
storage.ssl.trustStore.locationtrust store location path
storage.ssl.trustStore.passwordtrust store password
storage.ssl.trustStore.typetrust store typeJKS
storage.ssl.keyManager.algorithmalgorithm used when creating a KeyManagerFactorySunX509
storage.ssl.trustManager.algorithmalgorithm used when creating a TrustManagerFactorySunX509

More Server Configuration Parameters

See com.wepay.waltz.server.WaltzServerConfig for more configuration parameters.

Starting a WaltzServer instance

java -cp waltz-uber-X.Y.Z.jar com.wepay.waltz.server.WaltzServer <config file path>

Configuring Waltz Storage Server

Create a property file as a configuration file.

Minimum Configuration Parameters

The following is the minimum required configuration parameters.

Parameter NameDescriptionDefault Value
storage.portstorage port number
storage.adminstorage admin port number
storage.directorypath to data directory
storage.segment.size.thresholdThreshold of segment size (a new segment is created when a segment size exceed this value)1000000000
zookeeper.connectStringZookeeper connect string
zookeeper.sessionTimeoutZookeeper connect timeout
cluster.rootcluster root path in Zookeeper

Parameters for Metrics

This setting enables the following endpoints.

  • /ping
  • /buildinfo
  • /metrics
  • /health
Parameter NameDescriptionDefault Value
storage.jetty.portstorage jetty port number

Security Configuration Parameters

It is strongly recommended to set security configuration parameters in production.

Configuration parameters for the server-storage communication

Parameter NameDescriptionDefault Value
storage.ssl.keyStore.locationkey store location path
storage.ssl.keyStore.passwordkey store password
storage.ssl.keyStore.typekey store typeJKS
storage.ssl.trustStore.locationtrust store location path
storage.ssl.trustStore.passwordtrust store password
storage.ssl.trustStore.typetrust store typeJKS
storage.ssl.keyManager.algorithmalgorithm used when creating a KeyManagerFactorySunX509
storage.ssl.trustManager.algorithmalgorithm used when creating a TrustManagerFactorySunX509

Starting a WaltzStorage instance

java -cp waltz-uber-X.Y.Z.jar com.wepay.waltz.storage.WaltzStorage <config file path>

Configuring WaltzClient

Typically Waltz client is configured programatically using java.util.Properties and com.wepay.waltz.client.WaltzClientConfig. WaltzClientConfig defines symbols for configuration parameters.

Map<Object, Object> config = new HashMap<>();
config.put(WaltzClientConfig.ZOOKEEPER_CONNECT_STRING, "zkserve1:2181,zkserver2:2181,zkserver3:2181");
config.put(WaltzClientConfig.ZOOKEEPER_SESSION_TIMEOUT, "30000");
config.put(WaltzClientConfig.CLUSTER_ROOT, "/test/cluster");
...
WaltzClient client = new WaltzClient(callback, new WaltzClientConfig(config));

Minimum Configuration Parameters

The following is the minimum required configuration parameters.

Parameter NameDescriptionDefault Value
zookeeper.connectStringzookeeper connect string
zookeeper.sessionTimeoutzookeeper session timeout
cluster.rootcluster root path in Zookeeper

Security Configuration Parameters

It is strongly recommended to set security configuration parameters in production.

Configuration parameters for the client-server communication

Parameter NameDescriptionDefault Value
client.ssl.keyStore.locationkey store location path
client.ssl.keyStore.passwordkey store password
client.ssl.keyStore.typekey store typeJKS
client.ssl.trustStore.locationtrust store location path
client.ssl.trustStore.passwordtrust store password
client.ssl.trustStore.typetrust store typeJKS
client.ssl.keyManager.algorithmalgorithm used when creating a KeyManagerFactorySunX509
client.ssl.trustManager.algorithmalgorithm used when creating a TrustManagerFactorySunX509

Other Configuration Parameters

Parameter NameDescriptionDefault Value
client.numTransactionRetryThreadsnumber of threads used for retries of transactions1
← Waltz Storage
  • Dependency
  • Things to decide before setup
  • Creating a Waltz Cluster
  • Configuration Parameters
  • Configuring WaltzServer
    • Minimum Configuration Parameters
    • Parameters for Metrics
    • Security Configuration Parameters
    • More Server Configuration Parameters
  • Starting a WaltzServer instance
  • Configuring Waltz Storage Server
    • Minimum Configuration Parameters
    • Parameters for Metrics
  • Security Configuration Parameters
    • Configuration parameters for the server-storage communication
  • Starting a WaltzStorage instance
  • Configuring WaltzClient
    • Minimum Configuration Parameters
    • Security Configuration Parameters
    • Other Configuration Parameters
Waltz
Docs
DesignAdministrationAPI Reference
Community
Stack OverflowTwitter
More
BlogGitHub
Copyright © 2019 WePay Inc.