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

Clients are not connected to the server cluster #13

Open
rberlind opened this issue Feb 4, 2018 · 0 comments
Open

Clients are not connected to the server cluster #13

rberlind opened this issue Feb 4, 2018 · 0 comments

Comments

@rberlind
Copy link

rberlind commented Feb 4, 2018

The clients should be connected to the consul server cluster. With the current code, if you ssh to a server and run consul members, you only see the servers, and if you ssh to a client and run consul members, you only see the clients.

This means the clients and apps that talk to them would not have access to the servers.

A workaround for this is to modify the run-consul script to have the following at line 201:

retry_join_json=$(cat <<EOF
"retry_join": ["provider=azure resource_group=$instance_resource_group vm_scale_set=$scale_set_name tenant_id=$tenant_id client_id=$client_id subscription_id=$subscription_id secret_access_key=$secret_access_key"],
EOF

and to also change the user_data_client template_file data source at line 138 to have scale_set_name = "${var.cluster_name}-server" so that both the client and server scripts point at the server VM scale set.

Note that the first change uses Consul's cloud auto-joining feature for Azure: https://www.consul.io/docs/agent/options.html#microsoft-azure.

After making these changes, rebuilding my packer image, re-provisioning the virtual machine scale sets, ssh-ing to the server or client VMs, and running consul members, I see both servers and clients:

consuladmin@consul000000:~$ consul members
Node                                  Address         Status  Type    Build  Protocol  DC      Segment
6151e229-8c48-49b7-b9d3-5cbf778c8ad3  10.0.10.6:8301  alive   server  1.0.3  2         eastus  <all>
7b861f7d-0598-4402-b4dc-d5306328ee18  10.0.10.5:8301  alive   server  1.0.3  2         eastus  <all>
d3f6866f-f3f0-40e8-bd5a-77227bba118a  10.0.10.4:8301  alive   server  1.0.3  2         eastus  <all>
3a59a069-a755-4b85-b634-204e70168f08  10.0.10.8:8301  alive   client  1.0.3  2         eastus  <default>
aacd535b-a82a-4822-a367-ecd128ee5ea9  10.0.10.7:8301  alive   client  1.0.3  2         eastus  <default>
cori added a commit to cori/terraform-azurerm-consul that referenced this issue Feb 28, 2018
cori added a commit to cori/terraform-azurerm-consul that referenced this issue Feb 28, 2018
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

1 participant