Closed soarpenguin closed 8 years ago
package main import ( "fmt" "github.com/google/seesaw/ipvs" ) func main() { fmt.Printf("start.............\n") fmt.Printf("%v\n", ipvs.Version()) srvs, err := ipvs.GetServices() if err != nil { fmt.Printf("%s\n", err.Error()) } for _, srv := range srvs { fmt.Printf("%s\n", srv) } fmt.Printf("end.............\n") }
Hello, i use above code to get ipvs services, but failed, get none. the stdout is:
start............. 0.0.0 end.............
i can use ipvsadm get some services:
$ ipvsadm -ln TCP 10.10.19.18:80 rr -> 10.10.35.48:80 Route 100 0 0 -> 10.10.35.49:80 Route 100 0 0 TCP 10.10.19.19:80 rr -> 10.10.26.20:80 Route 100 0 0 -> 10.10.26.21:80 Route 100 0 1 -> 10.10.26.22:80 Route 100 0 0 -> 10.10.26.23:80 Route 100 1 0
@soarpenguin You need to Initialize first: ipvs.Init()
ipvs.Init()
@luizbafilho tks! It's ok now.
Hello, i use above code to get ipvs services, but failed, get none. the stdout is:
i can use ipvsadm get some services: