Launch cockroachdb clusters in AWS using remote
provisioners.
- spin up insecure cockroachdb clusters
- Both in public subnet and private subnet
- One time setup of nodes with cockroachdb
- Loadbalancer to route requests to all the nodes on
port 26257
- Terraform installed
- AWS CLI installed and configured with access key and secret
- Ensure the pem file is in
~/.ssh
- Add the public key of the corresponding pem file to
artifacts.tf
in"aws_key_pair" "deployment"
resource
$ terraform init
$ terraform plan -out=cockroach_cluster.tfplan
$ terraform apply "cockroach_cluster.tfplan"
$ terraform init
$ terraform plan -out=cockroach_cluster.tfplan
$ terraform apply -var 'num_of_instaces=<any_integer>' "cockroach_cluster.tfplan"
Ssh into the bastion instance which is public facing
$ ssh -i <pem-file> ubuntu@<public-ip-of-bastion-instance>
Test the client connection to all the nodes through the loadbalancer
$ cockroach node status --insecure --host=<private-DNS-of-internal-loadbalancer>
This project is distributed under the Apache License Version 2.0