<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jon Schutz Technical Notes and Recommendations &#187; Scribe</title>
	<atom:link href="http://notes.jschutz.net/topics/scribe/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.jschutz.net</link>
	<description>Useful snippets technical info and recommendations</description>
	<lastBuildDate>Thu, 24 Jun 2010 07:07:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scribe Server Configuration</title>
		<link>http://notes.jschutz.net/2009/08/scribe-server-configuration/</link>
		<comments>http://notes.jschutz.net/2009/08/scribe-server-configuration/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 06:27:22 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[Scribe]]></category>

		<guid isPermaLink="false">http://notes.jschutz.net/?p=114</guid>
		<description><![CDATA[Due to reconfiguration at Sourceforge, the Scribe Configuration page is no longer there.  This is a copy of the page http://scribeserver.wiki.sourceforge.net/Configuration rescued from Google&#8217;s cache.
Configuring Scribe
The Scribe Server can be configured by:

the file specified in the -c command line option
the file at DEFAULT_CONF_FILE_LOCATION in env_default.h

Global Configuration Variables
port: assigned to variable &#8220;port&#8221;

what port the scribe server [...]]]></description>
			<content:encoded><![CDATA[<p id="tocConfiguration0">Due to reconfiguration at Sourceforge, the Scribe Configuration page is no longer there.  This is a copy of the page <span>http://scribeserver.wiki.sourceforge.net</span>/Configuration rescued from Google&#8217;s cache.</p>
<h1>Configuring Scribe</h1>
<h2 id="tocConfiguration1"><strong>The Scribe Server can be configured by:</strong></h2>
<ol>
<li>the file specified in the -c command line option</li>
<li>the file at DEFAULT_CONF_FILE_LOCATION in env_default.h</li>
</ol>
<h3 id="tocConfiguration4"><strong>Global Configuration Variables</strong></h3>
<p><strong>port</strong>: assigned to variable &#8220;port&#8221;</p>
<ul>
<li>what port the scribe server will listen on</li>
<li>default 0, passed at command line with -p, can also be set in conf file</li>
</ul>
<p><strong>max_msg_per_second</strong>: assigned to variable &#8220;maxMsgPerSecond&#8221;</p>
<ul>
<li>used in scribeHandler::throttleDeny</li>
<li>default 100,000</li>
</ul>
<p><strong>max_queue_size</strong>: in bytes, assigned to variable &#8220;maxQueueSize&#8221;</p>
<ul>
<li>used in scribeHandler::Log</li>
<li>default 500,000 bytes</li>
</ul>
<p><strong>check_interval</strong>: in seconds, assigned to variable &#8220;checkPeriod&#8221;</p>
<ul>
<li>used to control how often to check each store</li>
<li>default 5</li>
</ul>
<p><strong>new_thread_per_category</strong>: boolean, assigned to variable &#8220;newThreadPerCategory&#8221;</p>
<ul>
<li>If true, will create a new thread for every category seen. Otherwise, will only create a single thread for every store defined in the configuration.</li>
<li>default true</li>
</ul>
<p><em>Example:</em></p>
<div id="content_view" class="wiki">
<pre class="text">port=1463
max_msg_per_second=2000000
max_queue_size=10000000
check_interval=3</pre>
<h2 id="tocConfiguration5"><strong>Store Configuration</strong></h2>
<p>Scribe Server determines how to log messages based on the Stores defined in the configuration. Every store must specify what message category it handles with two exceptions:<br />
<strong>default store</strong>: The &#8216;default&#8217; category handles any category that is not handled by any other store. There can only be one default store.</p>
<ul>
<li>category=default</li>
</ul>
<p><strong>prefix stores</strong>: If the specified category ends in a *, the store will handle all categories that begin with the specified prefix.</p>
<ul>
<li>category=web*</li>
</ul>
<h3 id="tocConfiguration6"><strong>Store Configuration Variables</strong></h3>
<p><strong>category</strong>: Determines which messages are handled by this store<br />
<strong>type</strong>:</p>
<ul>
<li>Currently used types (defined in Store::createStore)
<ol>
<li>file</li>
<li>buffer</li>
<li>network</li>
<li>bucket</li>
<li>thriftfile</li>
<li>null</li>
<li>multi</li>
</ol>
</li>
</ul>
<p><strong>target_write_size</strong>: 16,384 bytes by default</p>
<ul>
<li>determines how large to let the message queue grow for a given category before processing the messages</li>
</ul>
<p><strong>max_write_interval</strong>: 10 seconds by default</p>
<ul>
<li>determines how long to let the messages queue for a given category before processing the messages</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=statistics
type=file
target_write_size=20480
max_write_interval=2

...

&lt;/store&gt;</pre>
<h3 id="tocConfiguration7"><strong>File Store Configuration</strong></h3>
<p>File Stores write messages to a file.</p>
<p><strong>file_path</strong>: defaults to &#8220;/tmp&#8221;<br />
<strong>base_filename</strong>: defaults to category name<br />
<strong>rotate_period</strong>: &#8220;hourly&#8221;, &#8220;daily&#8221;, or &#8220;never&#8221;; &#8220;never&#8221; by default</p>
<ul>
<li>determines how often to create new files</li>
</ul>
<p><strong>rotate_hour</strong>: 0-23, 1 by default</p>
<ul>
<li>if rotation_period is daily, determines what hour of day to rotate</li>
</ul>
<p><strong>rotate_minute</strong> 0-59, 15 by default</p>
<ul>
<li>if rotation_period is daily or hourly, determines how many minutes after the hour to rotate</li>
</ul>
<p><strong>max_size</strong>: 1,000,000,000 bytes by default</p>
<ul>
<li>determines approximately how large to let a file grow before rotating to a new file</li>
</ul>
<p><strong>write_meta</strong>: &#8220;yes&#8221; or anything else; false by default</p>
<ul>
<li>whether to log the following metadata in each file:
<ol>
<li>
<ol>
<li>the length of each message is prepended to the message as an unsigned integer</li>
<li>if the file was rotated, the last line will contain &#8220;scribe_meta&lt;new_logfile&gt;: &#8221; followed by the next filename</li>
</ol>
</li>
</ol>
</li>
</ul>
<p><strong>fs_type</strong>: currently only &#8220;std&#8221; is supported; &#8220;std&#8221; by default<br />
<strong>chunk_size</strong>: 0 by default</p>
<ul>
<li>if a chunk size is specified, no messages within the file will cross chunk boundaries unless there are messages larger than the chunk size</li>
</ul>
<p><strong>add_newlines</strong>: 0 or 1, 0 by default</p>
<ul>
<li>if set to 1, will write a newline after every message</li>
</ul>
<p><strong>create_symlink</strong>: &#8220;yes&#8221; or anything else; &#8220;yes&#8221; by default</p>
<ul>
<li>if true, will maintain a symlink that points to the most recently written file</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=sprockets
type=file
file_path=/tmp/sprockets
base_filename=sprockets_log
max_size=1000000
add_newlines=1
rotate_period=daily
rotate_hour=0
rotate_minute=10
&lt;/store&gt;</pre>
<h3 id="tocConfiguration8"><strong>Network Store Configuration</strong></h3>
<p>Network Stores forward messages to other Scribe Servers.</p>
<p><strong>remote_host</strong>: name or ip of remote host to forward messages<br />
<strong>remote_port</strong>: port number on remote host<br />
<strong>timeout</strong>: socket timeout, in MS; defaults to DEFAULT_SOCKET_TIMEOUT_MS, which is set to 5000 in store.h<br />
<strong>use_conn_pool</strong>: &#8220;yes&#8221; or anything else; defaults to false</p>
<ul>
<li>whether to use connection pooling instead of opening up multiple connections to each remote host</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=default
type=network
remote_host=hal
remote_port=1465
&lt;/store&gt;</pre>
<h3 id="tocConfiguration9"><strong>Buffer Store Configuration</strong></h3>
<p>Buffer Stores must have two sub-stores named &#8220;primary&#8221; and &#8220;secondary&#8221;. Buffer Stores will first attempt to Log messages to the primary store and only log to the secondary if the primary is not available. Once the primary store comes back online, a Buffer store will read messages out of the secondary store and send them to the primary store. Only stores that are readable (store that implement the readOldest() method) may be used as secondary store. Currently, the only readable stores are File Stores and Null Stores.</p>
<p><strong>max_queue_length</strong>: 2,000,000 messages by default</p>
<ul>
<li>if the number of messages in the queue exceeds this value, the buffer store will switch to writing to the secondary store</li>
</ul>
<p><strong>buffer_send_rate</strong>: 1 by default</p>
<ul>
<li>determines, for each check_interval, how many times to read a group of messages from the secondary store and send them to the primary store</li>
</ul>
<p><strong>retry_interval</strong>: 300 seconds by default</p>
<ul>
<li>how long to wait to retry sending to the primary store after failing to write to the primary store</li>
</ul>
<p><strong>retry_interval_range</strong>: 60 seconds by default</p>
<ul>
<li>will randomly pick a retry interval that is within this range of the specified retry_interval</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=default
type=buffer
buffer_send_rate=1
retry_interval=30
retry_interval_range=10

&lt;primary&gt;
type=network
remote_host=wopr
remote_port=1456
&lt;/primary&gt;

&lt;secondary&gt;
type=file
file_path=/tmp
base_filename=thisisoverwritten
max_size=10000000
&lt;/secondary&gt;
&lt;/store&gt;</pre>
<p><em>Note! When the network connection is re-established, the messages from the secondary store are sent one whole file at a time.  Thus max_size determines not only the size of the file that triggers rotation, but also the size of the network messages; if this is too large, the receiver may not be able to handle it.  Best to keep it to a number that can be comfortably handled in memory.  max_size does not limit the total number of messages that can be buffered (presumably that&#8217;s limited by the amount of space available on the filesystem).</em></p>
<h3 id="tocConfiguration10"><strong>Bucket Store Configuration</strong></h3>
<p>Bucket Stores will hash messages to multiple files using a prefix of each message as the key.<br />
a Bucket Store must have a substore named &#8220;bucket&#8221; that is either a File Store or ThriftFile Store.</p>
<p><strong>num_buckets</strong>: defaults to 1</p>
<ul>
<li>number of buckets to hash into</li>
<li>messages that cannot be hashed into any bucket will be put into a special bucket number 0</li>
</ul>
<p><strong>bucket_type</strong>: &#8220;key_hash&#8221; or &#8220;key_modulo&#8221;<br />
<strong>delimiter</strong>: must be an ascii code between 0 and 255; if 0, uses DEFAULT_DELIMITER (set in common.h)</p>
<ul>
<li>The message prefix up to(but not including) the first occurrence of the delimiter will be used as the key to do the hash/modulo</li>
</ul>
<p><strong>bucket_subdir</strong>: the name of each subdirectory will be this name followed by the bucket number<br />
<em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=bucket_me
type=bucket
num_buckets=5
bucket_subdir=bucket
bucket_type=key_hash
delimiter=58

&lt;bucket&gt;
type=file
fs_type=std
file_path=/tmp/scribetest
base_filename=bucket_me
&lt;/bucket&gt;
&lt;/store&gt;</pre>
<h3 id="tocConfiguration11"><strong>Null Store Configuration</strong></h3>
<p>Null Stores can be used to tell Scribe to ignore all messages of a given category.</p>
<p>(no configuration parameters)<br />
<em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=tps_report*
type=null
&lt;/store&gt;</pre>
<h3 id="tocConfiguration12"><strong>Multi Store Configuration</strong></h3>
<p>A Multi Store is a store that will forward all messages to multiple sub-stores.</p>
<p>A Multi Store may have any number of substores named &#8220;store0&#8243;, &#8220;store1&#8243;, &#8220;store2&#8243;, etc<br />
<strong>report_success</strong>: &#8220;all&#8221; or &#8220;any&#8221;, defaults to &#8220;all&#8221;</p>
<ul>
<li>whether all substores or any substores must succeed in logging a message in order for the Multi Store to report the message logging as successful</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=default
type=multi
target_write_size=20480
max_write_interval=1

&lt;store0&gt;
type=file
file_path=/tmp/store0
&lt;/store0&gt;

&lt;store1&gt;
type=file
file_path=/tmp/store1
&lt;/store1&gt;
&lt;/store&gt;
&lt;store&gt;</pre>
<h3 id="tocConfiguration13"><strong>Thriftfile Store Configuration</strong></h3>
<p>A Thriftfile store is similar to a File store except that it stores messages in a Thrift TFileTransport file.</p>
<p><strong>file_path</strong>: defaults to &#8220;/tmp&#8221;<br />
<strong>base_filename</strong>: defaults to category name<br />
<strong>rotate_period</strong>: &#8220;hourly&#8221;, &#8220;daily&#8221;, or &#8220;never&#8221;; &#8220;never&#8221; by default</p>
<ul>
<li>determines how often to create new files</li>
</ul>
<p><strong>rotate_hour</strong>: 0-23, 1 by default</p>
<ul>
<li>if rotation_period is daily, determines what hour of day to rotate</li>
</ul>
<p><strong>rotate_minute</strong> 0-59, 15 by default</p>
<ul>
<li>if rotation_period is daily or hourly, determines how many minutes after the hour to rotate</li>
</ul>
<p><strong>max_size</strong>: 1,000,000,000 bytes by default</p>
<ul>
<li>determines approximately how large to let a file grow before rotating to a new file</li>
</ul>
<p><strong>write_meta</strong>: &#8220;yes&#8221; or anything else; false by default</p>
<ul>
<li>whether to log the following metadata in each file:
<ol>
<li>
<ol>
<li>the length of each message is prepended to the message as an unsigned integer</li>
<li>if the file was rotated, the last line will contain &#8220;scribe_meta&lt;new_logfile&gt;: &#8221; followed by the next filename</li>
</ol>
</li>
</ol>
</li>
</ul>
<p><strong>fs_type</strong>: currently only &#8220;std&#8221; is supported; &#8220;std&#8221; by default<br />
<strong>chunk_size</strong>: 0 by default</p>
<ul>
<li>if a chunk size is specified, no messages within the file will cross chunk boundaries unless there are messages larger than the chunk size</li>
</ul>
<p><strong>create_symlink</strong>: &#8220;yes&#8221; or anything else; &#8220;yes&#8221; by default</p>
<ul>
<li>if true, will maintain a symlink that points to the most recently written file</li>
</ul>
<p><strong>flush_frequency_ms</strong>: milliseconds, will use TFileTransport default of 3000ms if not specified</p>
<ul>
<li>determines how frequently to sync the Thrift file to disk</li>
</ul>
<p><strong>msg_buffer_size</strong>: in bytes, will use TFileTransport default of 0 if not specified</p>
<ul>
<li>if non-zero, store will reject any writes larger than this size</li>
</ul>
<p><em>Example:</em></p>
<pre class="text">&lt;store&gt;
category=sprockets
type=thriftfile
file_path=/tmp/sprockets
base_filename=sprockets_log
max_size=1000000
flush_frequency_ms=2000
&lt;/store&gt;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://notes.jschutz.net/2009/08/scribe-server-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
