Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues in creating a 3 node yugabyte cluster in private subnet of vpc #31

Open
jainhitesh9998 opened this issue Sep 9, 2020 · 4 comments
Assignees

Comments

@jainhitesh9998
Copy link

Hi, I've tried to deploy a 3 node yugabyte cluster in private subnet within a VPC,
the configuration means that the cluster will be accessible only to applications within the VPC.

these are the properties I've added for the setup

use_public_ip_for_ssh = "false"
associate_public_ip_address = "false"

with terraform 12.29 I'm getting this error (log snippet):

module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[1]: Still creating... [5m0s elapsed] module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[2]: Still creating... [5m0s elapsed] module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[0]: Still creating... [5m10s elapsed] module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[2]: Still creating... [5m10s elapsed] module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[1]: Still creating... [5m10s elapsed] Error: timeout - last error: SSH authentication failed (centos@:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain Error: timeout - last error: SSH authentication failed (centos@:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain Error: timeout - last error: SSH authentication failed (centos@:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

with terraform 13.2 I'm getting this error (log snippet):

module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[2]: Still creating... [10s elapsed]
module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[0]: Still creating... [10s elapsed]
module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[1]: Provisioning with 'file'...
module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[0]: Provisioning with 'file'...
module.yugabyte-db-cluster.aws_instance.yugabyte_nodes[2]: Provisioning with 'file'...
Error: host for provisioner cannot be empty
Error: host for provisioner cannot be empty
Error: host for provisioner cannot be empty`

@bhavin192
Copy link
Contributor

Hello @jainhitesh9998. The current implementation of this module depends on the ability to connect to the provisioned VMs over SSH. After connecting, it downloads YugabyteDB, sets up all the flags etc. In case of private subnets the terraform apply command needs to be run from a machine which has access to those subnets (can be an EC2 or a machine with VPN to AWS VPC).

@jainhitesh9998
Copy link
Author

Hi Bhavin, i was having access to the VM using only private ip addresses within the subnet, (they were not assigned any public IP) I had made some changes in the main.tf file after which it was able to ssh into the machines and setup the cluster.

connection {
host = var.use_public_ip_for_ssh == "true" ? self.public_ip : self.private_ip
type = "ssh"
user = var.ssh_user
private_key = file(var.ssh_private_key)
}

I'll may be test it again send a pull request in a few days.

@bhavin192
Copy link
Contributor

@jainhitesh9998 aha! you are right. Yes, please send a PR with above changes.

jainhitesh9998 pushed a commit to jainhitesh9998/terraform-aws-yugabyte that referenced this issue Oct 1, 2020
@jainhitesh9998
Copy link
Author

@bhavin192 I have sent a PR for the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants