2012-12-19 62 views
1

我有一個基於Ubuntu的memcache服務器。從其他服務器使用memcache

現在我想我的新服務器使用舊服務器的內存緩存。

我想什麼?在我的防火牆

打開TCP端口11211

但我仍無法使用它。

在/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] 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.0應該這樣做。你可以嘗試telnet到新機器的端口。什麼'sudo iptables -L'輸出? – sberry

+0

這不就是爲了監聽服務器嗎? –

+0

好吧,我編輯的問題。現在它包含輸出。 – ReCra

回答

2

我理解你的問題因爲你想讓你的localhost使用另一臺機器的memcached實例。

如果確實如此,那麼你應該只需要更換127.0.0.1與其他機器的IP,例如192.168.1.111

+0

我的其他機器有動態ip.How我可以允許所有IPS? – ReCra

+0

你要求的聲音聽起來不可能。也許這只是我的解釋。也許使用DNS和主機名如果IP是動態的或切換到靜態的 –

+0

其實它是天藍色的網站。我正在配置它來利用我的舊memcache服務器。 Azure Site Url就像xxx.azurewebsites.net/。我不知道如何配置我的服務器以允許memcache請求。 – ReCra