在开发过程中从本地计算机访问 Memorystore 的最佳方式是什么?是否有类似 Cloud SQL Proxy 之类的东西可以用来设置隧道?
您可以启动 Compute Engine 实例并使用端口转发连接到您的 Redis 计算机。
例如,如果您的 Redis 机器的内部 IP 地址为 10.0.0.3,您将执行以下操作:
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
更新:现已正式记录:https://cloud.google.com/memorystore/docs/redis/connecting-redis-instance#connecting_from_a_local_machine_with_port_forwarding https://cloud.google.com/memorystore/docs/redis/connecting-redis-instance#connecting_from_a_local_machine_with_port_forwarding
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)