我有一个Seneca网格,可在笔记本电脑上正常工作。但是,要使其在牧场主上工作是不可能的。由于网格超时,所有容器都将停止工作。
我已经阅读了整个seneca-mesh源代码和底层sneeze库。这给了我一些调试方法的线索,但这是我得到的最长的线索。例如,我意识到seneca-mesh提供了多种选择来打喷嚏,这些选择又将其提供给他们使用的SWIM实现。
我尝试增加网格连接超时,怀疑它们是两个狭窄的(这是事实,因为它们是777ms)。这是我设置的:
编辑:我刚刚意识到,如果包含完整的
会更好。{
pins: ['role:mesh,cmd:test'],
host: '10.58.58.58',
isbase: true,
port: '39999',
bases: ['10.40.40.1:39999', 'base-hostname:39001'],
stop: false,
balance_client: { debug: { client_updates: true } },
jointime: 2000,
sneeze:
{
silent: false,
swim: { joinTimeout: 2777, pingTimeout: 2444, pingReqTimeout: 2333 }
},
discover:
{
custom: { active: true, find: dnsSeed },
multicast: { active: false },
registry: { active: false }
}
}
遗憾的是,唯一的区别是超时时间更长。多亏了silent
选项,您可以看到我设置为false为您提供了非常详细的日志,唯一的问题是我不明白为什么它们会失败。
在最简单的情况下,我有两台服务器,一台充当基础服务器(启动时不会出现问题),还有一个网状节点,该节点应通过SWIM加入网格。检查日志,我发现它们能够通信,并且基节点接收到来自该节点的加入请求。这种情况发生了两次,以定义的超时间隔开,并且在几次加入请求之后,基节点要求离开网格并发生超时:
基本节点
SNEEZE 87271 add 10.88.250.29:46830 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh { config:
19/6/2018 16:21:27 { type: 'web',
19/6/2018 16:21:27 port: 57280,
19/6/2018 16:21:27 host: '10.88.250.29',
19/6/2018 16:21:27 path: '/act',
19/6/2018 16:21:27 protocol: 'http',
19/6/2018 16:21:27 timeout: 5555,
19/6/2018 16:21:27 max_listen_attempts: 11,
19/6/2018 16:21:27 attempt_delay: 222,
19/6/2018 16:21:27 serverOptions: {},
19/6/2018 16:21:27 pin:
19/6/2018 16:21:27 [ 'cmd:*,role:profile',
19/6/2018 16:21:27 'cmd:probes.get,role:profile',
19/6/2018 16:21:27 'cmd:campaigns.get,role:profile',
19/6/2018 16:21:27 'cmd:universes.get,role:profile',
19/6/2018 16:21:27 'cmd:probes.del,role:profile',
19/6/2018 16:21:27 'cmd:campaigns.del,role:profile',
19/6/2018 16:21:27 'cmd:universes.del,role:profile' ],
19/6/2018 16:21:27 model: 'consume',
19/6/2018 16:21:27 ismesh: true,
19/6/2018 16:21:27 msgprefix: 'seneca_',
19/6/2018 16:21:27 callmax: 111111,
19/6/2018 16:21:27 msgidlen: 12,
19/6/2018 16:21:27 role: 'transport',
19/6/2018 16:21:27 hook: 'listen' },
19/6/2018 16:21:27 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:27 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:27 'tag$': 'seneca~mesh',
19/6/2018 16:21:27 'v$': 0 }
19/6/2018 16:21:30SNEEZE 90301 add 10.88.250.29:49483 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh { config:
19/6/2018 16:21:30 { type: 'web',
19/6/2018 16:21:30 port: 57280,
19/6/2018 16:21:30 host: '10.88.250.29',
19/6/2018 16:21:30 path: '/act',
19/6/2018 16:21:30 protocol: 'http',
19/6/2018 16:21:30 timeout: 5555,
19/6/2018 16:21:30 max_listen_attempts: 11,
19/6/2018 16:21:30 attempt_delay: 222,
19/6/2018 16:21:30 serverOptions: {},
19/6/2018 16:21:30 pin:
19/6/2018 16:21:30 [ 'cmd:*,role:profile',
19/6/2018 16:21:30 'cmd:probes.get,role:profile',
19/6/2018 16:21:30 'cmd:campaigns.get,role:profile',
19/6/2018 16:21:30 'cmd:universes.get,role:profile',
19/6/2018 16:21:30 'cmd:probes.del,role:profile',
19/6/2018 16:21:30 'cmd:campaigns.del,role:profile',
19/6/2018 16:21:30 'cmd:universes.del,role:profile' ],
19/6/2018 16:21:30 model: 'consume',
19/6/2018 16:21:30 ismesh: true,
19/6/2018 16:21:30 msgprefix: 'seneca_',
19/6/2018 16:21:30 callmax: 111111,
19/6/2018 16:21:30 msgidlen: 12,
19/6/2018 16:21:30 role: 'transport',
19/6/2018 16:21:30 hook: 'listen' },
19/6/2018 16:21:30 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:30 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:30 'tag$': 'seneca~mesh',
19/6/2018 16:21:30 'v$': 0 }
19/6/2018 16:21:35SNEEZE 95647 remove 10.88.250.29:46830 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh { config:
19/6/2018 16:21:35 { type: 'web',
19/6/2018 16:21:35 port: 57280,
19/6/2018 16:21:35 host: '10.88.250.29',
19/6/2018 16:21:35 path: '/act',
19/6/2018 16:21:35 protocol: 'http',
19/6/2018 16:21:35 timeout: 5555,
19/6/2018 16:21:35 max_listen_attempts: 11,
19/6/2018 16:21:35 attempt_delay: 222,
19/6/2018 16:21:35 serverOptions: {},
19/6/2018 16:21:35 pin:
19/6/2018 16:21:35 [ 'cmd:*,role:profile',
19/6/2018 16:21:35 'cmd:probes.get,role:profile',
19/6/2018 16:21:35 'cmd:campaigns.get,role:profile',
19/6/2018 16:21:35 'cmd:universes.get,role:profile',
19/6/2018 16:21:35 'cmd:probes.del,role:profile',
19/6/2018 16:21:35 'cmd:campaigns.del,role:profile',
19/6/2018 16:21:35 'cmd:universes.del,role:profile' ],
19/6/2018 16:21:35 model: 'consume',
19/6/2018 16:21:35 ismesh: true,
19/6/2018 16:21:35 msgprefix: 'seneca_',
19/6/2018 16:21:35 callmax: 111111,
19/6/2018 16:21:35 msgidlen: 12,
19/6/2018 16:21:35 role: 'transport',
19/6/2018 16:21:35 hook: 'listen' },
19/6/2018 16:21:35 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:35 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:35 'tag$': 'seneca~mesh',
19/6/2018 16:21:35 'v$': 0 }
客户节点:
如您所见,有几个加入请求,最后是一个删除请求,让我们检查一下客户端日志
19/6/2018 16:21:21SNEEZE 81049 joining 4 10.88.250.29:41450 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh [ 'nanoservices-base1:39999', '10.42.209.107:39999' ] { joinTimeout: 2777,
19/6/2018 16:21:21 pingTimeout: 2444,
19/6/2018 16:21:21 pingReqTimeout: 2333,
19/6/2018 16:21:21 codec: 'msgpack',
19/6/2018 16:21:21 disseminationFactor: 22,
19/6/2018 16:21:21 interval: 111,
19/6/2018 16:21:21 pingReqGroupSize: 7,
19/6/2018 16:21:21 udp: { maxDgramSize: 2048 },
19/6/2018 16:21:21 local:
19/6/2018 16:21:21 { host: '10.88.250.29:41450',
19/6/2018 16:21:21 meta:
19/6/2018 16:21:21 { config: [Object],
19/6/2018 16:21:21 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:21 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:21 'tag$': 'seneca~mesh',
19/6/2018 16:21:21 'v$': 0 },
19/6/2018 16:21:21 incarnation: 1529418081049 } }
19/6/2018 16:21:24SNEEZE 84284 joining 5 10.88.250.29:42022 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh [ 'nanoservices-base1:39999', '10.42.209.107:39999' ] { joinTimeout: 2777,
19/6/2018 16:21:24 pingTimeout: 2444,
19/6/2018 16:21:24 pingReqTimeout: 2333,
19/6/2018 16:21:24 codec: 'msgpack',
19/6/2018 16:21:24 disseminationFactor: 22,
19/6/2018 16:21:24 interval: 111,
19/6/2018 16:21:24 pingReqGroupSize: 7,
19/6/2018 16:21:24 udp: { maxDgramSize: 2048 },
19/6/2018 16:21:24 local:
19/6/2018 16:21:24 { host: '10.88.250.29:42022',
19/6/2018 16:21:24 meta:
19/6/2018 16:21:24 { config: [Object],
19/6/2018 16:21:24 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:24 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:24 'tag$': 'seneca~mesh',
19/6/2018 16:21:24 'v$': 0 },
19/6/2018 16:21:24 incarnation: 1529418084284 } }
19/6/2018 16:21:27SNEEZE 87269 joining 6 10.88.250.29:46830 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh [ 'nanoservices-base1:39999', '10.42.209.107:39999' ] { joinTimeout: 2777,
19/6/2018 16:21:27 pingTimeout: 2444,
19/6/2018 16:21:27 pingReqTimeout: 2333,
19/6/2018 16:21:27 codec: 'msgpack',
19/6/2018 16:21:27 disseminationFactor: 22,
19/6/2018 16:21:27 interval: 111,
19/6/2018 16:21:27 pingReqGroupSize: 7,
19/6/2018 16:21:27 udp: { maxDgramSize: 2048 },
19/6/2018 16:21:27 local:
19/6/2018 16:21:27 { host: '10.88.250.29:46830',
19/6/2018 16:21:27 meta:
19/6/2018 16:21:27 { config: [Object],
19/6/2018 16:21:27 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:27 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:27 'tag$': 'seneca~mesh',
19/6/2018 16:21:27 'v$': 0 },
19/6/2018 16:21:27 incarnation: 1529418087269 } }
19/6/2018 16:21:30SNEEZE 90298 joining 7 10.88.250.29:49483 60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604 seneca~mesh [ 'nanoservices-base1:39999', '10.42.209.107:39999' ] { joinTimeout: 2777,
19/6/2018 16:21:30 pingTimeout: 2444,
19/6/2018 16:21:30 pingReqTimeout: 2333,
19/6/2018 16:21:30 codec: 'msgpack',
19/6/2018 16:21:30 disseminationFactor: 22,
19/6/2018 16:21:30 interval: 111,
19/6/2018 16:21:30 pingReqGroupSize: 7,
19/6/2018 16:21:30 udp: { maxDgramSize: 2048 },
19/6/2018 16:21:30 local:
19/6/2018 16:21:30 { host: '10.88.250.29:49483',
19/6/2018 16:21:30 meta:
19/6/2018 16:21:30 { config: [Object],
19/6/2018 16:21:30 instance: '60226afpvh7z/1529418068191/11/3.6.0/profiles',
19/6/2018 16:21:30 'identifier$': '60226afpvh7z/1529418068191/11/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529418068604',
19/6/2018 16:21:30 'tag$': 'seneca~mesh',
19/6/2018 16:21:30 'v$': 0 },
19/6/2018 16:21:30 incarnation: 1529418090298 } }
19/6/2018 16:21:30 ERR - Error: seneca: Action name:mesh,plugin:define,role:seneca,seq:2,tag:undefined failed: [TIMEOUT].
19/6/2018 16:21:30 ERR - Error: seneca: Action cmd:listen,role:transport failed: [TIMEOUT].
19/6/2018 16:21:30/home/dockerfileUser/node_modules/seneca/lib/common.js:278
19/6/2018 16:21:30 throw error(err, '[DEATH LOOP] die count: ' + diecount)
19/6/2018 16:21:30 ^
19/6/2018 16:21:30
19/6/2018 16:21:30Error: [TIMEOUT]
19/6/2018 16:21:30 at Object.act_tm [as ontm] (/home/dockerfileUser/node_modules/seneca/seneca.js:923:52)
19/6/2018 16:21:30 at Timeout.timeout_check [as _onTimeout] (/home/dockerfileUser/node_modules/gate-executor/gate-executor.js:216:16)
19/6/2018 16:21:30 at ontimeout (timers.js:475:11)
19/6/2018 16:21:30 at tryOnTimeout (timers.js:310:5)
19/6/2018 16:21:30 at Timer.listOnTimeout (timers.js:270:5)
很明显,在两端都可以看到相同的加入请求,但是出于某些奇怪的原因,他们不同意加入网格。
作为参考,这是在本地运行的日志:
[profiles - 70833]: SNEEZE 86079 joining 0 127.0.0.1:42294 uemigxtf6h6w/1529417884911/70833/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529417886077 seneca~mesh [ '127.0.0.1:39999', '127.0.0.1:39001' ] { joinTimeout:2777,
[profiles - 70833]: pingTimeout: 2444,
[profiles - 70833]: pingReqTimeout: 2333,
[profiles - 70833]: codec: 'msgpack',
[profiles - 70833]: disseminationFactor: 22,
[profiles - 70833]: interval: 111,
[profiles - 70833]: pingReqGroupSize: 7,
[profiles - 70833]: udp: { maxDgramSize: 2048 },
[profiles - 70833]: local:
[profiles - 70833]: { host: '127.0.0.1:42294',
[profiles - 70833]: meta:
[profiles - 70833]: { config: [Object],
[profiles - 70833]: instance: 'uemigxtf6h6w/1529417884911/70833/3.6.0/profiles',
[profiles - 70833]: 'identifier$':
[profiles - 70833]: 'uemigxtf6h6w/1529417884911/70833/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529417886077',
[profiles - 70833]: 'tag$': 'seneca~mesh',
[profiles - 70833]: 'v$': 0 },
[profiles - 70833]: incarnation: 1529417886079 } }
[base0 - 70753]: SNEEZE 86089 add 127.0.0.1:42294 uemigxtf6h6w/1529417884911/70833/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529417886077 seneca~mesh { config:
[base0 - 70753]: { type: 'web',
[base0 - 70753]: port: 59881,
[base0 - 70753]: host: '0.0.0.0',
[base0 - 70753]: path: '/act',
[base0 - 70753]: protocol: 'http',
[base0 - 70753]: timeout: 5555,
[base0 - 70753]: max_listen_attempts: 11,
[base0 - 70753]: attempt_delay: 222,
[base0 - 70753]: serverOptions: {},
[base0 - 70753]: pin:
[base0 - 70753]: [ 'cmd:*,role:profile',
[base0 - 70753]: 'cmd:probes.get,role:profile',
[base0 - 70753]: 'cmd:campaigns.get,role:profile',
[base0 - 70753]: 'cmd:universes.get,role:profile',
[base0 - 70753]: 'cmd:probes.del,role:profile',
[base0 - 70753]: 'cmd:campaigns.del,role:profile',
[base0 - 70753]: 'cmd:universes.del,role:profile' ],
[base0 - 70753]: model: 'consume',
[base0 - 70753]: ismesh: true,
[base0 - 70753]: msgprefix: 'seneca_',
[base0 - 70753]: callmax: 111111,
[base0 - 70753]: msgidlen: 12,
[base0 - 70753]: role: 'transport',
[base0 - 70753]: hook: 'listen' },
[base0 - 70753]: instance: 'uemigxtf6h6w/1529417884911/70833/3.6.0/profiles',
[base0 - 70753]: 'identifier$':
[base0 - 70753]: 'uemigxtf6h6w/1529417884911/70833/3.6.0/profiles~cmd:*,role:profile,cmd:probes.get,role:profile,cmd:campaigns.get,role:profile,cmd:universes.get,role:profile,cmd:probes.del,role:profile,cmd:campaigns.del,role:profile,cmd:universes.del,role:profile~1529417886077',
[base0 - 70753]: 'tag$': 'seneca~mesh',
[base0 - 70753]: 'v$': 0 }
[profiles - 70833]: SNEEZE 86139 add 127.0.0.1:39999 8tcsh6vibtus/1529417858791/70753/3.6.0/base0~cmd:test,role:mesh~1529417859689 seneca~mesh { config:
[profiles - 70833]: { type: 'web',
[profiles - 70833]: port: 53238,
[profiles - 70833]: host: '0.0.0.0',
[profiles - 70833]: path: '/act',
[profiles - 70833]: protocol: 'http',
[profiles - 70833]: timeout: 5555,
[profiles - 70833]: max_listen_attempts: 11,
[profiles - 70833]: attempt_delay: 222,
[profiles - 70833]: serverOptions: {},
[profiles - 70833]: pin: [ 'cmd:test,role:mesh' ],
[profiles - 70833]: model: 'consume',
[profiles - 70833]: ismesh: true,
[profiles - 70833]: msgprefix: 'seneca_',
[profiles - 70833]: callmax: 111111,
[profiles - 70833]: msgidlen: 12,
[profiles - 70833]: role: 'transport',
[profiles - 70833]: hook: 'listen' },
[profiles - 70833]: instance: '8tcsh6vibtus/1529417858791/70753/3.6.0/base0',
[profiles - 70833]: 'identifier$':
[profiles - 70833]: '8tcsh6vibtus/1529417858791/70753/3.6.0/base0~cmd:test,role:mesh~1529417859689',
[profiles - 70833]: 'tag$': 'seneca~mesh',
[profiles - 70833]: 'v$': 0 }
[profiles - 70833]: Joined the mesh: { id: 'uemigxtf6h6w/1529417884911/70833/3.6.0/profiles',
[profiles - 70833]: tag: 'profiles',
[profiles - 70833]: start: 1529417884911 }
[profiles - 70833]: Deferred services loaded
正如我所说,我尝试了超时和注册方法的所有可能组合,在它们的gitter通道上寻求帮助,我阅读了所使用的两个主要库的源代码,但我找不到答案。我知道有些用户面临着与牧场主类似的问题,如下所述: https://github.com/senecajs/seneca-mesh/issues/75(顺便说一句,最后一条评论是我的),但他们至少能够在牧场主上运行基本网格,我什至无法达到这一点。