多服务器配置为何不好使。数据保存不到缓存中//分布Memcachedf服务IP 端口
string[] servers = { "172.10.1.97:11211","172.10.1.236:11211" }; //初始化池
SockIOPool pool = SockIOPool.GetInstance();
pool.SetServers(servers);
pool.InitConnections = 3;
pool.MinConnections = 3;
pool.MaxConnections = 5;
pool.SocketConnectTimeout = 1000;
pool.SocketTimeout = 3000;
pool.MaintenanceSleep = 30;
pool.Failover = true;
pool.Nagle = false;
pool.Initialize();
//客户端实例
MemcachedClient mc = new Memcached.ClientLibrary.MemcachedClient();
mc.EnableCompression = false;
还需要什么其他设置吗?mc.set("a","xxx");
string[] servers = { "172.10.1.97:11211","172.10.1.236:11211" }; //初始化池
SockIOPool pool = SockIOPool.GetInstance();
pool.SetServers(servers);
pool.InitConnections = 3;
pool.MinConnections = 3;
pool.MaxConnections = 5;
pool.SocketConnectTimeout = 1000;
pool.SocketTimeout = 3000;
pool.MaintenanceSleep = 30;
pool.Failover = true;
pool.Nagle = false;
pool.Initialize();
//客户端实例
MemcachedClient mc = new Memcached.ClientLibrary.MemcachedClient();
mc.EnableCompression = false;
还需要什么其他设置吗?mc.set("a","xxx");
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货