Skip to content
Snippets Groups Projects
Commit d5a8b3dc authored by Pawan Rawal's avatar Pawan Rawal
Browse files

Merge pull request #70 from dgraph-io/protobuffers

Protobuffers
parents e3835e81 0d4dbd41
No related branches found
No related tags found
No related merge requests found
...@@ -92,14 +92,14 @@ $ tar -xzvf postings.tar.gz -C $DIR ...@@ -92,14 +92,14 @@ $ tar -xzvf postings.tar.gz -C $DIR
``` ```
For quick testing, you can bring up 3 different processes of DGraph. You can of course, also set this up across multiple servers. For quick testing, you can bring up 3 different processes of DGraph. You can of course, also set this up across multiple servers.
``` ```
go build . && ./server --instanceIdx 0 --mutations $DIR/m0 --port "8080" --postings $DIR/p0 --workers ":12345,:12346,:12347" --uids $DIR/uasync.final --workerport ":12345" & go build . && ./server --instanceIdx 0 --mutations $DIR/m0 --port 8080 --postings $DIR/p0 --workers ":12345,:12346,:12347" --uids $DIR/uasync.final --workerport ":12345" &
go build . && ./server --instanceIdx 1 --mutations $DIR/m1 --port "8081" --postings $DIR/p1 --workers ":12345,:12346,:12347" --workerport ":12346" & go build . && ./server --instanceIdx 1 --mutations $DIR/m1 --port 8082 --postings $DIR/p1 --workers ":12345,:12346,:12347" --workerport ":12346" &
go build . && ./server --instanceIdx 2 --mutations $DIR/m2 --port "8082" --postings $DIR/p2 --workers ":12345,:12346,:12347" --workerport ":12347" & go build . && ./server --instanceIdx 2 --mutations $DIR/m2 --port 8084 --postings $DIR/p2 --workers ":12345,:12346,:12347" --workerport ":12347" &
``` ```
Now you can run any of the queries mentioned in [Test Queries](https://github.com/dgraph-io/dgraph/wiki/Test-Queries). Now you can run any of the queries mentioned in [Test Queries](https://github.com/dgraph-io/dgraph/wiki/Test-Queries).
You can hit any of the 3 processes, they'll produce the same results. You can hit any of the 3 processes, they'll produce the same results.
`curl localhost:8081/query -XPOST -d '{}'` `curl localhost:8080/query -XPOST -d '{}'`
## Installation ## Installation
Best way to do this is to refer to [Dockerfile](Dockerfile), which has the most complete Best way to do this is to refer to [Dockerfile](Dockerfile), which has the most complete
......
/*
* Copyright 2016 DGraph Labs, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"flag"
"fmt"
"golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/dgraph-io/dgraph/query/pb"
"github.com/dgraph-io/dgraph/x"
)
var glog = x.Log("client")
var ip = flag.String("ip", "127.0.0.1:8081", "Port to communicate with server")
var query = flag.String("query", "", "Query sent to the server")
func main() {
flag.Parse()
// TODO(pawan): Pick address for server from config
conn, err := grpc.Dial(*ip, grpc.WithInsecure())
if err != nil {
x.Err(glog, err).Fatal("DialTCPConnection")
}
defer conn.Close()
c := pb.NewDGraphClient(conn)
r, err := c.Query(context.Background(), &pb.GraphRequest{Query: *query})
if err != nil {
x.Err(glog, err).Fatal("Error in getting response from server")
}
// TODO(pawan): Remove this later
fmt.Printf("Subgraph %+v", r)
}
// Code generated by protoc-gen-go.
// source: graphresponse.proto
// DO NOT EDIT!
/*
Package pb is a generated protocol buffer package.
It is generated from these files:
graphresponse.proto
It has these top-level messages:
UidList
Result
GraphRequest
GraphResponse
*/
package pb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
const _ = proto.ProtoPackageIsVersion1
type UidList struct {
Uids []uint64 `protobuf:"varint,1,rep,name=uids" json:"uids,omitempty"`
}
func (m *UidList) Reset() { *m = UidList{} }
func (m *UidList) String() string { return proto.CompactTextString(m) }
func (*UidList) ProtoMessage() {}
func (*UidList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
type Result struct {
Values [][]byte `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
Uidmatrix []*UidList `protobuf:"bytes,2,rep,name=uidmatrix" json:"uidmatrix,omitempty"`
}
func (m *Result) Reset() { *m = Result{} }
func (m *Result) String() string { return proto.CompactTextString(m) }
func (*Result) ProtoMessage() {}
func (*Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *Result) GetUidmatrix() []*UidList {
if m != nil {
return m.Uidmatrix
}
return nil
}
type GraphRequest struct {
Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"`
}
func (m *GraphRequest) Reset() { *m = GraphRequest{} }
func (m *GraphRequest) String() string { return proto.CompactTextString(m) }
func (*GraphRequest) ProtoMessage() {}
func (*GraphRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
type GraphResponse struct {
Attribute string `protobuf:"bytes,1,opt,name=attribute" json:"attribute,omitempty"`
Result *Result `protobuf:"bytes,2,opt,name=result" json:"result,omitempty"`
Children []*GraphResponse `protobuf:"bytes,3,rep,name=children" json:"children,omitempty"`
}
func (m *GraphResponse) Reset() { *m = GraphResponse{} }
func (m *GraphResponse) String() string { return proto.CompactTextString(m) }
func (*GraphResponse) ProtoMessage() {}
func (*GraphResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *GraphResponse) GetResult() *Result {
if m != nil {
return m.Result
}
return nil
}
func (m *GraphResponse) GetChildren() []*GraphResponse {
if m != nil {
return m.Children
}
return nil
}
func init() {
proto.RegisterType((*UidList)(nil), "pb.UidList")
proto.RegisterType((*Result)(nil), "pb.Result")
proto.RegisterType((*GraphRequest)(nil), "pb.GraphRequest")
proto.RegisterType((*GraphResponse)(nil), "pb.GraphResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion2
// Client API for DGraph service
type DGraphClient interface {
Query(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error)
}
type dGraphClient struct {
cc *grpc.ClientConn
}
func NewDGraphClient(cc *grpc.ClientConn) DGraphClient {
return &dGraphClient{cc}
}
func (c *dGraphClient) Query(ctx context.Context, in *GraphRequest, opts ...grpc.CallOption) (*GraphResponse, error) {
out := new(GraphResponse)
err := grpc.Invoke(ctx, "/pb.DGraph/Query", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for DGraph service
type DGraphServer interface {
Query(context.Context, *GraphRequest) (*GraphResponse, error)
}
func RegisterDGraphServer(s *grpc.Server, srv DGraphServer) {
s.RegisterService(&_DGraph_serviceDesc, srv)
}
func _DGraph_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GraphRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DGraphServer).Query(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.DGraph/Query",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DGraphServer).Query(ctx, req.(*GraphRequest))
}
return interceptor(ctx, in, info, handler)
}
var _DGraph_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.DGraph",
HandlerType: (*DGraphServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Query",
Handler: _DGraph_Query_Handler,
},
},
Streams: []grpc.StreamDesc{},
}
var fileDescriptor0 = []byte{
// 255 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x90, 0x4f, 0x4b, 0xc4, 0x30,
0x10, 0xc5, 0xed, 0xfe, 0x89, 0x76, 0x76, 0x05, 0x1d, 0x45, 0x8a, 0x28, 0x48, 0xf0, 0xb0, 0x1e,
0xec, 0x61, 0xbd, 0xf8, 0x01, 0x04, 0x0f, 0x7a, 0x71, 0xc0, 0x0f, 0xd0, 0xda, 0xe0, 0x06, 0xea,
0x36, 0x26, 0xa9, 0xe8, 0xcd, 0x8f, 0xee, 0x34, 0x09, 0xae, 0xb2, 0xb7, 0x99, 0xbc, 0x97, 0xf7,
0x7e, 0x0c, 0x1c, 0xbd, 0xda, 0xca, 0xac, 0xac, 0x72, 0xa6, 0x5b, 0x3b, 0x55, 0x1a, 0xdb, 0xf9,
0x0e, 0x47, 0xa6, 0x96, 0xe7, 0xb0, 0xfb, 0xac, 0x9b, 0x47, 0xed, 0x3c, 0x22, 0x4c, 0x7a, 0xdd,
0xb8, 0x22, 0xbb, 0x18, 0x2f, 0x26, 0x14, 0x66, 0xf9, 0x00, 0x82, 0x94, 0xeb, 0x5b, 0x8f, 0x27,
0x20, 0x3e, 0xaa, 0xb6, 0x57, 0x51, 0x9f, 0x53, 0xda, 0xf0, 0x0a, 0x72, 0x76, 0xbe, 0x55, 0xde,
0xea, 0xcf, 0x62, 0xc4, 0xd2, 0x6c, 0x39, 0x2b, 0x4d, 0x5d, 0xa6, 0x54, 0xda, 0xa8, 0xf2, 0x12,
0xe6, 0xf7, 0x03, 0x06, 0xa9, 0x77, 0xfe, 0xe9, 0xf1, 0x18, 0xa6, 0x3c, 0xd8, 0x2f, 0x4e, 0xcc,
0x16, 0x39, 0xc5, 0x45, 0x7e, 0x67, 0xb0, 0x9f, 0x6c, 0x91, 0x16, 0xcf, 0x20, 0xaf, 0x3c, 0x27,
0xd4, 0xbd, 0x57, 0xc9, 0xbb, 0x79, 0x40, 0x09, 0xc2, 0x06, 0x44, 0x6e, 0xcf, 0xb8, 0x1d, 0x86,
0xf6, 0x08, 0x4d, 0x49, 0xc1, 0x6b, 0xd8, 0x7b, 0x59, 0xe9, 0xb6, 0xb1, 0x6a, 0x5d, 0x8c, 0x03,
0xe3, 0xe1, 0xe0, 0xfa, 0x57, 0x43, 0xbf, 0x96, 0xe5, 0x2d, 0x88, 0xbb, 0xa0, 0x61, 0x09, 0xd3,
0xa7, 0x81, 0x0a, 0x0f, 0xfe, 0xf8, 0x03, 0xfd, 0xe9, 0x76, 0x82, 0xdc, 0xa9, 0x45, 0xb8, 0xec,
0xcd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd9, 0x42, 0x7b, 0x6e, 0x70, 0x01, 0x00, 0x00,
}
syntax="proto3";
package pb;
service DGraph {
rpc Query (GraphRequest) returns (GraphResponse) {}
}
message UidList {
repeated uint64 uids = 1;
}
message Result {
repeated bytes values = 1;
repeated UidList uidmatrix = 2;
}
message GraphRequest {
string query = 1;
}
message GraphResponse {
string attribute = 1;
Result result = 2;
repeated GraphResponse children = 3; // Each node can have multiple children
}
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/dgraph-io/dgraph/gql" "github.com/dgraph-io/dgraph/gql"
"github.com/dgraph-io/dgraph/posting" "github.com/dgraph-io/dgraph/posting"
"github.com/dgraph-io/dgraph/query/pb"
"github.com/dgraph-io/dgraph/task" "github.com/dgraph-io/dgraph/task"
"github.com/dgraph-io/dgraph/worker" "github.com/dgraph-io/dgraph/worker"
"github.com/dgraph-io/dgraph/x" "github.com/dgraph-io/dgraph/x"
...@@ -251,6 +252,75 @@ func (g *SubGraph) ToJson(l *Latency) (js []byte, rerr error) { ...@@ -251,6 +252,75 @@ func (g *SubGraph) ToJson(l *Latency) (js []byte, rerr error) {
return json.Marshal(r) return json.Marshal(r)
} }
// This method take in a flatbuffer result, extracts values and uids from it
// and converts it to a protocol buffer result
func extract(r *task.Result) (*pb.Result, error) {
var result = &pb.Result{}
var ul task.UidList
for i := 0; i < r.UidmatrixLength(); i++ {
if ok := r.Uidmatrix(&ul, i); !ok {
return result, fmt.Errorf("While parsing UidList")
}
uidList := &pb.UidList{}
for j := 0; j < ul.UidsLength(); j++ {
uid := ul.Uids(j)
uidList.Uids = append(uidList.Uids, uid)
}
result.Uidmatrix = append(result.Uidmatrix, uidList)
}
var tv task.Value
for i := 0; i < r.ValuesLength(); i++ {
if ok := r.Values(&tv, i); !ok {
return result, fmt.Errorf("While parsing value")
}
var ival interface{}
if err := posting.ParseValue(&ival, tv.ValBytes()); err != nil {
return result, err
}
if ival == nil {
ival = ""
}
result.Values = append(result.Values, []byte(ival.(string)))
}
return result, nil
}
// This method performs a pre traversal on a subgraph and converts it to a
// protocol buffer Graph Response.
func (g *SubGraph) PreTraverse() (gr *pb.GraphResponse, rerr error) {
gr = &pb.GraphResponse{}
if len(g.query) == 0 {
return gr, nil
}
gr.Attribute = g.Attr
ro := flatbuffers.GetUOffsetT(g.result)
r := new(task.Result)
r.Init(g.result, ro)
result, err := extract(r)
if err != nil {
return gr, err
}
gr.Result = result
for _, child := range g.Children {
childPb, err := child.PreTraverse()
if err != nil {
x.Err(glog, err).Error("Error while traversal")
return gr, err
}
gr.Children = append(gr.Children, childPb)
}
return gr, nil
}
func treeCopy(gq *gql.GraphQuery, sg *SubGraph) { func treeCopy(gq *gql.GraphQuery, sg *SubGraph) {
for _, gchild := range gq.Children { for _, gchild := range gq.Children {
dst := new(SubGraph) dst := new(SubGraph)
......
...@@ -319,3 +319,75 @@ func TestToJson(t *testing.T) { ...@@ -319,3 +319,75 @@ func TestToJson(t *testing.T) {
} }
fmt.Printf(string(js)) fmt.Printf(string(js))
} }
func TestPreTraverse(t *testing.T) {
dir, _ := populateGraph(t)
defer os.RemoveAll(dir)
query := `
{
me(_uid_:0x01) {
name
gender
status
friend {
name
}
}
}
`
gq, _, err := gql.Parse(query)
if err != nil {
t.Error(err)
}
sg, err := ToSubGraph(gq)
if err != nil {
t.Error(err)
}
ch := make(chan error)
go ProcessGraph(sg, ch)
err = <-ch
if err != nil {
t.Error(err)
}
ugr, err := sg.PreTraverse()
if err != nil {
t.Error(err)
}
if len(ugr.Children) != 4 {
t.Errorf("Expected len 4. Got: %v", ugr.Children)
}
child := ugr.Children[0]
if child.Attribute != "name" {
t.Errorf("Expected attr name. Got: %v", child.Attribute)
}
if string(child.Result.Values[0]) != "Michonne" {
t.Errorf("Expected value Michonne. Got %v",
string(child.Result.Values[0]))
}
child = ugr.Children[3]
if child.Attribute != "friend" {
t.Errorf("Expected attr friend. Got: %v", child.Attribute)
}
uids := child.Result.Uidmatrix[0].Uids
if uids[0] != 23 || uids[1] != 24 || uids[2] != 25 || uids[3] != 31 ||
uids[4] != 101 {
t.Errorf("Friend ids don't match")
}
// To check for name of friends
child = child.Children[0]
if child.Attribute != "name" {
t.Errorf("Expected attr friend. Got: %v", child.Attribute)
}
names := child.Result.Values
if string(names[0]) != "Rick Grimes" || string(names[1]) != "Glenn Rhee" ||
string(names[2]) != "Daryl Dixon" || string(names[3]) != "Andrea" {
t.Errorf("Names don't match")
}
}
...@@ -21,16 +21,22 @@ import ( ...@@ -21,16 +21,22 @@ import (
"flag" "flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"net"
"net/http" "net/http"
"runtime" "runtime"
"strings" "strings"
"time" "time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/dgraph-io/dgraph/commit" "github.com/dgraph-io/dgraph/commit"
"github.com/dgraph-io/dgraph/gql" "github.com/dgraph-io/dgraph/gql"
"github.com/dgraph-io/dgraph/posting" "github.com/dgraph-io/dgraph/posting"
"github.com/dgraph-io/dgraph/query" "github.com/dgraph-io/dgraph/query"
"github.com/dgraph-io/dgraph/query/pb"
"github.com/dgraph-io/dgraph/rdf" "github.com/dgraph-io/dgraph/rdf"
"github.com/dgraph-io/dgraph/store" "github.com/dgraph-io/dgraph/store"
"github.com/dgraph-io/dgraph/uid" "github.com/dgraph-io/dgraph/uid"
...@@ -43,7 +49,7 @@ var glog = x.Log("server") ...@@ -43,7 +49,7 @@ var glog = x.Log("server")
var postingDir = flag.String("postings", "", "Directory to store posting lists") var postingDir = flag.String("postings", "", "Directory to store posting lists")
var uidDir = flag.String("uids", "", "XID UID posting lists directory") var uidDir = flag.String("uids", "", "XID UID posting lists directory")
var mutationDir = flag.String("mutations", "", "Directory to store mutations") var mutationDir = flag.String("mutations", "", "Directory to store mutations")
var port = flag.String("port", "8080", "Port to run server on.") var port = flag.Int("port", 8080, "Port to run server on.")
var numcpu = flag.Int("numCpu", runtime.NumCPU(), var numcpu = flag.Int("numCpu", runtime.NumCPU(),
"Number of cores to be used by the process") "Number of cores to be used by the process")
var instanceIdx = flag.Uint64("instanceIdx", 0, var instanceIdx = flag.Uint64("instanceIdx", 0,
...@@ -197,6 +203,71 @@ func queryHandler(w http.ResponseWriter, r *http.Request) { ...@@ -197,6 +203,71 @@ func queryHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, string(js)) fmt.Fprint(w, string(js))
} }
// server is used to implement pb.DGraphServer
type server struct{}
// This method is used to execute the query and return the response to the
// client as a protocol buffer message.
func (s *server) Query(ctx context.Context,
req *pb.GraphRequest) (*pb.GraphResponse, error) {
resp := new(pb.GraphResponse)
if len(req.Query) == 0 {
glog.Error("While reading query")
return resp, fmt.Errorf("Empty query")
}
// TODO(pawan): Refactor query parsing and graph processing code to a common
// function used by Query and queryHandler
glog.WithField("q", req.Query).Debug("Query received.")
gq, _, err := gql.Parse(req.Query)
if err != nil {
x.Err(glog, err).Error("While parsing query")
return resp, err
}
sg, err := query.ToSubGraph(gq)
if err != nil {
x.Err(glog, err).Error("While conversion to internal format")
return resp, err
}
glog.WithField("q", req.Query).Debug("Query parsed.")
rch := make(chan error)
go query.ProcessGraph(sg, rch)
err = <-rch
if err != nil {
x.Err(glog, err).Error("While executing query")
return resp, err
}
glog.WithField("q", req.Query).Debug("Graph processed.")
resp, err = sg.PreTraverse()
if err != nil {
x.Err(glog, err).Error("While converting to protocol buffer.")
return resp, err
}
return resp, err
}
// This function register a DGraph grpc server on the address, which is used
// exchanging protocol buffer messages.
func runGrpcServer(address string) error {
ln, err := net.Listen("tcp", address)
if err != nil {
glog.Fatalf("While running server for client: %v", err)
return err
}
glog.WithField("address", ln.Addr()).Info("Client Worker listening")
s := grpc.NewServer()
pb.RegisterDGraphServer(s, &server{})
if err = s.Serve(ln); err != nil {
glog.Fatalf("While serving gRpc requests", err)
}
return nil
}
func main() { func main() {
flag.Parse() flag.Parse()
if !flag.Parsed() { if !flag.Parsed() {
...@@ -205,9 +276,11 @@ func main() { ...@@ -205,9 +276,11 @@ func main() {
logrus.SetLevel(logrus.InfoLevel) logrus.SetLevel(logrus.InfoLevel)
numCpus := *numcpu numCpus := *numcpu
prev := runtime.GOMAXPROCS(numCpus) prev := runtime.GOMAXPROCS(numCpus)
glog.WithField("num_cpu", numCpus). glog.WithField("num_cpu", numCpus).WithField("prev_maxprocs", prev).
WithField("prev_maxprocs", prev).
Info("Set max procs to num cpus") Info("Set max procs to num cpus")
if *port%2 != 0 {
glog.Fatalf("Port should be an even number: %v", *port)
}
ps := new(store.Store) ps := new(store.Store)
ps.Init(*postingDir) ps.Init(*postingDir)
...@@ -226,7 +299,6 @@ func main() { ...@@ -226,7 +299,6 @@ func main() {
} }
posting.Init(clog) posting.Init(clog)
if *instanceIdx != 0 { if *instanceIdx != 0 {
worker.Init(ps, nil, *instanceIdx, lenAddr) worker.Init(ps, nil, *instanceIdx, lenAddr)
uid.Init(nil) uid.Init(nil)
...@@ -240,10 +312,12 @@ func main() { ...@@ -240,10 +312,12 @@ func main() {
} }
worker.Connect(addrs) worker.Connect(addrs)
// Grpc server runs on (port + 1)
runGrpcServer(fmt.Sprintf(":%d", *port+1))
http.HandleFunc("/query", queryHandler) http.HandleFunc("/query", queryHandler)
glog.WithField("port", *port).Info("Listening for requests...") glog.WithField("port", *port).Info("Listening for requests...")
if err := http.ListenAndServe(":"+*port, nil); err != nil { if err := http.ListenAndServe(fmt.Sprintf(":%d", *port), nil); err != nil {
x.Err(glog, err).Fatal("ListenAndServe") x.Err(glog, err).Fatal("ListenAndServe")
} }
} }
dir="/dgraph" dir="/dgraph"
go build . && ./server --instanceIdx 0 --mutations $dir/m0 --port "8080" --postings $dir/p0 --workers ":12345,:12346,:12347" --uids $dir/uasync.final --workerport ":12345" & go build . && ./server --instanceIdx 0 --mutations $dir/m0 --port 8080 --postings $dir/p0 --workers ":12345,:12346,:12347" --uids $dir/uasync.final --workerport ":12345" &
go build . && ./server --instanceIdx 1 --mutations $dir/m1 --port "8081" --postings $dir/p1 --workers ":12345,:12346,:12347" --workerport ":12346" & go build . && ./server --instanceIdx 1 --mutations $dir/m1 --port 8082 --postings $dir/p1 --workers ":12345,:12346,:12347" --workerport ":12346" &
go build . && ./server --instanceIdx 2 --mutations $dir/m2 --port "8082" --postings $dir/p2 --workers ":12345,:12346,:12347" --workerport ":12347" & go build . && ./server --instanceIdx 2 --mutations $dir/m2 --port 8084 --postings $dir/p2 --workers ":12345,:12346,:12347" --workerport ":12347" &
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment