php - 使用来自其他服务器的 memcache

标签 php linux ubuntu memcached port

我有一台基于 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

最佳答案

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

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

关于php - 使用来自其他服务器的 memcache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13947034/

相关文章:

php - Codeigniter 不显示页面

php - 激活时设置背景颜色

php - Drupal 错误地转义了 javascript 中的标签

linux - 全新安装 codeigniter 404 错误或下载每个页面

python - Ubuntu 16.04 - 为什么我无法安装 libtiff4-dev?

tomcat 在终端中启动但不在 ubuntu 上的浏览​​器中运行?

ubuntu - VMware 错误 "Unable to change power state of virtual machine UPS: Operation inconsistent with current state"

php - MySQL 分组依据 + 顺序

c++ - 创建在linux中使用opencv的C++动态库

C 程序将在 Linux 而不是 Windows 中编译和运行