riot icon indicating copy to clipboard operation
riot copied to clipboard

How to achieve distributed?

Open carr123 opened this issue 7 years ago • 2 comments

看特征介绍里面说支持分布式。 riot哪些地方支持分布式,如何分布式的, 怎么使用分布式特性?

谢谢!

carr123 avatar Jul 18 '18 00:07 carr123

Please see the example, you can also implement it yourself, and please speak English.

vcaesar avatar Jul 18 '18 12:07 vcaesar

Hi @vcaesar , I've taken a few looks through the example and am still a little confused about how to proceed. For example:

  • difference between grpcPort, distPort? and why InitGrpc is called twice? (https://github.com/go-ego/riot/blob/master/data/riot1/main.go#L45)
  • is etcd a requirement?
  • how does this work with riot.Engine? can I have an engine set up:
	var e = &riot.Engine{}
	var r = types.EngineOpts{}
	e.Init(r)

and then set up the cluster?

import cluster "github.com/go-ego/riot/net/grpc"

// ...

		cluster.InitEngine(com.Config{
			Engine: com.Engine{
				StoreEngine: e.engineOpts.StoreEngine,
				StoreFolder: e.engineOpts.StoreFolder,
			},
			Rpc: com.Rpc{
				GrpcPort: []string{}, // ??
				DistPort: []string{}, // ??
				Port:     c.Port,
			},
		})
		go cluster.InitGrpc(c.Port)

thanks in advance!

bobheadxi avatar Feb 02 '19 05:02 bobheadxi