Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Memcached中的服务器到底是什么?_Php_Memcached - Fatal编程技术网

Php Memcached中的服务器到底是什么?

Php Memcached中的服务器到底是什么?,php,memcached,Php,Memcached,当我们想要连接到memcached时,有一个参数指定服务器地址。这个服务器部件可以只在集群服务器中使用,还是可以在我们想要的任何形式中使用?有人能解释一下这个问题吗。我真的不知道如何使用这个部件。我总是把localhost或127.0.0.1放在这部分。如果我以后想添加一些服务器呢 在project wiki中,我看到了以下部分: //in your configuration file: $MEMCACHE_SERVERS = array( "10.1.1.1", //web1

当我们想要连接到memcached时,有一个参数指定服务器地址。这个服务器部件可以只在集群服务器中使用,还是可以在我们想要的任何形式中使用?有人能解释一下这个问题吗。我真的不知道如何使用这个部件。我总是把
localhost
127.0.0.1
放在这部分。如果我以后想添加一些服务器呢

在project wiki中,我看到了以下部分:

//in your configuration file: 

$MEMCACHE_SERVERS = array(
    "10.1.1.1", //web1
    "10.1.1.2", //web2
    "10.1.1.3", //web3
);


//at the 'bootstrapping' phase of your app somewhere:

$memcache = new Memcache();
foreach($MEMCACHE_SERVERS as $server){
    $memcache->addServer ( $server );
}
我错过了一些东西!它们是否会聚集在一起?
如果要将服务器添加到memcache,我们说所有服务器都应该在一个网络上,这意味着什么