skynet/services/clusterd.lua中的问题求解 #2011
HelloWorld8887
started this conversation in
General
Replies: 2 comments
-
|
启动的时候直接调用cluster.open("node1")就会报错, 如果: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请问一下,我使用的skynet版本是1.5,在使用cluster的时候调用cluster.open("node1")会报错无法启动,debug到skynet/services/clusterd.lua下面的代码:
local function loadconfig(tmp)
if tmp == nil then
tmp = {}
if config_name then
local f = assert(io.open(config_name))
local source = f:read "*a"
f:close()
assert(load(source, "@"..config_name, "t", tmp))()
end
end
local reload = {}
for name,address in pairs(tmp) do
.......
end
assert(load(source, "@"..config_name, "t", tmp))(),解析cluster配置表,我这边打印tmp={},local tmp=load(...)才会返回正确的配置表,导致后面无法存储结点对应的IP地址。
注:cluster配置表的内容是:
return {
--集群
node1 = "127.0.0.1:2526",
node2 = "127.0.0.1:2527",
}
请问是我哪里使用不对吗?
Beta Was this translation helpful? Give feedback.
All reactions