Curator RPC Proxy / Configuration

Configuration

Introduction

Curator RPC uses Dropwizard for configuration. You can write the configuration in JSON or YAML. It can be passed to Curator RPC via a file or directly on the command line. i.e.

# via command line
java -jar curator-x-rpc-VERSION.jar '{"thrift":{"port": 8080}}'
# via file
java -jar curator-x-rpc-VERSION.jar path/to/config.json

Example

Here is an example JSON configuration file

{
    "projectionExpiration": "15s",

    "thrift": {
        "port": 1234
    },

    "pingTime": "10s",

    "logging": {
        "level": "INFO",

        "appenders": [
            {
                "type": "file",
                "currentLogFilename": "logs/curator-rpc.log",
                "archivedLogFilenamePattern": "logs/curator-rpc-%d.log.gz",
                "archivedFileCount": 10,
                "timeZone": "UTC"
            },

            {
                "type": "console"
            }
        ]
    },

    "connections": [
        {
            "name": "main",
            "connectionString": "one:1,two:2",
            "sessionLength": "3m",
            "connectionTimeout": "20s",
            "retry": {
                "type": "exponential-backoff",
                "baseSleepTime": "1s",
                "maxRetries": 10
            }
        },

        {
            "name": "alt",
            "connectionString": "three:3,four:4",
            "sessionLength": "4m",
            "connectionTimeout": "30s",
            "retry": {
                "type": "ntimes",
                "sleepBetweenRetries": "1m",
                "n": 10
            }
        }
    ]
}

Main

Name Type Default Value Description
thrift Thrift n/a Thrift server configuration
logging Logging n/a log file configuration
projectionExpiration Duration 3 minutes Curator Projection instances will be automatically closed if not accessed within this amount of time
pingTime Duration 5 seconds The EventService will return a PING event if this time elapses without some other event being generated
connections List of Connection n/a List of ZooKeeper connections

Duration

Durations are strings that specify a time duration. Examples:

  • "10s" - 10 seconds
  • "100ms" - 100 milliseconds
  • "3h" - 3 hours

Thrift

Name Type Default Value Required Description
port int none Y port to listen on.
bindAddress string "localhost" - Address for server to bind to
idleConnectionTimeout int 60 seconds - timeout period between receiving requests from a client connection. If the timeout is exceeded (no complete requests have arrived from the client within the timeout), the server will disconnect the idle client.
transportName string "framed" - the name of the transport (frame codec) that this server will handle. The available options by default are 'unframed', 'buffered', and 'framed'. Additional modules may install other options.
protocolName string "binary" - name of the protocol that this server will speak. The available options by default are 'binary' and 'compact'. Additional modules may install other options.

Logging

Dropwizard's logging module is used. See the Dropwizard Logging Doc for details on specifying the logging configuration.

Connection

Name Type Default Value Required Description
name string none Y Unique name for the connection.
connectionString string none Y ZooKeeper connection string (e.g. "host1:2181,host2:2181").
sessionLength Duration 1 minute - duration for the ZooKeeper session
connectionTimeout Duration 15 seconds - duration for connecting
retry Retry an exponential-backoff policy - The Retry Policy to use
authorization Authorization null - Authorization spec

Retry

The retry policy configuration depends on what type is used. There are three types supported:

Name Type Default Value Description
type string n/a exponential-backoff
baseSleepTime Duration 100 milliseconds The base sleep time
maxRetries int 3 The max retries
_ _ _ _
type string n/a bounded-exponential-backoff
baseSleepTime Duration 100 milliseconds The base sleep time
maxSleepTime Duration 30 seconds The max sleep time
maxRetries int 3 The max retries
_ _ _ _
type string n/a ntimes
sleepBetweenRetries int 100 milliseconds sleep time between retries
n int 3 the number of retries

Authorization

Name Type Description
scheme string the authorization scheme
auth string the authorization auth