|
9 | 9 |
|
10 | 10 | #### Introduction
|
11 | 11 |
|
| 12 | +This is a Terraform module for bringing up a fully-formed Zookeeper ensemble. It has the following features: |
| 13 | + |
| 14 | +- Forces an odd number of nodes for quorum. |
| 15 | +- Nodes are auto provisioning and auto healing. They will come up and cluster automatically. |
| 16 | +- Data and log volumes are separate. |
| 17 | +- CPU, memory, network and disk metrics are sent to CloudWatch metrics. |
| 18 | +- Zookeeper logs are sent to CloudWatch logs. |
| 19 | + |
| 20 | +#### Usage |
| 21 | + |
| 22 | +```hcl |
| 23 | +module "zookeeper" { |
| 24 | + source = "github.com/barryw/terraform-aws-zookeeper" |
| 25 | +
|
| 26 | + # If empty, no keypair will be assigned to instances |
| 27 | + keypair_name = var.keypair |
| 28 | + vpc_id = var.vpc_id |
| 29 | + # Zookeeper instance subnets. Should be private |
| 30 | + zookeeper_subnets = [var.private_subnet1, var.private_subnet2] |
| 31 | + # defaults to false |
| 32 | + create_bastion = true |
| 33 | + bastion_subnet = [var.public_subnet1] |
| 34 | + bastion_ingress_cidrs = ["0.0.0.0/0"] |
| 35 | + zookeeper_version = "3.7.0" |
| 36 | + # Add any custom tags to include on created resources |
| 37 | + tags = {} |
| 38 | + # Gets added to the beginning of resource names |
| 39 | + name_prefix = "my-zookeeper" |
| 40 | + # Must be odd |
| 41 | + cluster_size = 3 |
| 42 | + instance_type = "m4.large" |
| 43 | + root_volume_size = 32 |
| 44 | + data_volume_type = "gp2" |
| 45 | + data_volume_size = 10 |
| 46 | + log_volume_type = "gp2" |
| 47 | + log_volume_size = 10 |
| 48 | + # Specify a zone to create records on |
| 49 | + route53_zone = "" |
| 50 | + # Specify the security group id of the groups to allow connections to ZK. If not specified, use the VPC's CIDR |
| 51 | + client_security_group_id = "" |
| 52 | + # The namespace to use for CloudWatch metrics |
| 53 | + cloudwatch_namespace = "CWAgent" |
| 54 | + zookeeper_config = { |
| 55 | + clientPort = 2181, |
| 56 | + syncLimit = 5, |
| 57 | + initLimit = 10, |
| 58 | + tickTime = 2000, |
| 59 | + zkHeap = 4096 |
| 60 | + } |
| 61 | +} |
| 62 | +``` |
| 63 | + |
| 64 | +#### License |
| 65 | + |
| 66 | +This module is licensed under the MIT license: https://opensource.org/licenses/MIT |
0 commit comments