Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 missing memcache config file
#11

[eluser]Patrick Savalle[/eluser]
Does anyone know how to configure multiple servers? Regards.
#12

[eluser]Patrick Savalle[/eluser]
Shouldn't it be like:

Code:
$config['memcached'] = array(

    'default' => array(

            'hostname'        => 'localhost',
            'port'            => '11211',
            'weight'        => '1'        
    )
);
#13

[eluser]Patrick Savalle[/eluser]
Actually, this worked:

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

// --------------------------------------------------------------------------
// Servers
// --------------------------------------------------------------------------

$config['memcached'] = array(
    'hostname' => '10.0.11.5',
    'port' => '11211',
    'weight' => '1',
);

$config['memcached'] = array(
    'hostname' => '10.0.11.5',
    'port' => '11212',
    'weight' => '1',
);

/* End of file memcached.php */
/* Location: ./system/application/config/memcached.php */

Of course with your own paramaters.
#14

[eluser]Unknown[/eluser]
But this setup has just one server. Even if you would have different setting with the second array it would overwrite the first. So I guess it will work but always use just one mencached server.

Anja
#15

[eluser]Fábio[/eluser]
This works.

The memcached driver doesn't look for the key 'memcached',
it uses all keys defined in this config file as one server.


Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

$config['server_1'] = array('hostname' => '127.0.0.1', 'port' => 11211, 'weight' => 1);
$config['server_2'] = array('hostname' => '127.0.0.2', 'port' => 11211, 'weight' => 1);
$config['server_3'] = array('hostname' => '127.0.0.3', 'port' => 11211, 'weight' => 1);

?>




Theme © iAndrew 2016 - Forum software by © MyBB