Skip to content

HeavyHorst/roachbalancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

roachbalancer

roachbalancer is a small experimental cockroachdb load balancer with automatic live-node discovery. The loadbalancer can be embedded or run as a stand-alone application.

Usage

Embedded

func  main()  {
   b  :=  balancer.New("root",  "/certs",  false,  "xxx.xxx.xxx.xxx:26257", "xxx.xxx.xxx.xxx:26257")
   go  b.Listen(0)  //  0  means  random  high  port
   b.WaitReady()

   // now use b.GetAddr() as the cockroachdb address
}

Use the binary

./roachbalancer -certs-dir /certs -node xxx.xxx.xxx.xxx:26257 -node xxx.xxx.xxx.xxx:26257

About

Simple loadbalancer for cockroachdb

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages