Apache Software Foundation | Jakarta Project | Apache Tomcat
Intro


はじめに

Each component instance has a name, that is used for configuration and at runtime. Each component has a number of configurable properties. The following rules are used:

  • The name is composed from the type and a local part, separated with a ':' ( example: channel.unixsocket:/tmp/jk.socket )
  • The 'type' consist of '.' and ascii characters. It is mapped to a JMX 'domain'.
  • The local part consists of ascii characters and .:/;
  • The property is a simple name, with no dots.
  • A simple form of substitution is used in values, where $(property) will be replaced with a previously defined setting. If the property has ':' in it, it'll take the value from the object, if not it'll take the value from a global map.


それぞれのコンポーネントのインスタンスは名前を持っています。それは設定のために実行時に利用されます。それぞれのコンポーネントはいくつかの設定可能なプロパティを持っています。以下に示すルールに従います。

  • 名前は、':'で区切られるタイプとローカルパートから構成されます。 ( 例: channel.unixsocket:/tmp/jk.socket )
  • タイプは'.'とアスキー文字から成ります。それはJMXの'domain'と対応づけられます。
  • ローカルパートはアスキー文字と .:/; から成ります。
  • プロパティはドットを含まない単純な名前です。
  • 単純な形式の置換は、あらかじめ定義された$(property)の値が使われます。 もしプロパティが':'を含んでいたら、オブジェクトから値を得ることになります。 そうでなければグローバル・マップから値を取り出します。


Common properties


共通のプロパティ

Common properties for all components

Property name Default Description
disabled 0 (false) "disabled" state for the component, 1=true 0=false
debug 0 (false) Debug level for the component, 0=disabled, 1..10 enabled. Higher levels generate more debug.
version 0 'Generation' of the component config. Important for runtime reconfiguration. If you edit the config file or set the shmem properties, you need to also upgrade the version of the modified component. The config layer will detect the change and call the setter method.


すべてのコンポーネントで共通のプロパティ

プロパティ名 デフォルト 説明
disabled 0 (false) コンポーネントの"disabled(無効)"状態, 1=true 0=false
debug 0 (false) コンポーネントのデバッグレベル, 0=無効, 1..10 有効 数値が高いほど詳細なデバッグ情報を生成します。
version 0 コンポーネント構成の'世代(Generation)'. 実行環境で再構成をする際に重要です。 設定ファイルを編集したり、shmemプロパティを設定した場合、 修正したコンポーネントのバージョンも同時に更新しなければなりません。 設定レイヤーは変更を検出し、セッターメソッドを呼び出します。


workerEnv


workerEnv

This component represent the core jk2, it has the default logger for all other components. Is the central controller, it controls global properties and provides access to all other objects

Property name Default Description
logger logger Default loger used by jk2 components, can be changed in the config file, normally it defaults to "logger" the Alias for the default logger for the Server/platform.
timing 0 Will jk2 get request timing (needs APR?)


このコンポーネントはjk2のコア部分に相当します。このコンポーネントは他のすべてのコンポーネント用のデフォルトloggerを持ちます。 中央コントローラであるため、このコンポーネントはグローバルプロパティを制御し、 他のすべてのオブジェクトへのアクセスを提供します。

プロパティ名 デフォルト 説明
logger logger jk2コンポーネントによって使用されるデフォルトの logger, 設定ファイルで変更が可能です。通常は、そのデフォルト値は"logger" で、サーバ/プラットフォームのデフォルトloggerの別名となっています。
timing 0 jk2が要求を得るタイミングでしょう (APRで必要?)


config


config

The config component, hold the detail of the conifg system, such config file name, create global defines

Property name Default Description
file ${serverRoot}/conf/workers2.properties Location of the workers2.properties file
debug 0 Set the debug level of the config component
debugEnv 0 Set the debug level of the hidden env component


設定ファイル名のような、システムの設定の詳細を保持するconfigコンポーネントはグローバルな定義を生成します。

プロパティ名 デフォルト 説明
file ${serverRoot}/conf/workers2.properties workers2.properties ファイルの場所
debug 0 設定コンポーネントのデバッグレベルを設定します。
debugEnv 0 隠蔽されているenvコンポーネントのデバッグレベルを設定します。


uriMap


uriMap

shm


shm

Shared memory descriptor

Property name Default Description
file No default value Name of the file that will be mmapped to use as shared memory.
size No default value Size of the file.


共有メモリ ディスクリプタ

プロパティ名 デフォルト 説明
file デフォルト値なし 共有メモリとして使われ、mmapで対応づけられるファイル名
size デフォルト値なし ファイルのサイズ


uri


uri

A uri stores a pattern that is used to match requests to workers, and asociated properties

If the uri name doesn't have a slash then it is considered as a virtual host directive. Uri name can have a virtual host name and(or) port associated with. Format of such a name is hostname or hostname:port where hostname is virtual server name and the port is vitual server port number. The port number is used only for the non default server ports.

Special case is a default server named as [uri:*] that is used when the virtual host cannot be found inside the configuration. All the uri directives not containing host name belongs to this default server making global mappings.

Addition wild char scheme id [uri:*:port] that is used when you wish to match any virtual host having specified (non-default) port number, like [uri:*:443]. This will map all the virtual hosts no mather what is their name but that have port number 443.

The order how the host names are resolved is :

  • Exact host name and optional non default port number
  • Alias matching host name and port number
  • *:port if the port is other then default
  • Default server

Property name Default Description
group lb:0 (The default loadbalancer) Name of the tomcat group or worker that will process the request corresponding to the uri. This used to be called 'worker'
context the context path for this uri component (webapp style).
servlet Servlet path for this mapping
alias server name alias. This setting should only be used for host uris like [uri:myHost:myPort] ( i.e. no /)


uriは、ワーカへのリクエストの一致に使われ、プロパティと関連しているパターンを保存します。

もし uri名がスラッシュを持たないなら、それは仮想ホスト指示子と考えられます。uri名は仮想ホスト名と(または)関連するポートを持つことができます。それらの名前の書式は hostname または hostname:port となります。hostnameは仮想サーバ名で、ポートは仮想サーバのポート番号を意味します。ポート番号はデフォルトサーバポートでない場合のみ指定します。

デフォルトサーバが [uri:*] と名づけられている場合は特別です。 これは仮想ホストが設定内に見つからない場合に使われます。 ホスト名を含んでいないすべてのuri指示子は、 グローバルマッピングを持つデフォルトサーバに属します。

ワイルド文字スキーマid [uri:*:port] の追加。 ある特別な(デフォルトでない)ポート番号の仮想ホストとマッチさせたい時に利用します。 たとえば[uri:*:443]のようにです。これは、名前が何であれ、 ポート番号443であるすべての仮想ホストについて、対応づけされます。

ホスト名が解決される手順 :

  • 正確なホスト名。オプションとしてデフォルトと異なるポート番号
  • ホスト名とポート番号が一致するエリアス
  • *:port。ポートがデフォルト以外の値だったら、デフォルト
  • デフォルトサーバ

プロパティ名 デフォルト 説明
group lb:0 (デフォルト・ロードバランサ) tomcatグループまたはワーカの名前。この名前はuriに一致するリクエストを処理します。 これは以前は'worker'というプロパティ名でした。
context このuriコンポーネント(webappスタイル)のためのコンテキストパス
servlet このマッピングのためのサーブレットパス
alias サーバ名のエリアス。これは[uri:myHost:myPort](すなわち / を含まない)のようなホスト uri に対してのみ設定できます。


vm


vm

Represents the JVM when used as inprocess container

Property name Default Description
JVM (Autoguess) JVM to use for this vm
OPT Option to pass to this vm, this is a multivalued property
classpath -Djava.class.path 0ption to pass to this vm, this is a multivalued property


内部プロセスコンテナとして利用されるJVMを意味します。

プロパティ名 デフォルト 説明
JVM (Autoguess) このvmで使用するJVM
OPT このvmへパスされるオプション。これは複数指定ができるプロパティです。
classpath このvmへ、-Djava.class.path オプションをパスします。これは複数の値を指定できるプロパティです。


channels


channels

A channel represents a transport protocol, connecting 2 sides for RPC communication. The most common and standard is the tcp socket. Other important channels are unix socket and jni


channelはRPC通信のために2つの通信サイドを接続する転送プロトコルを意味します。もっとも共通に使われていて、標準となっているものにTCPソケットがあります。 他に重要なchannelとしては、UNIXソケットとJNIがあります。

channel.un


channel.un

AF_UNIX socket. Only on UNIX like platform. These sockets are faster than "normal" sockets but they are limited to the machine.

Property name Default Description
file Name of socket Name of the socket file (It is created by the Tomcat ChannelUn)


AF_UNIX ソケット。UNIX 系プラットフォームのみ有効です。 これらのソケットは"通常"のソケットよりも高速ですが、動作するマシンは制限されています。

プロパティ名 デフォルト 説明
file ソケット名 ソケットファイル名(Tomcat ChannelUnによって作成されます)


channel.socket


channel.socket

A communication transport to a remote Engine Magic: The local part of the name will be the Engine name, to use when defining the uri mappings. For example channel.socket.local_9009 will automatically define an engine named local_9009, and if no other setting is set ajp13 will be used for communication. Magic: If no channel is defined in the config, a default channel will be constructed with port=8009, engine=DEFAULT, worker=ajp13 - named 'channel.socket.DEFAULT'

Property name Default Description
port 8009 Port where Tomcat is listening
host localhost Remote host
keepalive 0 ?
lbfactor 1 Load balancing factor to use. At this moment, it'll be set on the worker, but in future it should be possible to use lb on a channel level.
group lb:0 loadbalanced groups to which this channel and the associated worker will be added, multivalued
tomcatId ? ?


リモートエンジンへの通信路 Magic: ローカルパートの名前はエンジン名で、 uriとの対応を決めるときに使用されます。 例えば、channel.socket.local_9009 は自動的にlocal_9009という名前のエンジンを決めます。そして、もし他に設定が無ければ、ajp13が通信に利用されます。 Magic: もし設定においてchannelが1つも定義されていない場合は、 port=8009, engine=DEFAULT, worker=ajp13 という設定で、名前が'channel.socket.DEFAULT'というデフォルトchannelが構築されます。

プロパティ名 デフォルト 説明
port 8009 Tomcatが利用するポート番号
host localhost リモートホスト
keepalive 0 ?
lbfactor 1 ロードバランシングの要素。現時点では、worker上で設定されるでしょう。 しかし、将来的には、channelレベルのlbを使って指定できるようになるでしょう。
group lb:0 このchannelと関連があるworkerが追加されるロードバランスされたグループ。複数の値が指定可能。
tomcatId ? ?


channel.apr


channel.apr

A communication transport to a remote Engine using APR library Magic: The local part of the name will be the Engine name, to use when defining the uri mappings. For example channel.apr.local_9009 will automatically define an engine named local_9009, and if no other setting is set ajp13 will be used for communication. Magic: If no channel is defined in the config, a default channel will be constructed with port=8009, engine=DEFAULT, worker=ajp13 - named 'channel.apr.DEFAULT'

Property name Default Description
port 8009 Port where Tomcat is listening
host localhost Remote host
keepalive 0 (disabled) If set to 1 then it enables the use of keep-alive packets on TCP connection
timeout 0 (infinite) Socket timeout for sending and receiving
ndelay 0 If set to 1 Disables the Nagle algorithm for send coalescing
lbfactor 1 Load balancing factor to use. At this moment, it'll be set on the worker, but in future it should be possible to use lb on a channel level.
group lb:0 loadbalanced groups to which this channel and the associated worker will be added, multivalued


APRライブラリを使ったリモートエンジンへの通信路 Magic: ローカルパートの名前はエンジン名で、 uriとの対応を決めるときに使用されます。 例えば、channel.apr.local_9009 は自動的にlocal_9009という名前のエンジンを決めます。そして、もし他に設定が無ければ、ajp13が通信に利用されます。 Magic: もし設定においてchannelが1つも定義されていない場合は、 port=8009, engine=DEFAULT, worker=ajp13 という設定で、名前が'channel.apr.DEFAULT'というデフォルトchannelが構築されます。

プロパティ名 デフォルト 説明
port 8009 Tomcatが利用するポート番号
host localhost リモートホスト
keepalive 0 (無効) 1が設定されたら、TCPコネクションでのkeep-aliveパケットが有効になります。
timeout 0 (無限) ソケット通信での送信受信のタイムアウト
ndelay 0 1が設定されたら、小さいパケットをまとめて送るNagleアルゴリズムを無効にします。
lbfactor 1 ロードバランシングの要素。現時点では、worker上で設定されるでしょう。 しかし、将来的には、channelレベルのlbを使って指定できるようになるでしょう。
group lb:0 このchannelと関連があるworkerが追加されるロードバランスされたグループ。複数の値が指定可能。


channel.jni


channel.jni

The jni channel, used if tomcat is started inprocess


jni channel。tomcatがinprocessで開始された時に使われます。



workers


workers

For the moment 4 worker types are supported: worker.jni,ajp13,status,lb.


現時点では、worker.jni、ajp13、status、lb の 4 つのタイプのワーカがサポートされています。

worker.jni


worker.jni

worker used in inprocess, holds the details of the Tomcat class to startup, and parameters to pass

There are two predefined jni workers onStartup and onShutdown . Those two workers are executed during startup and shutdown phase of the connector. Both must exists in the configuration to be able to start and shutdown Tomcat.

Property name Default Description
class org/apache/jk/apr/TomcatStarter class that holds the main method called to start tomcat
ARG Arguments to pass to main method when called
stdout NULL file to redirect Standard output from the java process
stderr NULL file to redirect Standard output from the java process


内部プロセスにおいて利用されるワーカは、起動するためのTomcatクラスの詳細と、渡すためのパラメータを持ちます。

onStartup onShutdown という2つのあらかじめ定義されたjni ワーカがあります。それらの2つのワーカはコネクターの起動時と停止時に実行されます。2つともTomcatを起動、停止可能にするために設定が存在していなければなりません。

プロパティ名 デフォルト 説明
class org/apache/jk/apr/TomcatStarter tomcatを開始するためのmainメソッドを持つクラス
ARG meinメソッドへパスされる引数
stdout NULL Javaプロセスからの標準出力をリダイレクトするファイル名
stderr NULL Javaプロセスからの標準出力(訳注:標準エラー出力ではないだろうか)をリダイレクトするファイル名


ajp13


ajp13

Default worker

Property name Default Description
secretkey NULL Magic: The secret key will be set automatically on the associated worker.
tomcatId
route
group
level
channel
max_connections 0 (unlimited) Maximum number of currently used endpoints. If the specified number is reached then the load balancer has the chance to try another worker. This is very useful in situations when having multiple servers and you wish to finer grade the lb_factor.


デフォルトワーカ

プロパティ名 デフォルト 説明
secretkey NULL Magic: 秘密鍵は関連するworkerに自動的に設定されます。
tomcatId
route
group
level
channel
max_connections 0 (無制限 unlimited) 現在使用されているエンドポイントの最大値。 指定した数に達したら、ロードバランサは他のworkerへ試行する機会を得ます。 これは、複数のサーバがありlb_factorをより細かく調整したいような状況ではとても有効です。


status


status

Worker that outputs a page with usefull information to monitor JK2

To use it add a uri component assigned to this worker


JK2をモニタするための有用な情報をページへ出力するワーカ

利用するためには、このワーカに割り当てるuriコンポーネントを追加します。


lb


lb

Loadbalanced worker

Property name Default Description
worker
noWorkerMsg
noWorkerCode 503
hwBalanceErr
timeout 0 (disabled) If all the workers are in the error state, probably by Tomcat refusing any new connections due to the overload, you can set the timeout forcing lb to wait that some worker becomes available, instead of immediately returning error to the client. This is very useful in situations with high peek load. The timeout should be set to the maximum application call time, but not less then 1 second.
attempts 3 Number of attempts that lb will try on each worker before giving up.
recovery 60 (seconds) Time to wait before retrying to see if the worker came out of the error state.


ロードバランスをするワーカ

プロパティ名 デフォルト 説明
worker
noWorkerMsg
noWorkerCode 503
hwBalanceErr
timeout 0 (無効) たとえばTomcatが過度な負担の原因となる新しい接続を拒絶することによって、すべてのワーカがエラー状態になる場合は、timeoutを設定してみましょう。これはlbに対して、クライアントに即時でエラーを返す代わりに、いくつかのワーカが有効になるまで待たせることを強制する働きがあります。これはハイピークロード(high peek load)のような状況ではとても有効です。timeoutはアプリケーション呼び出し時間の最大値を指定すべきです。ただし、1秒未満は指定してはいけません。
attempts 3 試行回数。lbが各ワーカに、あきらめずに試してみる回数
recovery 60 (seconds) ワーカがエラー状態になっているように見える時に、再試行の前に待機する時間



loggers


loggers

Any connector based on jk2, at least has a default logger, that can be reached using the "logger" alias, the logger used is the more appropiate for the plataform/server combination, Apache2 under in any platform has logger.apache2 as default, IIS on his only platform uses logger.win32, and Any apache 1 install uses logger.file as default.., the config file lets you change that defaults, you can end using logger.file in IIs i.e

The properties shared by all loggers are:

Property name Default Description
level INFO Log level. Supported: EMERG, ERROR, INFO, DEBUG


jk2をベースとしてコネクタはどれでも、少なくともデフォルトloggerをもっています。それは "logger"エリアスを利用して到達できます。 利用されるloggerはプラットフォームとサーバの組み合わせによって、さらに特定できます。(appropiate → appropriate) Apache2はどのプラットフォームの下でもデフォルトとしてlogger.apache2を持っています。IISはlogger.win32を使用する唯一のプラットフォームです。そしてapache 1 はどのプラットフォームでもデフォルトとしてlogger.fileを使用します。設定ファイルでデフォルトを変更できます。たとえば、IISにおいてlogger.fileを使ってファイルの末尾にログを追加することもできます。

すべてのloggerで共通のプロパティ:

プロパティ名 デフォルト 説明
level INFO ログレベル。サポートされている値: EMERG, ERROR, INFO, DEBUG

logger.file


logger.file

Property name Default Description
file ${serverRoot}/logs/jk2.log Log file. XXX you may be able to change this at runtime, to implement rolling.


プロパティ名 デフォルト 説明
file ${serverRoot}/logs/jk2.log ログファイル. XXX rollingを実装することにより、実行時にこれを変更できるかもしれません。


logger.win32


logger.win32

logger used in the IIS server by default, it ends at native Application Event Log.


デフォルトでIISサーバで利用されるloggerです。ネイティブ・アプリケーション・イベント・ログの末尾にログを追加します。


logger.apache2


logger.apache2

Logger used in Apache2 servers, it normally in ends in error.log


Apache2サーバで利用されるloggerです。通常は error.log の末尾にログを追加します。



[訳注: これは小山 博史が翻訳しました。日本語訳に対するコメントがあれば、こちらに送って下さい。]