【问题标题】:Use memcache From Other Server从其他服务器使用 memcache
【发布时间】:2012-12-06 11:44:41
【问题描述】:

我有一个基于 Ubuntu 的内存缓存服务器。

现在我希望我的新服务器使用旧服务器的内存缓存。

我尝试了什么?

在我的防火墙 11211 中打开 tcp 端口

但我仍然无法使用它。

在 /etc/memcached.conf 中:

# Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.
-l 127.0.0.1

我已将 127.0.0.1 更改为 0.0.0.0/0

Sudo Ip 平板输出

[sudo] password for azureuser:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

【问题讨论】:

  • 监听 0.0.0.0 应该可以。您可以尝试从新机器远程登录到端口吗? sudo iptables -L 输出什么?
  • 那不只是监听服务器吗?
  • 好的,我编辑了问题。现在它包括输出。

标签: php linux ubuntu memcached port


【解决方案1】:

我将您的问题解释为您希望 localhost 使用另一台机器的 memcached 实例。

如果确实如此,那么您只需将127.0.0.1 替换为其他机器IP,例如192.168.1.111

【讨论】:

  • 我的另一台机器有动态ip。我怎样才能允许所有ip?
  • 你所要求的听起来不可能。也许这只是我的解释。如果 IP 是动态的或切换到静态,则可能使用 DNS 和主机名
  • 其实是天蓝色的网站。我正在配置它以利用我的旧内存缓存服务器。 Azure 站点 URL 类似于 xxx.azurewebsites.net/ 。我不知道如何配置我的服务器以允许 memcache 请求。
  • 我不确定我是否完全理解您的问题。对不起。
  • 向全世界开放 memcached 是非常危险的。不要这样做。 slideshare.net/sensepost/cache-on-delivery
猜你喜欢
  • 1970-01-01
  • 2017-09-25
  • 2014-10-23
  • 2012-05-28
  • 2011-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多