// Add a master node func addMaster(netplugin *plugin.NetPlugin, srvInfo core.ServiceInfo) error { // save it in db masterDB[masterKey(srvInfo)] = &srvInfo // tell the plugin about the master return netplugin.AddMaster(srvInfo) }
// Add a master node func addMaster(netplugin *plugin.NetPlugin, srvInfo objdb.ServiceInfo) error { // save it in db MasterDB[masterKey(srvInfo)] = &srvInfo // tell the plugin about the master return netplugin.AddMaster(core.ServiceInfo{ HostAddr: srvInfo.HostAddr, Port: netmasterRPCPort, }) }
// Add a master node func addMaster(netplugin *plugin.NetPlugin, srvInfo objdb.ServiceInfo) error { // save it in db masterDB[masterKey(srvInfo)] = &srvInfo // tell the plugin about the master return netplugin.AddMaster(core.ServiceInfo{ HostAddr: srvInfo.HostAddr, Port: ofnet.OFNET_MASTER_PORT, }) }
func processGlobalFwdModeUpdEvent(netPlugin *plugin.NetPlugin, opts core.InstanceInfo, fwdMode string) { // parse store URL parts := strings.Split(opts.DbURL, "://") if len(parts) < 2 { log.Fatalf("Invalid cluster-store-url %s", opts.DbURL) } stateStore := parts[0] // initialize the config pluginConfig := plugin.Config{ Drivers: plugin.Drivers{ Network: "ovs", State: stateStore, }, Instance: opts, } pluginConfig.Instance.FwdMode = fwdMode netPlugin.GlobalFwdModeUpdate(pluginConfig) for _, master := range cluster.MasterDB { netPlugin.AddMaster(core.ServiceInfo{ HostAddr: master.HostAddr, Port: 9001, //netmasterRPCPort }) } serviceList, _ := cluster.ObjdbClient.GetService("netplugin") for _, serviceInfo := range serviceList { if serviceInfo.HostAddr != opts.VtepIP { netPlugin.AddPeerHost(core.ServiceInfo{ HostAddr: serviceInfo.HostAddr, Port: 4789, //vxlanUDPPort }) } } }