jackowayed-tyrantmanager 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,34 @@
1
+ = Changelog
2
+ == Version 1.1.0 2009-08-10
3
+
4
+ * change 'status' command to 'process-status'
5
+ * add 'replication-status' command
6
+ * fix gem dependencies
7
+
8
+ == Version 1.0.9 2009-08-01
9
+
10
+ * First public versioned release
11
+
12
+ == Version 1.0.8
13
+
14
+ * start the instance in the context of its home directory
15
+
16
+ == Version 1.0.7
17
+
18
+ * do not attempt to stop servers where there is no pid file
19
+
20
+ == Version 1.0.6
21
+
22
+ * updates to list command
23
+
24
+ == Version 1.0.4
25
+
26
+ * fix db name on ttserver commandline, make sure opts/mode/etc are correct
27
+
28
+ == Version 1.0.1
29
+
30
+ * fix default home directory in cli
31
+
32
+ == Version 1.0.0
33
+
34
+ * Initial release
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2009, Jeremy Hinegardner
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
9
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,277 @@
1
+ == Tyrant Manager
2
+
3
+ * Homepage[http://copiousfreetime.rubyforge.org/tyrantmanager]
4
+ * {Rubyforge project}[http://rubyforge.org/projects/copiousfreetime/]
5
+ * email jeremy at copiousfreetime dot org
6
+ * github[http://github.com/copiousfreetime/tyrantmanager]
7
+ * git clone git://github.com/copiousfreetime/tyrantmanager.git
8
+
9
+ == INSTALLATION
10
+
11
+ sudo gem install tyrantmanager
12
+
13
+ == SYNOPSIS
14
+
15
+ tyrantmanager (setup|create-instance|start|stop|status|stats|list) [options]+
16
+
17
+ == DESCRIPTION
18
+
19
+ A command line tool for managing Tokyo Tyrant instances. It allows for the
20
+ creation, starting, stopping, listing, stating of many tokyo tyrant instances
21
+ all on the same machine. The commands can be applied to a single or multiple
22
+ instances.
23
+
24
+ === Setup a manager home
25
+
26
+ After installing the gem, you need to setup a tyrant manager home, all the
27
+ tyrant instances are initially relative to this location.
28
+
29
+ jeremy@playground:~ % tyrantmanager setup /tmp/tyrant
30
+ 00:09:06 INFO : Creating directory /tmp/tyrant
31
+ 00:09:06 INFO : Creating default config file /tmp/tyrant/config.rb
32
+ 00:09:06 INFO : Creating directory /tmp/tyrant/instances
33
+ 00:09:06 INFO : Creating directory /tmp/tyrant/log
34
+ 00:09:06 INFO : Creating directory /tmp/tyrant/tmp
35
+
36
+ Once the manager home is setup, all other commands need to know about it.
37
+ This can be achieved in 3 ways.
38
+
39
+ * use the --home option on all commands
40
+ * set the TYRANT_MANAGER_HOME environment variable
41
+ * execute the commands when the current working directory is the tyrant home.
42
+
43
+ === Creating a new tyrant instance
44
+
45
+ Each instances is separate, yet initially relative to to the tyrant manager's
46
+ home.
47
+
48
+ jeremy@playground:/tmp/tyrant % tyrantmanager create-instance foo
49
+ 00:17:55 INFO : Creating instance directory /tmp/tyrant/instances/foo
50
+ 00:17:55 INFO : Creating directory /tmp/tyrant/instances/foo
51
+ 00:17:55 INFO : Creating default config file /tmp/tyrant/instances/foo/config.rb
52
+ 00:17:55 INFO : Creating directory /tmp/tyrant/instances/foo/ulog
53
+ 00:17:55 INFO : Creating directory /tmp/tyrant/instances/foo/data
54
+ 00:17:55 INFO : Creating directory /tmp/tyrant/instances/foo/lua
55
+ 00:17:55 INFO : Creating directory /tmp/tyrant/instances/foo/log
56
+
57
+ This creates a new tyrant instance in the instances directory. There are
58
+ several subdirectories created for you automatically.
59
+
60
+ * data - the actual data file location
61
+ * ulog - where the update logs are kept
62
+ * log - the server logs
63
+ * lua - default location for lua code
64
+
65
+ === Configuring an instance
66
+
67
+ Configuration of a Tyrant instances is in the 'config.rb' file in the instances
68
+ home directory. This all the configuration items that are specific to that
69
+ instance. Take a look through the file, or just execute it to see a nicely
70
+ formatted output of all the current configuration parameters, descriptions,
71
+ and current values. This example just highlights a few of the options.
72
+
73
+ jeremy@playground:/tmp/tyrant/instances/foo % ruby config.rb
74
+ The directory holding the database file. By default this is relative
75
+ to the instance directory. If you want to put it somewhere else, then
76
+ put the full path here.
77
+ - data_dir => "data"
78
+
79
+ The hostname this instance will listen on. The default is all
80
+ - host => "0.0.0.0"
81
+
82
+ [...]
83
+
84
+ Mode of the server in relation to the database. It can be a combination of
85
+ the following:
86
+ w - it is a database writer
87
+ r - it is a database reader
88
+ c - it creates the database if it does not exist
89
+ t - it truncates the database if it does exist
90
+ e - do not lock the database when doing operations
91
+ f - use a non-blocking lock when doing operations
92
+ - mode => "wc"
93
+
94
+ The options for data stored in the database. They include one of the
95
+ compression options:
96
+ d - Deflate
97
+ b - BZIP2
98
+ t - TCBS
99
+ and
100
+ l - allow the database to be larger than 2GB
101
+ - opts => "ld"
102
+
103
+ [...]
104
+
105
+ The type of database this instance will be. Options are:
106
+ memory-hash - an in memory hash database
107
+ memory-tree - an in memory B+ tree database
108
+ hash - an on disk hash database
109
+ tree - an on disk B+ tree database
110
+ fixed - an on disk fixed length database
111
+ table - an on disk table database
112
+ - type => "hash"
113
+
114
+ There are also configuration items in the 'config.rb' in the Manager's home
115
+ directory. These are global defaults for all instances the manager knows about,
116
+ and may be overridden in the instance's 'config.rb' file. Again, just execute
117
+ the configuration file to see all the options, their current set values and
118
+ the documentation.
119
+
120
+ jeremy@playground:/tmp/tyrant % ruby config.rb
121
+ The top directory of the manager directory. This is set with the
122
+ --directory option or it can be set here"
123
+ - home => nil
124
+
125
+ Default settings for tyrant instances. If a tyrant does not explicitly set one of
126
+ these configurations then the default listed here is used. This does not list all
127
+ of the configuration variables, only those that make sense to have defaults for.
128
+ - instance_defaults
129
+
130
+ [...]
131
+
132
+ Run daemonized
133
+ - instance_defaults.daemonize => true
134
+
135
+ [...]
136
+
137
+ The list of locations that contain Tyrant instances. Each element in this array
138
+ either a directory containing instance directories, or an instance directory itself.
139
+ Tyrant Manager will figure out what the case is. If this is unset, then the default
140
+ 'instances' directory below the manager's home directory is used.
141
+ - instances => nil
142
+
143
+ The 'ttserver' command. This will use the first one found in path by default
144
+ or you may explicitly set it here.
145
+ - ttserver => "ttserver"
146
+
147
+ There are a considerable number of configuration options for Tokyo Tyrant and I've done
148
+ my best to document all of them.
149
+
150
+ If you do have more than one instance on a single machine, you'll need to make sure
151
+ to change the port option, otherwise only one instance will run.
152
+
153
+ desc "The port this tyrant will listen on. The default is 1978"
154
+ port 1978
155
+
156
+ === Listing, Controlling instances and Seeing their status
157
+
158
+ Instances may be started and stopped all at once, or individually. On startup,
159
+ the ttserver command line that was used is output.
160
+
161
+ ==== List known instances
162
+
163
+ jeremy@playground:/tmp/tyrant % tyrantmanager list
164
+ bar : port 1979 : /tmp/tyrant/instances/bar
165
+ baz : port 1980 : /tmp/tyrant/instances/baz
166
+ foo : port 1978 : /tmp/tyrant/instances/foo
167
+
168
+ ==== Start all
169
+
170
+ jeremy@playground:/tmp/tyrant % tyrantmanager start
171
+ 00:51:15 INFO : Starting bar : ttserver -host 0.0.0.0 -port 1979 -thnum 8 -tout 15 -dmn -pid /tmp/tyrant/instances/bar/bar.pid -log /tmp/tyrant/instances/bar/log/bar.log -le -ulog /tmp/tyrant/instances/bar/ulog -ulim 1g -rts /tmp/tyrant/instances/bar/bar.rts /tmp/tyrant/instances/bar/data/bar.tch#opts=ld#mode=wc
172
+ 00:51:15 INFO :
173
+ 00:51:15 INFO : Starting baz : ttserver -host 0.0.0.0 -port 1980 -thnum 8 -tout 15 -dmn -pid /tmp/tyrant/instances/baz/baz.pid -log /tmp/tyrant/instances/baz/log/baz.log -le -ulog /tmp/tyrant/instances/baz/ulog -ulim 1g -rts /tmp/tyrant/instances/baz/baz.rts /tmp/tyrant/instances/baz/data/baz.tch#opts=ld#mode=wc
174
+ 00:51:15 INFO :
175
+ 00:51:15 INFO : Starting foo : ttserver -host 0.0.0.0 -port 1978 -thnum 8 -tout 15 -dmn -pid /tmp/tyrant/instances/foo/foo.pid -log /tmp/tyrant/instances/foo/log/foo.log -le -ulog /tmp/tyrant/instances/foo/ulog -ulim 1g -rts /tmp/tyrant/instances/foo/foo.rts /tmp/tyrant/instances/foo/data/foo.tch#opts=ld#mode=wc
176
+ 00:51:15 INFO :
177
+
178
+ As you can see the commandline used to start the tyrant server is output.
179
+
180
+ jeremy@playground:/tmp/tyrant % tyrantmanager status
181
+ 00:52:17 INFO : bar is running as pid 28658
182
+ 00:52:17 INFO : baz is running as pid 28670
183
+ 00:52:17 INFO : foo is running as pid 28682
184
+
185
+ ==== Stop all
186
+
187
+ jeremy@playground:/tmp/tyrant % tyrantmanager stop all
188
+ 00:52:40 INFO : Stopping bar : pid 28658
189
+ 00:52:40 INFO : Sent signal TERM to 28658
190
+ 00:52:40 INFO : Stopping baz : pid 28670
191
+ 00:52:40 INFO : Sent signal TERM to 28670
192
+ 00:52:40 INFO : Stopping foo : pid 28682
193
+ 00:52:40 INFO : Sent signal TERM to 28682
194
+
195
+ And see that they are all done
196
+
197
+ jeremy@playground:/tmp/tyrant % tyrantmanager status
198
+ 00:53:15 INFO : bar is not running, or its pid file is gone
199
+ 00:53:15 INFO : baz is not running, or its pid file is gone
200
+ 00:53:15 INFO : foo is not running, or its pid file is gone
201
+
202
+ ==== Start just foo and baz
203
+
204
+ jeremy@playground:/tmp/tyrant % tyrantmanager start foo,baz
205
+ 00:53:54 INFO : Starting baz : ttserver -host 0.0.0.0 -port 1980 -thnum 8 -tout 15 -dmn -pid /tmp/tyrant/instances/baz/baz.pid -log /tmp/tyrant/instances/baz/log/baz.log -le -ulog /tmp/tyrant/instances/baz/ulog -ulim 1g -rts /tmp/tyrant/instances/baz/baz.rts /tmp/tyrant/instances/baz/data/baz.tch#opts=ld#mode=wc
206
+ 00:53:54 INFO :
207
+ 00:53:54 INFO : Starting foo : ttserver -host 0.0.0.0 -port 1978 -thnum 8 -tout 15 -dmn -pid /tmp/tyrant/instances/foo/foo.pid -log /tmp/tyrant/instances/foo/log/foo.log -le -ulog /tmp/tyrant/instances/foo/ulog -ulim 1g -rts /tmp/tyrant/instances/foo/foo.rts /tmp/tyrant/instances/foo/data/foo.tch#opts=ld#mode=wc
208
+ 00:53:54 INFO :
209
+
210
+ Foo and baz are started, bar is still stopped
211
+
212
+ jeremy@playground:/tmp/tyrant % tyrantmanager status
213
+ 00:54:38 INFO : bar is not running, or its pid file is gone
214
+ 00:54:38 INFO : baz is running as pid 28708
215
+ 00:54:38 INFO : foo is running as pid 28720
216
+
217
+ === Stop just foo
218
+
219
+ jeremy@playground:/tmp/tyrant % tyrantmanager stop foo
220
+ 00:55:33 INFO : Stopping foo : pid 28720
221
+ 00:55:33 INFO : Sent signal TERM to 28720
222
+
223
+ And baz is still running
224
+
225
+ jeremy@playground:/tmp/tyrant % tyrantmanager status
226
+ 00:55:51 INFO : bar is not running, or its pid file is gone
227
+ 00:55:51 INFO : baz is running as pid 28708
228
+ 00:55:51 INFO : foo is not running, or its pid file is gone
229
+
230
+ === Look at the server statistics
231
+
232
+ You can also look at the server statistics of each running instance
233
+
234
+ jeremy@playground:/tmp/tyrant % tyrantmanager stats
235
+ Instance bar at /tmp/tyrant/instances/bar
236
+ bigend.... 0
237
+ fd........ 7
238
+ libver.... 312
239
+ loadavg... 0.030000
240
+ memrss.... 1003520
241
+ memsize... 173633536
242
+ os........ Linux
243
+ path...... /tmp/tyrant/instances/bar/data/bar.tch
244
+ pid....... 28749
245
+ protver... 0.91
246
+ rnum...... 0
247
+ ru_real... 14.560829
248
+ ru_sys.... 0.000000
249
+ ru_user... 0.004000
250
+ sid....... 72615862
251
+ size...... 1052992
252
+ time...... 1249174632.207222
253
+ type...... hash
254
+ version... 1.1.29
255
+ [...]
256
+
257
+ == CREDITS
258
+
259
+ * Inspired by the {Light Cloud}[http://opensource.plurk.com/LightCloud/Tyrant_manager/] tyrant manager
260
+ * {Tokyo Tyrant}[http://tokyocabinet.sourceforge.net/tyrantdoc/]
261
+
262
+ == LICENSE
263
+
264
+ Copyright (c) 2009, Jeremy Hinegardner
265
+
266
+ Permission to use, copy, modify, and/or distribute this software for any
267
+ purpose with or without fee is hereby granted, provided that the above
268
+ copyright notice and this permission notice appear in all copies.
269
+
270
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
271
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
272
+ FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
273
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
274
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
275
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
276
+ PERFORMANCE OF THIS SOFTWARE.
277
+
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ #--
4
+ # Copyright (c) 2009
5
+ # All rights reserved. See LICENSE and/or COPYING for details.
6
+ #++
7
+
8
+ $:.unshift File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
9
+ require 'tyrant_manager'
10
+ ::TyrantManager::Cli.new( ARGV, ENV ).run
@@ -0,0 +1,94 @@
1
+ require 'rubygems'
2
+ require 'loquacious'
3
+
4
+ Loquacious::Configuration.for( "manager" ) do
5
+
6
+ desc <<-txt
7
+ The 'ttserver' command. This will use the first one found in path by default
8
+ or you may explicitly set it here.
9
+ txt
10
+ ttserver "ttserver"
11
+
12
+ desc <<-txt
13
+ The top directory of the manager directory. This is set with the
14
+ --directory option or it can be set here"
15
+ txt
16
+ home nil
17
+
18
+ desc <<-txt
19
+ The list of locations that contain Tyrant instances. Each element in this array
20
+ either a directory containing instance directories, or an instance directory itself.
21
+ Tyrant Manager will figure out what the case is. If this is unset, then the default
22
+ 'instances' directory below the manager's home directory is used.
23
+ txt
24
+ instances nil
25
+
26
+ desc <<-txt
27
+ Default settings for tyrant instances. If a tyrant does not explicitly set one of
28
+ these configurations then the default listed here is used. This does not list all
29
+ of the configuration variables, only those that make sense to have defaults for.
30
+ txt
31
+ instance_defaults {
32
+ desc "The number of threads to use"
33
+ thread_count 8
34
+
35
+ desc "Number of seconds to terminate a session request if no request is made"
36
+ session_timeout 15
37
+
38
+ desc "The level of logging, this can be 'debug', 'info', or 'error'"
39
+ log_level "error"
40
+
41
+ desc "Run daemonized"
42
+ daemonize true
43
+
44
+ desc <<-txt
45
+ The size of the update log in bytes. You may use a trailing letter to indicate
46
+ kilobytes(k), megabytes(m), gigabytes(g), terabytes(t), exabytes(e)
47
+ txt
48
+ update_log_size "1g"
49
+
50
+ desc "Use asychronous I/O when writing to the update log"
51
+ update_log_async false
52
+
53
+ desc <<-txt
54
+ Forbidden protocol commands, this is the list of commands that will be denied to the client.
55
+ The full list is:
56
+ | put putkeep putcat putshl putnr out get mget vsize iterinit iternext fwmkeys addint
57
+ | adddouble ext sync optimize vanish copy restore setmst rnum size stat misc repl slave
58
+
59
+ There are meta lists too:
60
+
61
+ | all : all commands
62
+ | allorg : all tyrant binary protocol commands
63
+ | allmc : all memecached protocol commands
64
+ | allhttp : all http commands
65
+ | allread : get mget vsiz iterinit iternext fwmkeys rnum size stat
66
+ | allwrite : put putkeep putcat putshl putnr out addint adddouble vanish misc
67
+ | allmanage : sync optimize copy restore setmst
68
+
69
+ To deny optimize vanish and slave commands the configuration would be:
70
+
71
+ | deny_commands [ 'vanish', 'slave', 'optimizie' ]
72
+
73
+ txt
74
+ deny_commands nil
75
+
76
+ desc <<-txt
77
+ Specifically allowed protocol commands. This will only allow these commands. The same
78
+ list of commands in the deny_commands configuration is available.
79
+
80
+ Leave this as nil to use the defaults. To only allow the read and write commands and no
81
+ others the configuration would be:
82
+
83
+ | allow_commands [ 'allread', 'allwrite' ]
84
+
85
+ txt
86
+ allow_commands nil
87
+
88
+ }
89
+ end
90
+
91
+ if $0 == __FILE__ then
92
+ help = Loquacious::Configuration.help_for("manager", :colorize => true)
93
+ help.show( :values => true )
94
+ end
@@ -0,0 +1,244 @@
1
+ require 'rubygems'
2
+ require 'loquacious'
3
+
4
+ #
5
+ # The configuration for the <%= instance_name %> tokyo tyrant instance
6
+ #
7
+ # The options available in the instance_defaults section of the manager
8
+ # configuration are also able to be set here.
9
+ #
10
+ Loquacious::Configuration.for( "<%= instance_name %>" ) do
11
+
12
+ desc "The hostname this instance will listen on. The default is all"
13
+ host "0.0.0.0"
14
+
15
+ desc "The port this tyrant will listen on. The default is 1978"
16
+ port 1978
17
+
18
+ desc <<-txt
19
+ The type of database this instance will be. Options are:
20
+ | memory-hash - an in memory hash database
21
+ | memory-tree - an in memory B+ tree database
22
+ | hash - an on disk hash database
23
+ | tree - an on disk B+ tree database
24
+ | fixed - an on disk fixed length database
25
+ | table - an on disk table database
26
+ txt
27
+ type "hash"
28
+
29
+ desc <<-txt
30
+ Mode of the server in relation to the database. It can be a combination of
31
+ the following:
32
+ | w - it is a database writer
33
+ | r - it is a database reader
34
+ | c - it creates the database if it does not exist
35
+ | t - it truncates the database if it does exist
36
+ | e - do not lock the database when doing operations
37
+ | f - use a non-blocking lock when doing operations
38
+ txt
39
+ mode "wc"
40
+
41
+
42
+ desc <<-txt
43
+ The options for data stored in the database. They include one of the
44
+ compression options:
45
+ | d - Deflate
46
+ | b - BZIP2
47
+ | t - TCBS
48
+ and
49
+ | l - allow the database to be larger than 2GB
50
+ txt
51
+ opts "ld"
52
+
53
+ desc <<-txt
54
+ Tuning parameters. Each of these alters a tuning parameter on the database.
55
+ Not all of them are applicable to all database types
56
+ txt
57
+
58
+ tuning_params {
59
+ desc <<-txt
60
+ The number of elements in the bucket array. Supported in hash, B+ tree
61
+ and table databases. It is also used in the in-memory hash database.
62
+ It should be between 1 and 4 times the number of all records to be stored.
63
+ txt
64
+ bnum nil
65
+
66
+ desc <<-txt
67
+ The maximum number of records to store in the database. This is only
68
+ used in the in-memory databases.
69
+ txt
70
+ capnum nil
71
+
72
+ desc <<-txt
73
+ The maximum amount of memory to use in the server. This is only used
74
+ in the in-memory databases.
75
+ txt
76
+ capsize nil
77
+
78
+ desc <<-txt
79
+ Aligment power. The byte alignment of records. This specifies a power
80
+ of two. The default value is 4 meaning that all records are aligned on
81
+ 16 byte boundaries.
82
+
83
+ This applies to on disk Hash, B+ tree and Table databases.
84
+ txt
85
+ apow nil
86
+
87
+ desc <<-txt
88
+ Free block pool power. This is the maximum number of elements in the free
89
+ block pool as a power of 2. The default is 10 meaning that there are a
90
+ maximum of 1024 free blocks.
91
+
92
+ This applies to on disk hash, B+ tree and Table databases.
93
+ txt
94
+ fpow nil
95
+
96
+ desc <<-txt
97
+ The maximum number of records to be cached. If set to 0 or less then
98
+ the cache is disabled. That is the default.
99
+
100
+ This applies to on disk Hash and Table databases.
101
+ txt
102
+ rcnum nil
103
+
104
+ desc <<-txt
105
+ The size of the memory mapped region. By default this is 64 megabytes.
106
+
107
+ This applies to on disk Hash, B+ tree and Table databases.
108
+ txt
109
+ xmsiz
110
+
111
+ desc <<-txt
112
+ Auto defragmentation configuration. This controls how the automatic
113
+ defragmentation of databases is preformed. It is the 'step'
114
+ number. It is off by default.
115
+
116
+ This applies to on disk Hash, B+ tree and Table databases.
117
+ txt
118
+ dfunit nil
119
+
120
+ desc <<-txt
121
+ The maximum number of leaf nodes to be cached. The default is 4096.
122
+
123
+ This applies to B+ tree and Table databses
124
+ txt
125
+ lcnum nil
126
+
127
+ desc <<-txt
128
+ The maximum number of non-leaf nodes to be cached. The default is 512.
129
+
130
+ This applies to B+ tree and Table databses
131
+ txt
132
+ ncnum nil
133
+
134
+ desc <<-txt
135
+ The number of members in each leaf page. The default is 128.
136
+
137
+ This applies to B+ tree databases.
138
+ txt
139
+ lmemb nil
140
+
141
+ desc <<-txt
142
+ The number of members in each non-leaf page. The default is 128.
143
+
144
+ This applies to B+ tree databases.
145
+ txt
146
+ nmemb nil
147
+
148
+ desc <<-txt
149
+ The width of the value of each record in a fixed length database.
150
+ The default is 255.
151
+ txt
152
+ width nil
153
+
154
+ desc <<-txt
155
+ The file size limit of the fixed database file. The default is 256 MB.
156
+ txt
157
+ limsiz nil
158
+
159
+ }
160
+
161
+ desc <<-txt
162
+ The directory holding the database file. By default this is relative
163
+ to the instance directory. If you want to put it somewhere else, then
164
+ put the full path here.
165
+ txt
166
+ data_dir "data"
167
+
168
+ desc <<-txt
169
+ The directory holding the update logs. By default this is relative
170
+ to the instance directory. If you want to put it somewhere else, then
171
+ put the full path here.
172
+ txt
173
+ ulog_dir "ulog"
174
+
175
+
176
+ desc <<-txt
177
+ The pid file location. By default this is relative to the instance
178
+ directory. If you want it place somewhere else, then put the full
179
+ path here.
180
+ txt
181
+ pid_file "<%= instance_name %>.pid"
182
+
183
+
184
+ desc <<-txt
185
+ The log file location. By default this is relative to the instance
186
+ directory. If you want it place somewhere else, then put the full
187
+ path here.
188
+ txt
189
+ log_file "log/<%= instance_name %>.log"
190
+
191
+
192
+ desc <<-txt
193
+ If this instance is to replicate the data from another instance then
194
+ set that instances host here.
195
+ txt
196
+ master_server nil
197
+
198
+ desc <<-txt
199
+ If this instance is to replicate the data from another instance then
200
+ set that instances port here.
201
+ txt
202
+ master_port nil
203
+
204
+ desc <<-txt
205
+ This is the server id of this instance when it is part of a replication.
206
+ This must be set, and it must be unique within the set of hosts doing
207
+ replication.
208
+ txt
209
+ server_id nil
210
+
211
+ desc <<-txt
212
+ If this server is replicating data from a master, then it must have
213
+ this set to the location of a replication timestamp file. The
214
+ default is relative to the instance directory.
215
+ txt
216
+ replication_timestamp_file "<%= instance_name %>.rts"
217
+
218
+ desc <<-txt
219
+ The name of a file to load as a lua extension. By default this
220
+ is relative to the root of the instance directory. This file will
221
+ only be loaded if it exists.
222
+ txt
223
+ lua_extension_file "lua/<%= instance_name %>.lua"
224
+
225
+ desc <<-txt
226
+ You may specify a lua function and a periodicity in which it is to
227
+ be called. This lua function must be available from within the
228
+ lua_extension_file that is loaded.
229
+
230
+ The periodicity is really the time to wait between calls.
231
+ txt
232
+ periodic_command {
233
+ desc "The function to call"
234
+ name nil
235
+
236
+ desc "how often to call"
237
+ period nil
238
+ }
239
+ end
240
+
241
+ if $0 == __FILE__ then
242
+ help = Loquacious::Configuration.help_for("<%= instance_name %>", :colorize => true)
243
+ help.show :values => true
244
+ end