• Home
  • History
  • Annotate
  • only in this directory
Name Date Size

..19-Aug-20204 KiB

action/H19-Aug-20204 KiB

CMakeLists.txtH A D19-Aug-20201.4 KiB

cmd/gometa/H19-Aug-20204 KiB

common/H19-Aug-20204 KiB

GNUmakefileH A D19-Aug-2020211

LICENSEH A D19-Aug-202011.1 KiB

log/H19-Aug-20204 KiB

message/H19-Aug-20204 KiB

protocol/H19-Aug-20204 KiB

README.mdH A D19-Aug-20203.5 KiB

repository/H19-Aug-20204 KiB

server/H19-Aug-20204 KiB

README.md

1
2I) INTRODUCTION
3---------------
4
5Gometa is a GO implementation of a distributed metadata store. Gometa uses zookeeper Zab protocol for leader election and quorum write.  
6
7Zookeeper is battle tested consensus protocol, being used in big deployment such as linked-in and Netflix.  Papers regarding zookeeper:
8
9http://www.tcs.hut.fi/Studies/T-79.5001/reports/2012-deSouzaMedeiros.pdf
10
11https://www.usenix.org/legacy/event/usenix10/tech/full_papers/Hunt.pdf
12
13http://web.stanford.edu/class/cs347/reading/zab.pdf
14
15II) BUILD
16---------
17
18Build the main.go
19
20	cd $GOPATH/src
21	mkdir -r github.com/couchbase
22	cd github.com/couchbase
23	git clone git@github.com:couchbase/gometa.git
24	go build -o $GOPATH/bin/gometa gometa/server/main/main.go
25
26You can then run bin/main as either a client or server. 
27
28A) Run As Server
29----------------
30
31To run as server, you will need a ensemble of processes.   Each process requires 3 ports:
32
331) a UDP port for leader election
34
352) a TCP port to send messages with the leader of the ensemble
36
373) a TCP port to receive request from client
38
39For each process, you can specify the ports of the ensemble as a configuration file.  The configuration file has 2 main sections:
40
411) Host - This section specify the 3 ports used by the server process.
42
432) Peer - This section specify the UDP (election) port and the TCP (message) port for the other processes in the ensemble.  
44
45{
46
47    "Host" : {
48
49	       	"ElectionAddr" : "localhost:5001",
50
51	        "MessageAddr"  : "localhost:5002",
52
53	        "RequestAddr"  : "localhost:5003"
54
55		    },
56
57    "Peer" : [
58
59	        {"ElectionAddr" : "localhost:6001",
60
61	         "MessageAddr"  : "localhost:6002"},
62
63            {"ElectionAddr" : "localhost:7001",
64
65		     "MessageAddr"  : "localhost:7002}
66
67     ]
68
69}
70
71You can then start the process as follow
72
73	$GOPATh/bin/gometa -config="<config file path>"
74
75Once you start this process, it will run leader election and try to connect to the other processes (localhost:6001 and localhost:7001).  The leader
76election will select the leader from this ensemble.   The other 2 processes will act as followers.
77
78You would want to run each process in a different directory, since each process will create a database file (of the same name).  So you want the
79database file to be in different directory.
80
81
82B) Run As Client
83----------------
84
85To run the manual test client, you will also need to specify the configuration file which specify the request port of the processes in the ensemble:
86
87{
88
89    "Peer" : [
90
91	       	{"RequestAddr" : "localhost:5003"},
92
93		    {"RequestAddr" : "localhost:6003"},
94
95		    {"RequestAddr" : "localhost:7003"}
96
97    ]
98
99}
100
101You can start the test client as follows:
102
103main -client=true -config="config.json"
104
105Once the client has started, it will ask you which process to connect you.  You can choose any of the process in the ensemble to process client request.
106
107The client support 4 commands (Add, Set, Delete, Get).   For Add and Set, you can also specify the iteration count and the client will send out a series of calls to the server iteratively.
108
109III) DEPENDENCY 
110---------------
111
112The metadata store uses forestdb.  You will need to get forestdb as well as goforestdb (forestdb GO wrapper).  It also uses protobuf for messaging.
113
114go get github.com/couchbase/goforestdb
115
116go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
117
118IV) KEY BACKLOG
119----------------
120
1211) Support CAS
122
1232) Suport learner
124
1253) Support ns-server
126
1274) Dynamic Configuration (add or remove node)
128
1295) Compaction on commit log
130
1316) Rolling upgrade
132
133