-
Notifications
You must be signed in to change notification settings - Fork 17
/
INSTALL
273 lines (168 loc) · 7.05 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
Contact
=======
If you are experiencing difficulties please visit our Google Groups page:
- group home page: http://groups.google.com/group/keyspace
- group email address: [email protected]
The official Keyspace homepage is at http://scalien.com
For complete installation reference, see
http://scalien.com/documentation/installation.html
Building Keyspace
=================
In order to build Keyspace, you will need
1. gcc, the GNU C++ compiler,
2. GNU make and
3. the BerkeleyDB C++ library.
To install these, issue the following command:
- Debian 4.0
$ sudo apt-get install g++ make libdb4.4++-dev
- Debian 5.0
$ sudo apt-get install g++ make libdb4.6++-dev
- Fedora 10
$ sudo yum install gcc-c++ db4
- Mac OS X 10.4, 10.5 & 10.6
Install the Developer Tools from the MacOS DVD.
Use a port system such as MacPorts or Fink to install Berkeley DB.
$ sudo port install db46
- FreeBSD 7.2
$ cd /usr/ports/databases/db; sudo make install
- OpenBSD 4.5
$ export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/4.5/packages/`machine -a`
$ pkg_add -i db
Select from the interactive menu.
- Windows (XP, 2003 Server, Vista, 2008 Server, Windows 7)
There is a Visual Studio project file included which can be used with the
freely downloadable Visual C++ Express 2008 or later.
For obtaining Berkeley DB, you can use the prepackaged zip file from the
Scalien website which contains the necessary include and lib directories,
and also the precompiled Keyspace and client test binaries.
- Other systems
Edit Makefile.Linux (or Makefile.Darwin) accordingly;
modify INCLUDE and LDPATH according to the location of Berkeley DB in
your system.
After you have set up the neccessary components, you can proceed to
build Keyspace:
- Linux, Mac OS:
$ make
- BSD:
$ gmake
This will create the Keyspace binary 'keyspace' (or 'Keyspace.exe'
on Windows) in the 'bin' folder.
If something went wrong, try 'make clean' before recompiling.
Running Keyspace
================
To launch Keyspace, start it with the included safe script
located at script/safe_keyspaced. On Windows the script is
located at script/safe_keyspaced.cmd.
Usage:
$ script/safe_keyspaced [binary-file] [config-file] [database-dir]
E.g.
$ script/safe_keyspaced bin/keyspaced test/0/keyspace.conf test/0
If you do not specify a conf file, Keyspace will start in single
mode with default configuration. This is a convenience feature
for new users to get started quickly.
See the next section 'Configuration options' for more information
on the keyspace.conf file.
If you want to run more than one instances on the same computer:
$ script/safe_keyspaced bin/keyspaced test/1/keyspace.conf test/1
$ script/safe_keyspaced bin/keyspaced test/2/keyspace.conf test/2
The safe script relaunches Keyspace when a crash occurs or something bad
happens. If you want to stop Keyspace, kill the keyspaced process and
the safe script will terminate too.
Configuration options
=====================
This is a list of possible options in keyspace.conf. You *have* to
specify 'paxos.endpoints' and 'paxos.nodeID', the rest is optional.
We recommend you start out with the default configuration files and
modify them to suit your setup.
For numeric values you may use the K, M, G suffices that mean 1024,
1024^2, 1024^3 respectively.
- paxos.endpoints
List of host:port pairs. REQUIRED.
This value must be the same on all nodes and define the
Keyspace nodes forming the replicated system. If you only list
one node, you are running in single-mode, without replication.
Example: 192.168.0.1:10000, 192.168.0.2:10000, 192.168.0.3:10000
The nodes use 4 consecutive port numbers for Paxos related
protocols, starting with the values defined here. (These are
different than the ports you define below such as http.port, see
Firewall & ports info)
- paxos.nodeID
Number. REQUIRED.
This must be different on all nodes. The first node's ID is 0,
the second's is 1 and so on. If you are running in single-mode, put 0 here.
- io.maxfd
Number. OPTIONAL. Default is 1024.
Roughly equals to the maximum number of connections the server can handle.
- daemon.user
String. OPTIONAL. Default is empty.
Keyspace is running with this user if started as root for security reasons.
- database.dir
Path. OPTIONAL. Default is '.'. BDB related.
The directory where the BerkeleyDB files are stored. If you run multiple
instances on the same host, this must be different for all nodes.
Example: /var/lib/keyspace
- database.pageSize
Number < 65536. OPTIONAL. Default is 4096. BDB related.
Set the page size (in bytes) in the backend database. Leave this alone
unless you know what you're doing.
- database.cacheSize
Number. OPTIONAL. Default is 100M.
Set the cache size in backend database. This is related to how much
memory Keyspace uses for caching.
Example: 100M
- database.logBufferSize
Number. OPTIONAL. Default is 2M. BDB related.
Sets the buffer size for transaction logs.
- database.checkpointTimeout
Number [msec]. OPTIONAL. Default is 60000 msec. BDB related.
Database checkpointing occurs this often.
- database.numReaders
Number. OPTIONAL. Default is 20.
Number of threads used for transactional reads such as lists.
- database.verbose
Boolean. OPTIONAL. Default is false. BDB related.
Turns on BDB verbosity for debugging.
- keyspace.port
Number. OPTIONAL. Default is 7080.
The port of the Keyspace client protocol. If you run multiple instances
on the same host, this must be different for all instances.
- http.port
Number. OPTIONAL. Default is 8080.
The port of the Keyspace HTTP server. If you run multiple instances on
the same host, this must be different for all instances.
- logCache.size
Number. OPTIONAL. Default is 10000.
The number of Paxos rounds cached.
- logCache.maxMem
Number. OPTIONAL. Default is 100M.
Maximum memory allocated for Paxos log cache.
- log.trace
Boolean. OPTIONAL. Default is false.
Whether to print out debug traces.
- log.targets
List of strings. OPTIONAL. Default is stdout. Options are stdout, file and syslog.
More than one can be given, seperated with commas.
Example: stdout, file, syslog
- log.file
Path. OPTIONAL. Default is none.
The path of the log file to use if log.targets = file is given.
- log.timestamping
Boolean. OPTIONAL. Default is false.
Whether to put a timestamp in front of log messages.
Firewall & ports info
=====================
Keyspace uses several ports to communicate with other nodes. These are
the following, with relative offset to the Paxos port (see 'Configuration
options', paxos.endpoints regarding configuration of the Paxos port).
============== =================
port offset name
============== =================
0 Paxos (tcp)
1 PaxosLease (udp)
2 Catchup (tcp)
============== =================
Eg. if you have nodes with Paxos port on 10000/tcp, you need
to open the following ports on your firewall:
10000/tcp, 10001/udp, 10002/tcp
In addition the server ports, you need to open the client protocol
ports too (see 'Configuration options': http.port, keyspace.port).