diff --git a/internal/nodes/node.go b/internal/nodes/node.go index 9afa50e..d785415 100644 --- a/internal/nodes/node.go +++ b/internal/nodes/node.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "errors" + iplib "github.com/TeaOSLab/EdgeCommon/pkg/iplibrary" "github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs" "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" @@ -101,9 +102,6 @@ func (this *Node) Start() { // 监听signal this.listenSignals() - // 启动事件 - events.Notify(events.EventStart) - // 本地Sock err := this.listenSock() if err != nil { @@ -111,9 +109,19 @@ func (this *Node) Start() { return } + // 启动IP库 + remotelogs.Println("NODE", "initializing ip library ...") + err = iplib.Init() + if err != nil { + remotelogs.Error("NODE", "initialize ip library failed: "+err.Error()) + } + // 检查硬盘类型 this.checkDisk() + // 启动事件 + events.Notify(events.EventStart) + // 读取API配置 remotelogs.Println("NODE", "init config ...") err = this.syncConfig(0)