added some more index sanity checks. added const qualifier where necessary
[OpenSRF.git] / examples / opensrf.xml.example
1 <?xml version='1.0'?>
2
3 <opensrf version='0.0.1'>
4
5                 <!-- 
6
7                 There is one <host> entry for each server on the network.  Settings for the
8                 'default' host are used for every setting that isn't overridden within a given 
9                 host's config.  
10
11                 To specify which applications a host is serving, list those applications
12                 within that host's config section.  If the defaults are acceptible, then
13                 that's all that needs to be added/changed.
14
15                 Any valid XML may be added to the <default> block and server components will have 
16                 acces to it.
17
18                 -->
19
20         <default>
21         
22                 <dirs>
23
24                         <!-- opensrf log files go in this directory -->
25                         <log>/path/to/log</log>
26
27                         <!-- opensrf unix domaind socket files go here -->
28                         <sock>/path/to/sock</sock>
29
30                         <!-- opensrf pids go here -->
31                         <pid>/path/to/pid</pid>
32
33                         <!-- global config directory -->
34                         <conf>/path/to/conf</conf>
35
36                 </dirs>
37
38                 <!-- prefork, simple. prefork is suggested -->
39                 <server_type>prefork</server_type>
40
41                 <!-- Default doesn't host any apps -->
42                 <activeapps/> 
43
44                 <cache>
45                         <global>
46                                 <servers>
47                                         <!-- memcached server ip:port -->
48                                         <server>127.0.0.1:10101</server>
49                                 </servers>
50                                 <!-- maximun time that anything may stay in the cache -->
51                                 <max_cache_time>86400</max_cache_time>
52                         </global>
53                 </cache>
54
55                 <!-- These are the defaults for every served app.  Each server should 
56                         duplicate the node layout for any nodes that need changing.
57                         Any settings that are overridden in the server specific section 
58                         will be used as the config values for that server.  Any settings that are
59                         not overridden will fall back on the defaults
60                         Note that overriding 'stateless' will break things -->
61
62                 <apps>
63
64                         <opensrf.persist>
65
66                                 <!-- How many seconds to wait between server 
67                                         requests before timing out a stateful server session. -->
68                                 <keepalive>1</keepalive>
69
70                                 <!-- if 1, then we support stateless sessions (no connect required), if
71                                                 0 then we don't -->
72                                 <stateless>1</stateless>
73
74                                 <!-- Tells the servers which language this implementation is coded in 
75                                         In this case non "perl" servers will not be able to load the module -->
76                                 <language>perl</language>
77
78                                 <!-- Module the implements this application -->
79                                 <implementation>OpenSRF::Application::Persist</implementation>
80
81                                 <!-- max stateful requests before a session automatically disconnects a client -->
82                                 <max_requests>97</max_requests>
83
84                                 <!-- settings for the backend application drones.  These are probably sane defaults -->
85
86                                 <unix_config>
87                                         <!-- unix socket file -->
88                                         <unix_sock>opensrf.persist_unix.sock</unix_sock>
89
90                                         <!-- pid file -->
91                                         <unix_pid>opensrf.persist_unix.pid</unix_pid>
92
93                                         <!-- max requests per process backend before a child is recycled -->
94                                         <max_requests>1000</max_requests>
95
96                                         <!-- log file for this application -->
97                                         <unix_log>opensrf.persist_unix.log</unix_log>
98
99                                         <!-- Number of children to pre-fork -->
100                                         <min_children>5</min_children>
101
102                                         <!-- maximun number of children to fork -->
103                                         <max_children>25</max_children>
104
105                                         <!-- minimun number of spare forked children -->
106                                         <min_spare_children>2</min_spare_children>
107
108                                         <!-- max number of spare forked children -->
109                                         <max_spare_children>5</max_spare_children>
110
111                                 </unix_config>
112
113                                 <!-- Any additional setting for a particular application go in the app_settings node -->
114                                 <app_settings>
115
116                                         <!-- sqlite database file -->
117                                         <dbfile>/path/to/dbfile/persist.db</dbfile>
118                                 </app_settings>
119
120                         </opensrf.persist>
121
122                         <opensrf.math>
123                                 <keepalive>3</keepalive>
124                                 <stateless>1</stateless>
125                                 <language>perl</language>
126                                 <implementation>OpenSRF::Application::Demo::Math</implementation>
127                                 <max_requests>97</max_requests>
128                                 <unix_config>
129                                         <unix_sock>opensrf.math_unix.sock</unix_sock>
130                                         <unix_pid>opensrf.math_unix.pid</unix_pid>
131                                         <max_requests>1000</max_requests>
132                                         <unix_log>opensrf.math_unix.log</unix_log>
133                                         <min_children>5</min_children>
134                                         <max_children>15</max_children>
135                                         <min_spare_children>2</min_spare_children>
136                                         <max_spare_children>5</max_spare_children>
137                                 </unix_config>
138                         </opensrf.math>
139                         
140                         <opensrf.dbmath> 
141                                 <keepalive>3</keepalive>
142                                 <stateless>1</stateless>
143                                 <language>perl</language>
144                                 <implementation>OpenSRF::Application::Demo::MathDB</implementation>
145                                 <max_requests>99</max_requests>
146                                 <unix_config>
147                                         <max_requests>1000</max_requests>
148                                         <unix_log>opensrf.dbmath_unix.log</unix_log>
149                                         <unix_sock>opensrf.dbmath_unix.sock</unix_sock>
150                                         <unix_pid>opensrf.dbmath_unix.pid</unix_pid>
151                                         <min_children>5</min_children>
152                                         <max_children>15</max_children>
153                                         <min_spare_children>2</min_spare_children> <max_spare_children>5</max_spare_children>
154                                 </unix_config>
155                         </opensrf.dbmath>
156
157                         <opensrf.settings>
158                                 <keepalive>1</keepalive>
159                                 <stateless>0</stateless>
160                                 <language>perl</language>
161                                 <implementation>OpenSRF::Application::Settings</implementation>
162                                 <max_requests>17</max_requests>
163                                 <unix_config>
164                                         <unix_sock>opensrf.settings_unix.sock</unix_sock>
165                                         <unix_pid>opoensrf.settings_unix.pid</unix_pid>
166                                         <max_requests>1000</max_requests>
167                                         <unix_log>opensrf.settings_unix.log</unix_log>
168                                         <min_children>5</min_children>
169                                         <max_children>15</max_children>
170                                         <min_spare_children>3</min_spare_children>
171                                         <max_spare_children>5</max_spare_children>
172                                 </unix_config>
173                         </opensrf.settings>
174
175                 </apps>
176
177         </default>
178
179         <hosts>
180
181                 <myhost.mydomain.org>
182                         <!-- ^-=-
183                                 must match the fully qualified domain name of the host 
184                                 on Linux, this is usually the output of "hostname -f"
185                         -->
186
187
188                         <!-- List all of the apps this server will be running -->
189                         <activeapps>
190                                 <appname>opensrf.persist</appname> 
191                                 <appname>opensrf.settings</appname> 
192                                 <appname>opensrf.math</appname> 
193                                 <appname>opensrf.dbmath</appname> 
194                         </activeapps>
195
196                         <apps> <!-- Example of an app-specific setting override -->
197                                 <opensrf.persist>
198                                         <app_settings>
199                                                 <dbfile>/different/path/to/dbfile/persist.db</dbfile>
200                                         </app_settings>
201                                 </opensrf.persist>
202                         </apps>
203
204                 </myhost.mydomain.org> 
205
206         </hosts>
207
208 </opensrf>