从本地计算机访问GCP Memorystore [英] Accessing GCP Memorystore from local machines

查看:104
本文介绍了从本地计算机访问GCP Memorystore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在开发过程中从本地计算机访问Memorystore的最佳方法是什么?是否可以使用诸如Cloud SQL Proxy之类的方法来建立隧道?

Whats the best way to access Memorystore from Local Machines during development? Is there something like Cloud SQL Proxy that I can use to set up a tunnel?

推荐答案

您可以启动Compute Engine实例并使用端口转发连接到Redis计算机.

You can spin up a Compute Engine instance and use port forwarding to connect to your Redis machine.

例如,如果您的Redis机器具有内部IP地址10.0.0.3,则可以执行以下操作:

For example if your Redis machine has internal IP address 10.0.0.3 you'd do:

gcloud compute instances create redis-forwarder --machine-type=f1-micro
gcloud compute ssh redis-forwarder -- -N -L 6379:10.0.0.3:6379

只要保持ssh隧道打开,就可以连接到localhost:6379

As long as you keep the ssh tunnel open you can connect to localhost:6379

这篇关于从本地计算机访问GCP Memorystore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆