📄 cluster-tags.xtp
字号:
<example title="Example: regexp host"><host regexp="([^.]+)\.foo\.com"> <host-name>${host.regexp[1]}.foo.com</host-name> <root-directory>/var/www/hosts/www.${host.regexp[1]}.com</root-directory> ...</host></example><p>It is recommended that any <host> using a regexp includea <host-name> to set the canonical name for the host.</p></defun><defun title="<host-default>" version="Resin 3.0"><parents>cluster</parents><p>Defaults for a virtual host.</p><p>The host-default can contain any of the host configuration tags.It will be used as defaults for any virtual host.</p></defun><defun title="<host-deploy>" version="Resin 3.0.4"><parents>cluster</parents><p>Configures a deploy directory for virtual host.</p><p>The host-deploy will add an EL variable ${name}, referring tothe name of the host jar file.</p><deftable-childtags><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr><td>path</td> <td>path to the deploy directory</td> <td>required</td></tr><tr><td>expand-path</td> <td>path to the expansion directory</td> <td>path</td></tr><tr><td>host-default</td> <td>defaults for the expanded host</td></tr><tr><td>host-name</td> <td>the host name to match</td> <td>${name}</td></tr></deftable-childtags></defun><defun title="<ignore-client-disconnect>" version="Resin 3.1"><parents>cluster</parents><default>true</default><p>ignore-client-disconnect configures whether Resin should ignoredisconnection exceptions from the client, or if it should send thoseexceptions to the application.</p><def title="<ignore-client-disconnect> schema">element ignore-client-disconnect { r_boolean-Type}</def></defun><defun title="<invocation-cache-size>" version="Resin 3.1"><parents>cluster</parents><default>8192</default><p>Configures the number of entries in the invocation cache.The invocation cache is used to store pre-calculated servlet and filterchains from the URLs. It's also used as the basis for proxy caching.</p><def title="<invocation-cache-size> schema">element invocation-cache-size { r_int-Type}</def></defun><defun title="<invocation-cache-max-url-length>" version="Resin 3.1"><parents>cluster</parents><default>256</default><p>Configures the longest entry cacheable in the invocation cache.It is used to avoid certain types of denial-of-service attacks.</p><def title="<invocation-cache-max-url-length> schema">element invocation-cache-max-url-length { r_int-Type}</def></defun><defun title="<persistent-store>" version="Resin 3.0.8"><parents>cluster</parents><p>Defines the cluster-aware persistent store used forsharing distributed sessions. The allowed types are "jdbc", "cluster"and "file". The "file" type is only recommended in single-serverconfigurations.</p><p>The <persistent-store> configuration is in the <server> levelbecause it needs to share update information across theactive cluster and the <cluster> definition is at the <server> level.Sessions activate the persistent store with the <use-persistent-store>tag of the <session-config>.</p><p>See <a href="resin-clustering.xtp">Persistent sessions</a> for more details.</p><deftable title="<persistent-store> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>init</td> <td>initialization parameters for the persistent-store</td> <td></td></tr><tr> <td>type</td> <td>cluster, jdbc, or file</td> <td>required</td></tr></deftable><def title="<persistent-store> schema">element persistent-store { type & init?}</def><s2 name="cluster-store" title="cluster store"><p>The cluster store shares copies of the sessions on multiple servers.The original server is used as the primary, and is always more efficientthan the backup servers. In general, the cluster store is preferred becauseit is more scalable, and with the "triplicate" attribute, themost reliable..</p><deftable title="cluster tags"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>always-load</td> <td>Always load the value</td> <td>false</td></tr><tr> <td>always-save</td> <td>Always save the value</td> <td>false</td></tr><tr> <td>max-idle-time</td> <td>How long idle objects are stored (session-timeout will invalidateitems earlier)</td> <td>24h</td></tr><tr> <td>path</td> <td>Directory to store the objects</td> <td>required</td></tr><tr> <td>save-backup</td> <td>Saves backup copies of all distributed objects (3.2.0).</td> <td>true</td></tr><tr> <td>save-triplicate</td> <td>Saves three copies of all distributed objects (3.2.0).</td> <td>true</td></tr><tr> <td>wait-for-acknowledge</td> <td>Requires the sending server to wait for all acks.</td> <td>false</td></tr></deftable><def title="cluster schema">element persistent-store { type { "cluster "} element init { always-load? & always-save? & max-idle-time? & triplicate? & wait-for-acknowledge? }}</def><example title="Example: cluster store"><resin xmlns="http://caucho.com/ns/resin"><cluster> <server id="a" address="192.168.0.1" port="6800"/> <server id="b" address="192.168.0.2" port="6800"/> <persistent-store type="cluster"> <init> <triplicate>true</triplicate> </init> </persistent-store> <web-app-default> <session-config use-persistent-store="true"/> </web-app-default></cluster></resin></example></s2><s2 title="jdbc store"><p>The JDBC store saves sessions in a JDBC database. Often, this will bea dedicated database to avoid overloading the main database.</p><deftable title="jdbc store Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>always-load</td> <td>Always load the value</td> <td>false</td></tr><tr> <td>always-save</td> <td>Always save the value</td> <td>false</td></tr><tr> <td>blob-type</td> <td>Schema type to store values</td> <td>from JDBC meta info</td></tr><tr> <td>data-source</td> <td>The JDBC data source</td> <td>required</td></tr><tr> <td>table-name</td> <td>Database table</td> <td>persistent_session</td></tr><tr> <td>max-idle-time</td> <td>How long idle objects are stored</td> <td>24h</td></tr></deftable><example title="Example: jdbc-store"><resin xmlns="http://caucho.com/ns/resin"><cluster> <server id="a" address="192.168.0.1" port="6800"/> <server id="b" address="192.168.0.2" port="6800"/> <persistent-store type="jdbc"> <init> <data-source>jdbc/session</data-source> <max-idle-time>24h</max-idle-time> </init> </persistent-store> <web-app-default> <session-config use-persistent-store="true"/> </web-app-default></cluster></resin></example></s2><s2 title="file store"><p>The file store is a persistent store for development and testing orfor single servers. Since it is not aware of the clusters, it cannotimplement true distributed objects.</p><deftable title="file tags"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>always-load</td> <td>Always load the value</td> <td>false</td></tr><tr> <td>always-save</td> <td>Always save the value</td> <td>false</td></tr><tr> <td>max-idle-time</td> <td>How long idle objects are stored</td> <td>24h</td></tr><tr> <td>path</td> <td>Directory to store the sessions</td> <td>required</td></tr></deftable></s2></defun><defun title="<ping>" occur="*" version="Resin 3.0"><parents>cluster</parents><p>Starts a thread that periodically makes a request to the server, andrestarts Resin if it fails. This facility is used to increase serverreliability - if there is a problem with the server (perhaps from a deadlock oran exhaustion of resources), the server is restarted.</p><p>A failure occurs if a request to the url returns an HTTP status that isnot 200.</p><p>Since the local process is restarted, it does not make sense to specify aurl that does not get serviced by the instance of Resin that has the pingconfiguration. Most configurations use url's that specify 'localhost' asthe host.</p><p>This pinging only catches some problems because it's running in thesame process as Resin itself. If the entire JDK freezes, thisthread will freeze as well. Assuming the JDK doesn't freeze, thePingThread will catch errors like deadlocks.</p><deftable title="<ping> Attributes"><tr> <th>Attribute</th> <th>Description</th> <th>Default</th></tr><tr> <td>url</td> <td>A url to ping.</td> <td>required</td></tr><tr> <td>sleep-time</td> <td>Time to wait between pings. The first ping is always 15m after the server starts, this is for subsequent pings.</td> <td>15m</td></tr><tr> <td>try-count</td> <td>If a ping fails, number of times to retry before giving up and restarting</td> <td>required</td></tr><tr> <td>retry-time</td> <td>time between retries</td> <td>1s</td></tr><tr> <td>socket-timeout</td> <td>time to wait for server to start responding to the tcp connection before giving up</td> <td>10s</td></tr></deftable><example title="Example: resin.xml - simple usage of server ping"><resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> <cluster id="app-tier"> <ping url="http://localhost/"/> ... </cluster></resin></example><example title="Example: resin.xml - configured usage of server ping"><resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <cluster id="app-tier"> <ping> <url>http://localhost:8080/index.jsp</url> <url>http://localhost:8080/webapp/index.jsp</url> <url>http://virtualhost/index.jsp</url> <url>http://localhost:443/index.jsp</url> <sleep-time>5m</sleep-time> <try-count>5</try-count> <!-- a very busy server --> <socket-timeout>30s</socket-timeout> </ping> ... </cluster></resin></example><p>The class that corresponds to <ping> is <a href="javadoc|com.caucho.server.admin.PingThread|">PingThread</a>. </p><s2 title="Mail notification when ping fails"><p>A refinement of the ping facility sends an email when the server isrestarted.</p><example title="resin.xml - mail notification when ping fails"><resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core"> ... <cluster id="web-tier"> <ping resin:type="com.caucho.server.admin.PingMailer"> <url>http://localhost:8080/index.jsp</url> <url>http://localhost:8080/webapp/index.jsp</url> <mail-to>fred@hogwarts.com</mail-to> <mail-from>resin@hogwarts.com</mail-from> <mail-subject>Resin ping has failed for server ${'${'}server.name}</mail-subject> </ping> ... </server></resin></example><p>The default behaviour for sending mail is to contact a SMTP server at host 127.0.0.1 (the localhost) on port 25.System properties are used to configure a different SMTP server.</p><example title="resin.xml - smtp server configuration"> <system-property mail.smtp.host="127.0.0.1"/> <system-property mail.smtp.port="25"/></example></s2></defun><defun title="Resource Tags" version="Resin 3.1"><parents>cluster</parents><p>All <a href="env-tags.xtp">Environment tags</a> areavailable to the <cluster>. For example,resources like <database>.</p><example title="Example: cluster environment"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <database jndi-name="jdbc/test"> <driver type="org.postgresql.Driver"> <url>jdbc:postgresql://localhost/test</url> <user>caucho</user> </driver> </database> <server id="a" ...>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -