Search code examples
google-cloud-platformredisbitnami

"It was not possible to connect to the redis server" Bitnami hosted on Google Cloud


Problem:

When I try to connect from my local machine to a Redis VM hosted on Google Cloud, the connection is refused.

QUESTION: How can I connect to Redis installed on a private VM in GCP after successfully connecting to the VPC via a VPN?

Setup:

  • VM hosted in Google Cloud without public IP
  • Redis installed on VM by deploying the VM using the Bitnami package from GCP Marketplace
  • Firewall rule added to GCP targeting my VM, allowing TCP ingress traffic on port 6379 for all IP ranges
  • VPN setup using OpenVPN to tunnel into GCP VPC from local machine (Windows)

What I know:

  • Redis is running... if I SSH into my VM and run redis-cli, everything works as expected
  • VPN is working... from my local machine, I can successfully ping my VM when connected to the VPN
  • Redis config comments out the binding to 127.0.0.0 to (theoretically) open it up to all bindings, after which I restarted Redis on my VM (I think)
  • The password I'm using is correct

What doesn't work:

StackExchange.Redis:

var redis = ConnectionMultiplexer.Connect("my.ip.to.vm", config =>
{
    config.Password = "my-redis-password";
});

Command Line from Local Machine (using redis-cli npm package):

rdcli -h my.ip.to.vm -a my-redis-password

Recap

  • What am I missing?
  • How can I connect to Redis installed on a private VM in GCP after successfully connecting to the VPC via a VPN?

Solution

  • Solution (this is embarrassing):

    1. Stop VM
    2. Start VM