failed to connect to sns account,0db unable to connectaccess api server是什么意思

memcached - Failed to connect to memcache host ! - Server Fault
to customize your list.
Server Fault is a question and answer site for system and network administrators. J it only takes a minute:
Here's how it works:
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I'm totally new to memcached !
I sucessfully Installed and started memcached with this command in my host A (Ip 192.168.1.102)
memcached -u memcached -d -m 30 -l 127.0.0.1 -p 11211
I also add these entry to iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 11211 -j ACCEPT
restarted iptables service and it listened to port 11211
telnet also work !
telnet localhost 11211
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
But I connect to this host A from Host B (IP 192.168.1.103) with this script memcached_test.php
$memcache = new M
$memcache-&connect('192.168.1.102', 11211) or die ("Could not connect");
$version = $memcache-&getVersion();
echo "Server's version: ".$version."&br/&\n";
$tmp_object = new stdC
$tmp_object-&str_attr = 'test';
$tmp_object-&int_attr = 123;
$memcache-&set('key', $tmp_object, false, 10) or die ("Failed to save data at the server");
echo "Store data in the cache (data will expire in 10 seconds)&br/&\n";
$get_result = $memcache-&get('key');
echo "Data from the cache:&br/&\n";
var_dump($get_result);
When I browser this script in the server at host B (192.168.1.103). I recieved this error
Warning: Memcache::connect()
[memcache.connect]: Can't connect to
192.168.1.102:11211, Connection refused (111) in
/var/www/memcache_test.php on line 3
Could not connect
Please tell me how to solve this problem!
# memcached -u memcached -d -m 30 -l 127.0.0.1 -p 11211
You'll notice there is "-l 127.0.0.1" in your command line. This tells memcached to only listen on the lo interface. If you want to access it from a remote machine, you need to remove this part of the command line.
18.6k12963
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
Server Fault works best with JavaScript enabled的海词问答和网友补充:
相关词典网站:

我要回帖

更多关于 failed to connect 的文章

 

随机推荐