-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdatabase_config.html
126 lines (126 loc) · 8.84 KB
/
database_config.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>WiredTiger: Database Configuration</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="wiredtiger.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://wiredtiger.com/"><img alt="Logo" src="LogoFinal-header.png" alt="WiredTiger" /></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">
 <span id="projectnumber">Version 2.9.2</span>
</div>
<div id="projectbrief"><!-- 2.9.2 --></div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="banner">
<a href="https://github.com/wiredtiger/wiredtiger">Fork me on GitHub</a>
<a class="last" href="http://groups.google.com/group/wiredtiger-users">Join my user group</a>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li><a href="community.html"><span>Community</span></a></li>
<li><a href="license.html"><span>License</span></a></li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('database_config.html','');});
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">Database Configuration </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>WiredTiger databases are configured using the <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> call, which takes a configuration string argument. In addition to this, the database configuration can be specified using the <code>WiredTiger.config</code> file or the WIREDTIGER_CONFIG environment variable.</p>
<p>When a WiredTiger database is created, the configuration string passed to <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> is saved to a WiredTiger home directory file named <code>WiredTiger.basecfg</code>, and that configuration file is read whenever the database is subsequently opened.</p>
<p>The configuration string to the <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> call allows applications to do per run settings (such as with or without statistics) or override original creation settings. The user config file and the environment variable allow system administrators to override application settings without recompilation.</p>
<h1><a class="anchor" id="config_order"></a>
Configuration ordering</h1>
<p>When a database is created or opened, the order of configuration is:</p>
<ul>
<li>Any <code>WiredTiger.basecfg</code> file,</li>
<li>which is overridden by the <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> configuration string argument.</li>
<li>which is overridden by the <code>WiredTiger.config</code> file,</li>
<li>which is overridden by the <code>WIREDTIGER_CONFIG</code> environment variable,</li>
</ul>
<h1><a class="anchor" id="config_env"></a>
WIREDTIGER_CONFIG environment variable</h1>
<p>If the <code>WIREDTIGER_CONFIG</code> environment variable is set, it is read as a configuration string.</p>
<p>If the process is running with special privileges and <code>WIREDTIGER_CONFIG</code> is set, the <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> function must be configured with the <code>use_environment_priv</code> flag, or the call to <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> will fail. See <a class="el" href="home.html">Database Home Directory</a> for more details.</p>
<h1><a class="anchor" id="config_file"></a>
WiredTiger.config file</h1>
<p>If a file named <code>WiredTiger.config</code> appears in the WiredTiger home directory, it is read as a configuration string.</p>
<p>The file is minimally parsed in order to build configuration strings for the WiredTiger configuration parser:</p>
<ul>
<li>
<p class="startli">A backslash (<b><code>\</code></b>) followed by any character other than a newline character leaves both characters untouched; otherwise, if a backslash is followed by a newline character, both the backslash and the newline character are discarded.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">Any text between double-quote pairs (<b><code>"</code></b>) is left untouched, including newline and white-space characters. Backslash characters escape double-quote characters: a backslash escaped double-quote character can neither start nor end a quoted string.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">Comments are discarded. If the first non-white-space character following an unquoted and unescaped newline character is a hash mark (<b><code>#</code></b>), all characters up to the next newline character are discarded. The ending newline character cannot be escaped or quoted, once a comment line is identified, all characters to the next newline are simply discarded.</p>
<p class="endli"></p>
</li>
<li>
Otherwise, all lines are concatenated and the newline characters replaced with commas. </li>
</ul>
<h1><a class="anchor" id="config_base"></a>
WiredTiger.basecfg file</h1>
<p>When a WiredTiger database is created, non-default configuration information specified to <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> is saved to a WiredTiger home directory file named <code>WiredTiger.basecfg</code>, and that configuration file is read whenever the database is subsequently opened.</p>
<p>For example, if a shared library extensions are required, those settings will be saved to the base configuration file so it's easier to write general-purpose applications that might not be aware of how a particular database was created and configured.</p>
<p>Users should not not edit this file, set the <code>WIREDTIGER_CONFIG</code> environment variable or create a <code>WiredTiger.config</code> file instead, as those settings override the settings in the base configuration file.</p>
<p>This file is a potential problem for applications that want to retain the ability to downgrade to previous releases. If a new database is created after an upgrade, the base configuration file might have configuration strings that would cause a previous version of the application to fail. For this reason, applications that may want to downgrade should configure the <a class="el" href="group__wt.html#ga9e6adae3fc6964ef837a62795c7840ed" title="Open a connection to a database. ">wiredtiger_open</a> value <code>config_base</code> to <code>false</code> so the base configuration file is not written as part of database create. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="index.html">Reference Guide</a></li><li class="navelem"><a class="el" href="admin.html">Managing WiredTiger databases</a></li>
<li class="footer">Copyright (c) 2008-2016 MongoDB, Inc. All rights reserved. Contact <a href="mailto:[email protected]">[email protected]</a> for more information.</li>
</ul>
</div>
</body>
</html>