Git Product home page Git Product logo

docker-zk-exhibitor's Introduction

Runs an Exhibitor-managed ZooKeeper instance using S3 for backups and automatic node discovery.

Available on the Docker Index as mbabineau/zookeeper-exhibitor:

docker pull mbabineau/zookeeper-exhibitor

Versions

  • Exhibitor 1.5.5
  • ZooKeeper 3.4.6

Usage

The container expects the following environment variables to be passed in:

  • HOSTNAME - addressable hostname for this node (Exhibitor will forward users of the UI to this address)
  • S3_BUCKET - (optional) bucket used by Exhibitor for backups and coordination
  • S3_PREFIX - (optional) key prefix within S3_BUCKET to use for this cluster
  • AWS_ACCESS_KEY_ID - (optional) AWS access key ID with read/write permissions on S3_BUCKET
  • AWS_SECRET_ACCESS_KEY - (optional) secret key for AWS_ACCESS_KEY_ID
  • AWS_REGION - (optional) the AWS region of the S3 bucket (defaults to us-west-2)
  • ZK_PASSWORD - (optional) the HTTP Basic Auth password for the "zk" user
  • ZK_DATA_DIR - (optional) Zookeeper data directory
  • ZK_LOG_DIR - (optional) Zookeeper log directory
  • HTTP_PROXY_HOST - (optional) HTTP Proxy hostname
  • HTTP_PROXY_PORT - (optional) HTTP Proxy port
  • HTTP_PROXY_USERNAME - (optional) HTTP Proxy username
  • HTTP_PROXY_PASSWORD - (optional) HTTP Proxy password

Starting the container:

docker run -p 8181:8181 -p 2181:2181 -p 2888:2888 -p 3888:3888 \
    -e S3_BUCKET=<bucket> \
    -e S3_PREFIX=<key_prefix> \
    -e AWS_ACCESS_KEY_ID=<access_key> \
    -e AWS_SECRET_ACCESS_KEY=<secret_key> \
    -e HOSTNAME=<host> \
    mbabineau/zookeeper-exhibitor:latest

Once the container is up, confirm Exhibitor is running:

$ curl -s localhost:8181/exhibitor/v1/cluster/status | python -m json.tool
[
    {
        "code": 3, 
        "description": "serving", 
        "hostname": "<host>", 
        "isLeader": true
    }
]

See Exhibitor's wiki for more details on its REST API.

You can also check Exhibitor's web UI at http://<host>:8181/exhibitor/v1/ui/index.html

Then confirm ZK is available:

$ echo ruok | nc <host> 2181
imok

AWS IAM Policy

Exhibitor can also use an IAM Role attached to an instance instead of passing access or secret keys. This is an example policy that would be needed for the instance:

{
    "Statement": [
        {
            "Resource": [
                "arn:aws:s3:::exhibitor-bucket/*",
                "arn:aws:s3:::exhibitor-bucket"
            ],
            "Action": [
                "s3:AbortMultipartUpload",
                "s3:DeleteObject",
                "s3:GetBucketAcl",
                "s3:GetBucketPolicy",
                "s3:GetObject",
                "s3:GetObject",
                "s3:GetObjectAcl",
                "s3:ListBucket",
                "s3:ListBucketMultipartUploads",
                "s3:ListMultipartUploadParts",
                "s3:PutObject",
                "s3:PutObjectAcl"
            ],
            "Effect": "Allow"
        }
    ]
}

Starting the container:

docker run -p 8181:8181 -p 2181:2181 -p 2888:2888 -p 3888:3888 \
    -e S3_BUCKET=<bucket> \
    -e S3_PREFIX=<key_prefix> \
    -e HOSTNAME=<host> \
    mbabineau/zookeeper-exhibitor:latest

docker-zk-exhibitor's People

Contributors

cfortier2 avatar cloudify avatar guizmaii avatar jamescarr avatar mannytoledo avatar mbabineau avatar nberg avatar olvesh avatar sheeley avatar vlachjosef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.