この章では、Oracle Identity ManagerをクラスタJBossアプリケーション・サーバー環境にデプロイする方法を示します。
この章では次の項目について説明します。
注意: クラスタ環境へのアプリケーションのデプロイは複雑な手順です。このドキュメントは、JBossクラスタでのアプリケーションのインストールと使用に関する専門知識が読者にあることを前提としています。次の手順ではOracle Identity Manager固有の詳細のみを説明します。JBossクラスタを設定するための詳しい説明ではありません。クラスタ化の詳細は、JBossのドキュメントを参照してください。 |
Oracle Identity ManagerをJBossクラスタにインストールするには、次の一般的なタスクを完了する必要があります。
JBossクラスタの第1ノードにOracle Identity Managerをインストールします。
詳細は、「第1ノードへのOracle Identity Managerサーバーのインストール」を参照してください。
JBossとOracle Identity Managerのインストール・ディレクトリを、JBossクラスタの第1ノードからその他のすべてのノードにコピーします。その際に元のディレクトリ構造を維持してください。
詳細は、「その他のJBossノードへのOracle Identity Managerのコピー」を参照してください。
データベースとしてSQL Serverを使用している場合は、JDBCドライバ・ファイル(mssqlserver.jar、msbase.jarおよびmsutil.jar)を探し、<JBOSS_HOME>\server\all\libディレクトリにコピーします。
詳細は、「SQL ServerのためのJBossの構成」を参照してください。
JBossクラスタのためにロード・バランサを設定します。
詳細は、「JBossのためのロード・バランサの設定」を参照してください。
JBossクラスタでOracle Identity Managerのインストール後構成を実行します。
詳細は、「JBossクラスタでのOracle Identity Managerの構成」を参照してください。
クラスタを起動します。
詳細は、「JBossクラスタの起動」を参照してください。
「WindowsでのOracle Identity Managerサーバーのインストール」または「UNIXまたはLinuxでのOracle Identity Managerサーバーのインストール」のOracle Identity Managerサーバーのインストール手順に従い、JBossクラスタの第1ノードにOracle Identity Managerをインストールします。
JBossクラスタのその他の各ノードについて、JBossとOracle Identity Managerのインストール・ディレクトリを第1ノードから他のすべてのノードにコピーします。その際に元のディレクトリ構造と階層を維持してください。
JBossクラスタに対してロード・バランサをインストールする手順は、JBossノードがインストールされているホスト・マシンで実行しているオペレーティング・システムによって異なります。
Windowsでロード・バランサを設定するには、次のようにします。
Apache2 Webサーバーの最新配布パッケージをApache.orgからダウンロードし、Apacheサーバーをディレクトリにインストールします。このドキュメントではこのディレクトリを<APACHE_HOME>として説明します。
最新の配布パッケージmod_jk 1.2.xをhttp://tomcat.apache.org/download-connectors.cgi
の「Tomcat connector」セクションのページからダウンロードします。
ライブラリmod_jk.soを<APACHE_HOME>/modulesディレクトリにコピーします。
次の行(コメント行も含めて)を<APACHE_HOME>\conf\httpd.confファイルの最後に追加して、Apacheがmodjkを使用するように設定します。
# Include mod_jk configuration file
Include conf/mod_jk.conf
ディレクトリ<APACHE_HOME>/confに、リクエストをJBossインスタンスに転送するための構成ファイルを作成します。
このファイルにmod_jk.confという名前を付けて、次の行を入力します。
# Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf/workers.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications JkMount /application/* loadbalancer # You can use external file for mount points. # It will be checked for updates each 60 seconds. # The format of the file is: /url=worker # /examples/*=loadbalancer JkMountFile conf/uriworkermap.properties # Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly JkShmFile logs/jk.shm # Add jkstatus for managing runtime data <Location /jkstatus/> JkMount status Order deny,allow Deny from all Allow from all </Location>
次のApache Tomcat Connector Documentation Index Webサイトにあるディレクティブの説明を確認してください。
http://tomcat.apache.org/connectors-doc/
Apacheのキャッシュ・サイズに関連するガイドラインを調べてください。
ディレクトリ<APACHE_HOME>/confに、workers.propertiesという名前のファイルを作成し、次の行を入力します。
# Define list of workers that will be used # for mapping requests worker.list=loadbalancer,status # Define Node1 # modify the host as your host IP or DNS name. worker.node1.port=8009 worker.node1.host=<IP of node1> worker.node1.type=ajp13 worker.node1.lbfactor=1 # worker.node1.local_worker=1 (1) worker.node1.cachesize=10 # Define Node2 # modify the host as your host IP or DNS name. worker.node2.port=8009 worker.node2.host= <IP of node2> worker.node2.type=ajp13 worker.node2.lbfactor=1 # worker.node2.local_worker=1 (1) worker.node2.cachesize=10 # Load-balancing behavior worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=node1,node2 worker.loadbalancer.sticky_session=1 # worker.loadbalancer.local_worker_only=1 # worker.list=loadbalancer
JBossクラスタに3つ以上のノードが含まれる場合は、ディレクトリ<APACHE_HOME>/confのworkers.propertiesファイルにさらに行を追加する必要があります。
たとえば3つのノードがある場合は、次の行を追加する必要があります。
# modify the host as your host IP or DNS name. worker.node3.port=8009 worker.node3.host= <IP of node3> worker.node3.type=ajp13 worker.node3.lbfactor=1 # worker.node3.local_worker=1 (1) worker.node3.cachesize=10
さらにノードがある場合はそれぞれについて、この一連の行を追加する必要があります。このとき、node3はnode4、node5、node6などに適宜変更してください。
<APACHE_HOME>/confディレクトリに、ファイルuriworkermap.propertiesを作成します。このファイルは、ApacheがTomcatに転送するURLマッピングを含みます。
特に、このファイルによって、mod_jkが、/mx-console、/web-console、/xlWebApp、/xlSchedulerおよび/NexawebからのリクエストをTomcatに転送できるようになります。各行の構文は/url=worker_name
です。作成したファイルに次の例を貼り付けます。
# Simple worker configuration file # Mount the Servlet context to the ajp13 worker /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer /xlWebApp=loadbalancer /xlWebApp/*=loadbalancer /xlScheduler=loadbalancer /xlScheduler/*=loadbalancer /Nexaweb=loadbalancer /Nexaweb/*=loadbalancer
Apacheを起動します。これには、Windowsエクスプローラを起動し、ディレクトリ<APACHE_HOME>/binにナビゲートして、Apache.exeをダブルクリックします。
UNIXまたはLinuxでロード・バランサを設定するには、次のようにします。
UNIXまたはLinux用のApache 2.0のバイナリ・ファイルを次のURLからダウンロードします。
次のコマンドを実行してApacheをインストールします。
tar xvfz httpd-2.0.54.tar.gz
cd httpd-2.0.54
./configure --prefix=/opt/apache2 --enable-module=so
make
make install
次のURL: http://www.apache.org/
で検索を実行し、Apache Software Foundation Webサイトからファイル jakarta-tomcat-connectors-1.2.14-src.tar.gz
をダウンロードします。
次のコマンドを実行してコネクタをインストールします。
tar xzvf jakarta-tomcat-connectors-1.2.14-src.tar.gz
cd jakarta-tomcat-connectors-1.2.14-src/jk/native
chmod 755 buildconf.sh
./buildconf.sh
./configure --with-apxs=/opt/apache2/bin/apxs
make
make install
cd / jakarta-tomcat-connectors-jk1.2.14-src/jk/native/apache-2.0
/
cp mod_jk.so /opt/apache2/modules/
「WindowsでのJBossのためのロード・バランサの設定」の手順4〜8を実行します。この手順はWindows、UNIX、Linuxで共通です。
<APACHE_HOME>\bin\ディレクトリにナビゲートし、次のコマンドを実行します。
./apachectl start
Oracle Identity ManagerをJBossクラスタにインストールした後で、クラスタの各ノードで特定の構成手順を実行する必要があります。
JBossクラスタでOracle Identity Managerを構成するには、次のようにします。
クラスタ内の連続する各ノードで、ディレクトリ<JBOSS_HOME>/server/all/deploy/jbossweb-tomcat55.sar/にナビゲートし、テキスト・エディタでserver.xmlを開き、次の手順を実行します。
次の文字列を確認します。
<Engine name="jboss.web" defaultHost="localhost" jvmRoute
jvmRoute
という値を、現在作業しているマシンに対応するノードの名前に変更します。(ノードの名前は、現在作業しているマシンに対応するファイルworkers.propertiesで指定されているnode1、node2、node3などとする必要があります)。
例:
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">
クラスタ内の連続する各ノードで、ディレクトリ<JBOSS_HOME>/ server/all/deployにナビゲートし、次のファイルを開きます。
cluster-service.xml
tc5-cluster-service.xml
これらのファイルで次のブロックをコメント化します。
<!-- <Config> <UDP mcast_addr="228.1.2.3" mcast_port="45566" ip_ttl="8" ip_mcast="true" mcast_send_buf_size="800000" mcast_recv_buf_size="150000" ucast_send_buf_size="800000" ucast_recv_buf_size="150000" loopback="false"/> <PING timeout="2000" num_initial_members="3" up_thread="true" down_thread="true"/> <MERGE2 min_interval="10000" max_interval="20000"/> <FD shun="true" up_thread="true" down_thread="true" timeout="2500" max_tries="5"/> <VERIFY_SUSPECT timeout="3000" num_msgs="3" up_thread="true" down_thread="true"/> <pbcast.NAKACK gc_lag="50" retransmit_timeout="300,600,1200,2400,4800" max_xmit_size="8192" up_thread="true" down_thread="true"/> <UNICAST timeout="300,600,1200,2400,4800" window_size="100" min_threshold="10" down_thread="true"/> <pbcast.STABLE desired_avg_gossip="20000" up_thread="true" down_thread="true"/> <FRAG frag_size="8192" down_thread="true" up_thread="true"/> <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/> <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/> </Config> -->
両方のファイルで次のブロックのコメント化を解除します。
<Config> <TCP bind_addr="thishost" start_port="7800" loopback="true"/> <TCPPING initial_hosts="thishost[7800],otherhost[7800]" port_range="3" timeout="3500" num_initial_members="3" up_thread="true" down_thread="true"/> <MERGE2 min_interval="5000" max_interval="10000"/> <FD shun="true" timeout="2500" max_tries="5" up_thread="true" down_thread="true" /> <VERIFY_SUSPECT timeout="1500" down_thread="false" up_thread="false" /> <pbcast.NAKACK down_thread="true" up_thread="true" gc_lag="100" retransmit_timeout="3000"/> <pbcast.STABLE desired_avg_gossip="20000" down_thread="false" up_thread="false" /> <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="false" print_local_addr="true" down_thread="true" up_thread="true"/> <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/> </Config>
手順bに示すブロック内で、thishost
を現在作業しているマシンのIPで置き換えます。
IPリスト全体を二重引用符で囲む必要があります。たとえば、TCPbind_addr="192.168.161.20"
のように指定します。
手順bに示すブロック内で、otherhost
をクラスタの他のマシンのIPで置き換えます。または、クラスタに3つ以上のノードが含まれる場合は、otherhost
をすべてのIPのカンマ区切りリストで置き換えます。
IPを二重引用符で囲む必要があります。
クラスタ内の連続する各ノードで、<XL_HOME>/xellerate/config/xlconfig.xmlファイルを変更します。
<Discovery>
セクションでjava.naming.provider.url
の設定を探し、クラスタ内のすべてのノードに対応するURLのカンマ区切りリストを挿入します。
たとえば、次のような文字列があるとします。
<java.naming.provider.url> jnp://localhost:1100 </java.naming.provider.url> to the following string: <java.naming.provider.url> jnp://<IP of node1>:1100,<IP of node 2>:1100 </java.naming.provider.url>
2番目およびそれ以降のクラスタ・メンバーで次の手順を実行して、クラスタが共通データベースを使用するように構成します。
プレーン・テキスト・エディタを起動し、ディレクトリ<JBOSS_HOME>\server\all\deploy-hasingleton\jms\にナビゲートし、ファイル<database_name>-jdbc2-service.xmlを開きます。
<database_name>は、クラスタで使用される共通のデータベースを表すことに注意してください。
<database_name>-jdbc2-service.xmlのsqlPropertiesセクションのすべての問合せと文において、JMS_MESSAGESおよびJMS_TRANSACTIONSで表される表の名前を、有効で新しい一意の値に変更します。
ファイルの最後に次の文を追加します。
DELETE_TEMPORARY_MESSAGES = DELETE FROM <NEW_JMS_MESSAGES_NAME> WHERE TXOP='T' CREATE_IDX_MESSAGE_TXOP_TXID = CREATE INDEX <NEW_JMS_MESSAGES_NAME>_TXOP_TXID ON <NEW_JMS_MESSAGES_NAME> (TXOP, TXID) CREATE_IDX_MESSAGE_DESTINATION = CREATE INDEX <NEW_JMS_MESSAGES_NAME>_DESTINATION ON <NEW_JMS_MESSAGES_NAME>(DESTINATION)
ファイルを保存して閉じます。
Oracle Identity Managerをインストールして構成したJBossクラスタを起動するには、次のようにします。
最初に、クラスタ内の1ノード(通常、マスター・ノードと呼ばれる)のみを起動します。
ディレクトリ<XL_HOME>/xellerate/binにナビゲートし、JBossアプリケーション・サーバーとOracle Identity Managerのホスト・マシンのオペレーティング・システムに応じて次のいずれかのコマンドを実行します。
Windowsの場合:
xlStartServer.bat
UNIXまたはLinuxの場合:
xlStartServer.sh
クラスタのその他の各マシンで、ディレクトリ<XL_HOME>/xellerate/binにナビゲートし、JBossアプリケーション・サーバーとOracle Identity Managerのホスト・マシンのオペレーティング・システムに応じて次のいずれかのコマンドを実行します。
Windowsの場合:
xlStartServer.bat
UNIXまたはLinuxの場合:
xlStartServer.sh
ブラウザを起動し次のURLを指定して、管理コンソールにアクセスします。
http://<Apacheサーバーを実行しているマシンのIP>/xlWebApp