我可以使用telnet命令连接到远程redis,并获取"mytest“键的值。下面的代码运行正常。
[root@server shantanu]# telnet 10.10.10.100 6379
Trying 10.10.10.100...
Connected to 10.10.10.100 (10.10.10.100).
Escape character is '^]'.
get mytest
$14
this is first
但是如何在shell脚本中使用它呢?我习惯于通过以下方式连接到mysql:
msyql -h10.10.10.100 -uroot -p
我正在使用macOS 10.12上的Docker1.12.5,并使用它来设置一个开发环境,我有一个应用程序映像和一个共享的redis映像,其中包含一些预先填充的配置变量。
即使在阅读了一些教程(以及如何在Mac上无法使用docker0 )之后,我仍然很难连接这两个容器。
我使用以下方法启动我的redis映像:
docker run -d -p 6379:6379 (IMAGE ID)
在我的redis图像中,我有:
CONTAINER ID IMAGE COMMAND CREATED STATU
我正在写一个Lua脚本,这是我的剧本:
local session = redis.call('HGETALL', accessToken)
if (session == nil) then
redis.log(redis.LOG_WARNING, 'Session not found : ' .. accessToken)
return
end
我尝试了多个if条件,但无法找到如何正确验证该值是否为null。另外,我不希望之前调用EXISTS命令的开销。
我试着通过telnet调用它,来自redis *的响应
下面是我试过的清单:
if (sessio
我遵循了以下两篇教程:
我所做的唯一不同之处是,我从第二个教程中部署了Redis代码,而不是从第一个链接中部署的代码。
如前所述, You can connect to the Redis instance from any Compute Engine VM instance located within the same project, region and network as the Redis instance.
服务: 10.162.0.17 (nic0)
redis: 10.169.12.195:6379
同一项目、同一区域、同一地区(a)
然而,当
我有一个小的有三个节点的码头群。 $ sudo docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
jmsidw84mom3k9m4yoqc7rkj0 ip-172-31-a-x.region.compute.internal Ready Active