Node.js 在nodejs应用程序中使用memcached故障切换服务器

Node.js 在nodejs应用程序中使用memcached故障切换服务器,node.js,memcached,Node.js,Memcached,我正在尝试为带有驱动程序的nodejs应用程序设置一个健壮的memcached配置,但是当一台服务器死亡时,它似乎不使用指定的故障转移服务器 我的本地实验如下: 壳 节点 你知道我们做错了什么吗?当你的nodejs服务器没有从memcached获取任何会话id时,就会出现这种情况 请在php.ini文件中正确检查是否为memcached正确设置 session.save='memcache' session.pathtcp://localhost:11212“故障切换功能在中似乎有点缺陷 要启用

我正在尝试为带有驱动程序的nodejs应用程序设置一个健壮的memcached配置,但是当一台服务器死亡时,它似乎不使用指定的故障转移服务器

我的本地实验如下:

节点


你知道我们做错了什么吗?

当你的nodejs服务器没有从memcached获取任何会话id时,就会出现这种情况 请在php.ini文件中正确检查是否为memcached正确设置

session.save='memcache'
session.pathtcp://localhost:11212“

故障切换功能在中似乎有点缺陷

要启用故障切换,必须设置删除选项:

不幸的是,由于以下错误,这将不起作用:

[depricated] HashRing#replaceServer is removed.
[depricated] the API has no replacement

也就是说,当尝试用故障转移列表中的替换项替换失效的服务器时,node memcached会从库中输出一个弃用错误,而该错误由node memcached的同一作者维护。IMHO,请随意打开一个bug:-

是的,我们也尝试过这个选项,但也没有成功:php.ini?你在说什么-|
MC = require('memcached')
c = new MC('localhost:11211', //this process does not exist
            {failOverServers: ['localhost:11212']})
c.get('foo', console.log) //this will eventually time out
c.get('foo', console.log) //repeat 5 or 6 times to exceed the retries number
//wait until all the connection errors appear in the console
//at this point, the failover server should be in use
c.get('foo', console.log) //this still times out :(
c = new MC('localhost:11211', //this process does not exist
            {failOverServers: ['localhost:11212'],
             remove : true})
[depricated] HashRing#replaceServer is removed.
[depricated] the API has no replacement