Name Date Size

..11-Feb-20204 KiB

.gitignoreH A D11-Feb-2020798

.travis.ymlH A D11-Feb-2020158

config/H11-Feb-20204 KiB

configure.acH A D11-Feb-20201.8 KiB

include/libvbucket/H11-Feb-20204 KiB

libvbucket.pc.inH A D11-Feb-2020245

LICENSEH A D11-Feb-202011.1 KiB

m4/H11-Feb-20204 KiB

Makefile.amH A D11-Feb-20202.8 KiB

NMakefileH A D11-Feb-20204.8 KiB

packaging/H11-Feb-20204 KiB

README.markdownH A D11-Feb-20203.7 KiB

src/H11-Feb-20204 KiB

tests/H11-Feb-20204 KiB

win32/H11-Feb-20204 KiB

README.markdown

1libvbucket: a vbucket library for memcached
2===========================================
3
4Config Syntax
5-------------
6
7libvbucket uses JSON for it's configuration format. The directory
8`tests/config` contains sample configurations for [vbucket][1] and
9[ketama][2] distribution algorithms taken from a live Couchbase
10cluster.
11
12Envelope Section
13----------------
14
15Configurations can have an optional envelope. If it is absent,
16libvbucket will treat the config stream as a VBucket section.
17
18### name
19
20The username which should be used for nodes.  This will be used for both
21authentication in HTTP and over memcached binary protocol.  Note that 
22"default" is a special bucket which does not use HTTP auth or memcached
23protocol auth.  Specifying "default" and empty string for password will
24configure the client to use the default bucket.
25
26    "name": "default",
27
28### saslPassword
29
30The password which should be used for nodes, which need authentication.
31
32    "saslPassword": "",
33
34### nodeLocator
35
36The distribution algorithm which will be used to map keys to nodes. If this
37field is absent the `vbucket` locator will be used. The possible values
38are `ketama` and `vbucket`.
39
40    "nodeLocator": "vbucket",
41
42### vBucketServerMap
43
44The section which describes the vbucket configuration. See the "VBucket
45Section" below.
46
47### nodes
48
49The list of objects which describe the nodes in the cluster. The
50parser will look for `couchApiBase`, `hostname` and `ports` fields in
51this entry.
52
53* hostname
54
55  The hostname and port of the cluster's REST interface.
56
57      "hostname": "172.16.16.76:8091",
58
59* couchApiBase
60
61  The endpoint for CouchDB REST interface. This endpoint should be used
62  for Couch view execution.
63
64      "couchApiBase": "http://172.16.16.76:8091/default",
65
66* ports
67
68  List of node ports. Currenty it contains `direct` and `proxy` port to
69  connect to the node using memcached protocol. The proxy port could be
70  used for vbucket unaware, legacy clients.
71
72      "ports": {
73        "proxy": 11211,
74        "direct": 11210
75      },
76
77VBucket Section
78---------------
79
80The configuration string is JSON.
81
82Example:
83
84    {
85      "hashAlgorithm": "CRC",
86      "numReplicas": 2,
87      "serverList": ["server1:11211", "server2:11210", "server3:11211"],
88      "vBucketMap":
89        [
90          [0, 1, 2],
91          [1, 2, 0],
92          [2, 1, -1],
93          [1, 2, 0]
94        ]
95    }
96
97### hashAlgorithm
98
99The hash algorithm can be in upper or lower case. libvbucket currently
100uses a CRC32 hashing algorithm, a good general purpose hash for short
101strings.  The hash algorithm will typically be ketama for memcached
102type buckets.
103
104### numReplicas
105
106numReplicas is the number of extra copies that will be stored on
107servers. Each vBucket in vBucketMap must have this number of server
108indexes plus one (the master server).
109
110### serverList
111
112This has one string per server, in whatever format your app expects a
113server config string in. This may change to be more structured later.
114
115### vBucketMap
116
117This contains one entry per vBucket, and the number of entries must be
118a power of two. Each entry must be an array of `numReplicas+1`
119zero-based indices into serverList, with the first entry indicating
120the master server for the bucket and the remaining entries specifying
121the replicas, in order. `-1` indicates that no server is mapped for that
122particular master/replica of that particular vBucket.
123
124Note there is also a vBucketMapForward which can be sent by the server
125in the case that changes are occurring.  The vBucketMapForward indicates
126what the future state of the cluster layout will be.
127
128[1]: https://github.com/membase/libvbucket/blob/master/tests/config/vbucket-eight-nodes
129[2]: https://github.com/membase/libvbucket/blob/master/tests/config/ketama-eight-nodes
130