Archive for 6月, 2007

Web Server 7.0 から Web Server 7.0 Update1へのアップデート方法

今日は、SJS Web Server 7.0からSJS Web Server 7.0 Update 1へのアップデート方法
について説明します。
SJS Web Server 7.0から7.0 Update 1へのアップデート方法は非常に簡単です。

7.0 Update 1を御入手いただいた後、Update 1のsetupを実行してください。
そしてインストール先として既存のWeb Server 7.0のディレクトリを指定してください。
ディレクトリを指定後、「次へ」ボタンを押下すると、下記のような画面が表示されます。

ここでは、インストーラが自動的に既存の情報を入手し必要なライブラリのみ
アップデートインストールしてくれます。
実際にこの手法でアップデートした後、アップデートされたファイルを確認してみました。
Web Server 7.0 Upadte 1をアップデートした日付を6月27日とします。
そして、ファイルの更新日付が6月27日の内容だけを確認してみます。

その結果、管理サーバを初めとし既存のインスタンスの内容には一切変更は施されていない事がわかります。つまり、アップデートする為に再度Web Serverのインスタンスを設定をしなおさなくてもそのまま設定が反影される事がわかります。既存の設定が壊れる事はありませんので容易にアップデートが可能です。

※ ただし、アップデートの際は管理サーバやインスタンスは停止してアップデートしてください。

#  ls -lt 
合計 28
drwx------   2 root     root         512  6月 27日  20:29 setup
drwxr-xr-x   3 root     root         512  6月 27日  20:28 bin
drwxr-xr-x  13 root     root        3072  6月 27日  20:28 lib
-rw-r--r--   1 root     root         726  6月 27日  20:27 README.txt
drwxr-xr-x   2 root     root         512  6月 27日  20:27 Legal
drwxr-xr-x   8 root     root         512  6月 27日  20:27 include
drwxr-xr-x  11 root     root         512  6月 13日  23:10 https-test.Japan.Sun.COM
drwxr-xr-x   9 root     other        512  6月 13日  18:57 jdk
drwxr-xr-x   2 root     root         512  5月 31日  22:10 etc
drwxr-xr-x   9 root     root         512  5月 28日  21:12 admin-server
drwxr-xr-x   6 root     root         512  5月 28日  10:34 plugins
drwxr-xr-x   7 root     root         512  5月 28日  10:34 samples
#  pwd
/sun/webserver7/bin
# ls -lt
合計 252
-rwxr-xr-x   1 root     root       29332  6月 27日  20:28 uninstall
-rwxr-xr-x   1 root     root       66184  6月 27日  20:27 flexanlg
-rwxr-xr-x   1 root     root       17068  6月 27日  20:27 htpasswd
lrwxrwxrwx   1 root     root           7  5月 28日  10:35 64 -> sparcv9
-rwxr-xr-x   1 root     root        1062  5月 28日  10:35 schemagen
-rwxr-xr-x   1 root     root        1015  5月 28日  10:35 xjc
-rwxr-xr-x   1 root     root         426  5月 28日  10:35 wsimport
-rwxr-xr-x   1 root     root         421  5月 28日  10:35 wsgen
drwxr-xr-x   2 root     root         512  5月 28日  10:35 sparcv9
-rwxr-xr-x   1 root     root         540  5月 28日  10:35 jspc
-rwxr-xr-x   1 root     root         941  5月 28日  10:35 modutil
-rwxr-xr-x   1 root     root         942  5月 28日  10:35 certutil
-rwxr-xr-x   1 root     root         942  5月 28日  10:35 pk12util
-rwxr-xr-x   1 root     root        1308  5月 28日  10:35 wdeploy
-rwxr-xr-x   1 root     root        1439  5月 28日  10:35 wadm
#
#  pwd 
/sun/webserver7/lib
# ls -lt
合計 114546
-rw-r--r--   1 root     root     7747324  6月 27日  20:28 webserv-jwsdp.jar
-rw-r--r--   1 root     root       44623  6月 27日  20:28 activation.jar
-rw-r--r--   1 root     root      270394  6月 27日  20:28 mail.jar
-rw-r--r--   1 root     root      698579  6月 27日  20:28 jss4.jar
-rw-r--r--   1 root     root      263556  6月 27日  20:28 ldapjdk.jar
-rw-r--r--   1 root     root      497796  6月 27日  20:28 ktsearch.jar
-rw-r--r--   1 root     root     1034049  6月 27日  20:28 ant.jar
-rw-r--r--   1 root     root         476  6月 27日  20:28 libfreebl_32int64_3.chk
-rw-r--r--   1 root     root         476  6月 27日  20:28 libfreebl_32int_3.chk
-rw-r--r--   1 root     root         476  6月 27日  20:28 libfreebl_32fpu_3.chk
-rw-r--r--   1 root     root         476  6月 27日  20:28 libsoftokn3.chk
-rw-r--r--   1 root     root     9902188  6月 27日  20:28 libicudata.so.3
-rw-r--r--   1 root     root     1170776  6月 27日  20:28 libicuuc.so.3
-rw-r--r--   1 root     root     1437600  6月 27日  20:28 libicui18n.so.3
-rwxr-xr-x   1 root     root       66452  6月 27日  20:28 libz.so
-rwxr-xr-x   1 root     root      482360  6月 27日  20:28 libfreebl_32int64_3.so
-rwxr-xr-x   1 root     root      430888  6月 27日  20:28 libfreebl_32int_3.so
-rwxr-xr-x   1 root     root      599128  6月 27日  20:28 libfreebl_32fpu_3.so
-rwxr-xr-x   1 root     root      588448  6月 27日  20:28 libsoftokn3.so
-rwxr-xr-x   1 root     root      304172  6月 27日  20:28 libjss4.so
-rwxr-xr-x   1 root     root      414472  6月 27日  20:28 libnssckbi.so
-rwxr-xr-x   1 root     root      162780  6月 27日  20:28 libsasl.so
-rwxr-xr-x   1 root     root       51488  6月 27日  20:28 libssldap60.so
-rwxr-xr-x   1 root     root       34344  6月 27日  20:28 libprldap60.so
-rwxr-xr-x   1 root     root      422884  6月 27日  20:28 libldap60.so
-rwxr-xr-x   1 root     root      434288  6月 27日  20:28 libnspr4.so
-rwxr-xr-x   1 root     root       17228  6月 27日  20:28 libplds4.so
-rwxr-xr-x   1 root     root       43780  6月 27日  20:28 libplc4.so
-rwxr-xr-x   1 root     root      885804  6月 27日  20:28 libnss3.so
-rwxr-xr-x   1 root     root      284568  6月 27日  20:28 libsmime3.so
-rwxr-xr-x   1 root     root      283620  6月 27日  20:28 libssl3.so
-rwxr-xr-x   1 root     root      137100  6月 27日  20:28 pk12util
-rwxr-xr-x   1 root     root      309728  6月 27日  20:28 modutil
-rwxr-xr-x   1 root     root      203376  6月 27日  20:28 certutil
drwxr-xr-x   2 root     root        4608  6月 27日  20:28 htmlconvert
drwxr-xr-x   4 root     root         512  6月 27日  20:28 snmp
drwxr-xr-x   2 root     root         512  6月 27日  20:28 tlds
-rwxr-xr-x   1 root     root       23871  6月 27日  20:28 migrateServer.pl
drwxr-xr-x   2 root     root        1536  6月 27日  20:28 messages
drwxr-xr-x   3 root     root        1024  6月 27日  20:28 perl
drwxr-xr-x   3 root     root         512  6月 27日  20:28 install
drwxr-xr-x   2 root     root         512  6月 27日  20:28 icons
drwxr-xr-x   2 root     root         512  6月 27日  20:28 dtds
-rw-r--r--   1 root     root       55028  6月 27日  20:28 s1as-jsr160-server.jar
-rw-r--r--   1 root     root       36050  6月 27日  20:28 container-auth.jar
-rw-r--r--   1 root     root       22342  6月 27日  20:28 deployment-api.jar
-rw-r--r--   1 root     root       36600  6月 27日  20:28 sun-ws-jsr88-dm.jar
-rw-r--r--   1 root     root     1965940  6月 27日  20:28 webserv-rt.jar
-rw-r--r--   1 root     root      383236  6月 27日  20:28 webserv-jstl.jar
-rw-r--r--   1 root     root      531457  6月 27日  20:28 webserv-admin.jar
-rw-r--r--   1 root     root     2786266  6月 27日  20:28 pwc.jar
-rw-r--r--   1 root     root      323012  6月 27日  20:28 jsf-api.jar
-rw-r--r--   1 root     root     1210046  6月 27日  20:28 jsf-impl.jar
-rwxr-xr-x   1 root     root       17744  6月 27日  20:28 libadminsecurity.so
-rwxr-xr-x   1 root     root      136004  6月 27日  20:28 libwssecurity.so
-rwxr-xr-x   1 root     root       37132  6月 27日  20:28 libwsserverctrl.so
-rwxr-xr-x   1 root     root       15904  6月 27日  20:28 libwslifecycle.so
-rwxr-xr-x   1 root     root       18840  6月 27日  20:28 libwsconfigurator.so
-rwxr-xr-x   1 root     root      145176  6月 27日  20:28 libwsconfig.so
-rwxr-xr-x   1 root     root       72304  6月 27日  20:28 libmonitorjni.so
-rwxr-xr-x   1 root     root       28836  6月 27日  20:28 libadminjni.so
-rwxr-xr-x   1 root     root       15184  6月 27日  20:28 libadminutil.so
-rwxr-xr-x   1 root     root     5113892  6月 27日  20:28 libxerces-c.so.26
-rwxr-xr-x   1 root     root       36960  6月 27日  20:28 libxalanMsg.so.19
-rwxr-xr-x   1 root     root     6241880  6月 27日  20:28 libxalan-c.so.19
-rwxr-xr-x   1 root     root       67472  6月 27日  20:28 libpcre.so.0
-rwxr-xr-x   1 root     root       52240  6月 27日  20:28 libxsd2cpp.so
-rwxr-xr-x   1 root     root      188128  6月 27日  20:28 libwebdav.so
-rwxr-xr-x   1 root     root       93184  6月 27日  20:28 libsupport.so
-rwxr-xr-x   1 root     root       13132  6月 27日  20:28 libCld.so
-rwxr-xr-x   1 root     root        7524  6月 27日  20:28 libShtml.so
-rwxr-xr-x   1 root     root       13208  6月 27日  20:28 libnstp.so
-rwxr-xr-x   1 root     root       25224  6月 27日  20:28 libnstime.so
-rwxr-xr-x   1 root     root       73288  6月 27日  20:28 libnsprwrap.so
-rwxr-xr-x   1 root     root       50136  6月 27日  20:28 libnsfc.so
-rwxr-xr-x   1 root     root     4193796  6月 27日  20:28 libns-httpd40.so
-rwxr-xr-x   1 root     root      203088  6月 27日  20:27 liblibsi18n.so
-rwxr-xr-x   1 root     root       69420  6月 27日  20:27 liblibdbm.so
-rwxr-xr-x   1 root     root      260184  6月 27日  20:27 libj2eeplugin.so
-rwxr-xr-x   1 root     root        7584  6月 27日  20:27 libgetprop.so
-rwxr-xr-x   1 root     root      294244  6月 27日  20:27 libdavplugin.so
-rwxr-xr-x   1 root     root       31936  6月 27日  20:27 libares3.so
-rwxr-xr-x   1 root     root       11976  6月 27日  20:27 runmagt
-rwxr-xr-x   1 root     root      336484  6月 27日  20:27 httpagt
-rwxr-xr-x   1 root     root       74344  6月 27日  20:27 CertificateMgrUtil
-rwxr-xr-x   1 root     root       12068  6月 27日  20:27 svrctl
-rwxr-xr-x   1 root     root       18156  6月 27日  20:27 parsexml
-rwxr-xr-x   1 root     root       65904  6月 27日  20:27 dpstats
-rwxr-xr-x   1 root     root       38696  6月 27日  20:27 dblink
-rwxr-xr-x   1 root     root       32272  6月 27日  20:27 Cgistub
-rwxr-xr-x   1 root     root       11128  6月 27日  20:27 webservd
-rwxr-xr-x   1 root     root       72168  6月 27日  20:27 webservd-wdog
-rw-r--r--   1 root     root      206352  6月 27日  20:27 jmxremote_optional.jar
-rw-r--r--   1 root     root      168112  6月 27日  20:27 libcliutil.so
-rw-r--r--   1 root     root      130194  6月 27日  20:27 webserv-admin-shared.jar
-rw-r--r--   1 root     root     1319503  6月 27日  20:27 wadmcli.jar
-rw-r--r--   1 root     root      220775  6月 27日  20:27 tcljava.jar
-rw-r--r--   1 root     root       62270  6月 27日  20:27 s1as-jsr160-client.jar
-rw-r--r--   1 root     root       56936  6月 27日  20:27 jline.jar
-rw-r--r--   1 root     root      719297  6月 27日  20:27 jacl.jar
-rw-r--r--   1 root     root       81895  6月 27日  20:27 cli-framework.jar
-rw-r--r--   1 root     root       20988  6月 27日  20:27 webserv-rt-l10n.jar
-rw-r--r--   1 root     root      220685  6月 27日  20:27 webserv-admin-shared-l10n.jar
-rw-r--r--   1 root     root       38924  6月 27日  20:27 wadmcli-l10n.jar
-rw-r--r--   1 root     root        2576  6月 27日  20:27 cli-framework_zh_TW.jar
-rw-r--r--   1 root     root        2572  6月 27日  20:27 cli-framework_zh_CN.jar
-rw-r--r--   1 root     root        2695  6月 27日  20:27 cli-framework_ko.jar
-rw-r--r--   1 root     root        2723  6月 27日  20:27 cli-framework_ja.jar
-rw-r--r--   1 root     root        2505  6月 27日  20:27 cli-framework_fr.jar
-rw-r--r--   1 root     root        2493  6月 27日  20:27 cli-framework_es.jar
-rw-r--r--   1 root     root        2511  6月 27日  20:27 cli-framework_de.jar
drwxr-xr-x   2 root     root        1536  6月 27日  20:27 sparcv9
lrwxrwxrwx   1 root     root           7  5月 28日  10:35 64 -> sparcv9
-rwxr-xr-x   1 root     root        1348  5月 28日  10:35 searchadmin
-rwxr-xr-x   1 root     root         371  5月 28日  10:35 migrateServer
-rwxr-xr-x   1 root     root         317  5月 28日  10:35 wsenv
drwxr-xr-x   3 root     root         512  5月 28日  10:35 cpu
drwxr-xr-x   6 root     root         512  5月 28日  10:35 webapps
# pwd
/sun/webserver7/include
# ls -lt
合計 292
drwxr-xr-x   2 root     root         512  6月 27日  20:28 ldapsdk50
drwxr-xr-x   4 root     root        3072  6月 27日  20:28 nspr
drwxr-xr-x   2 root     root         512  6月 27日  20:27 shtml
-rw-r--r--   1 root     root      121806  6月 27日  20:27 nsapi.h
drwxr-xr-x   2 root     root         512  6月 27日  20:27 nsacl
-rw-r--r--   1 root     root         350  6月 27日  20:27 netsite.h
drwxr-xr-x   2 root     root         512  6月 27日  20:27 frame
-rw-r--r--   1 root     root        9001  6月 27日  20:27 drnsapi.h
drwxr-xr-x   2 root     root         512  6月 27日  20:27 base
#

※ nspr , shtml , nsacl , frame , baseディレクトリの中身は全て
アップデートされていました。

2007年6月27日 at 5:28 午前

高パフォーマンスで信頼できるWeb Proxyソリューション





弊社のSun Fire T1000, T2000等は非常に優れたパフォーマンスを

発揮するサーバ製品として良く知られています。特にWeb Serverや

Application Server等に対する用途として非常にマッチする事も

知られています。



今回、Web ServerやApplication Server以外にProxy Server

(実はHTTPのハンドリング等の部分はWeb Serverのコードを使用)

でも非常に優れたパフォーマンスを発揮する点をレポートに

まとめた資料がリリースされましたので報告します。



この資料の中には、Proxy Serverのベンチマークテストで良く使用されている、

Web Polygraphでの結果も記載されていますので、参考になるかと思います。



是非、一度御確認いただければと思います。




Sun’s High-Performance and Reliable Web Proxy Solution






上記資料によると、PolygraphというProxy Serverのベンチマークツールを

使用し、Sun Fire T2000でProxy 1インスタンスあたり、8000 req/secまで

スケールしています。(その際のコンテンツサイズは13Kbです。)



ただし、Sun Fire T2000で8000 req/secが最大なのかというとそうではありません。

その際のCPU使用率は20〜30%しか使用しておらず、

Proxy Serverに対する要求を8000 req/secまでいくとNIC(1GB)の限界に達し

(Network Utilizationが100%)、それ以上を処理できないというのが本当の所です。



Sun Fire T2000にはデフォルトでGigabit Ethernetのポートが4つ付いていますので、

T2000を効率的に使用する為には、Solaris 10の仮想化技術(zone)を使用し

zone毎にProxyをインストールする事でSun Fire T2000上では8000req/sec以上の

処理ができるという事が言えます。





Polygraphによるベンチマーク結果







2007年6月25日 at 10:03 午後

ドキュメントの日本語化




Sun Java System Web Server 7.0のドキュメントが一部

日本語化されました。

今回は要望が一部とおりパフォーマンスチューニングガイドも

翻訳されました。その中には、Sun Fire T2000上でのチューニングパラメータの設定例

等も記載されておりますので、是非一度御確認いただければと思います。



Sun Java System Web Server 7.0 – Japanese



Sun Java System Web Server 7.0 管理ガイド

Sun Java System Web Server 7.0 パフォーマンスのチューニング、サイジング、およびスケーリング

Sun Java System Web Server 7.0 リリースノート (UNIX 版)

Sun Java System Web Server 7.0 リリースノート (Windows 版)



※ リンク先に一部誤りがありました。(2006/06/26リンク先を修正しました。)




2007年6月24日 at 10:26 午後

SJS Web Server 7.0 Update 1のリリース



SJS Web Server 7.0のUpdate 1が正式リリースされました。



Web Server 7.0の
入手先






以前も、説明しましたが今回のリリースよりServlet 2.5, JSP 2.1, JSF1.2への

対応になります。



是非、上記より入手して御試しください。



ちなみに、7.0 → 7.0 u1において下記がサポートされております。

Sun Java System Web Server 7.0 Update 1 Release Note



● Java Servlet 2.5 and JavaServer Pages (JSP) 2.1 Support

● JavaServer Pages Standard Tag Library and JavaServer Faces 1.2 Support

● Java SE 5.0 and 6 Support

● Accelerator Cache Technology

● Administration Support for Configuring FastCGI

● NetBeans Support

● Admin Console Support for Configuring Regular Expressions

● GUI and CLI Support for Pattern Matching



この他、検索コレクションを作成した後、コレクションのアップデートを

スケジューリングできるようになっています。(下記御参照)





2007年6月21日 at 12:38 午前

JRuby on GlassFish v2



さて、今日はGlassFish v2 (Grizzly)上でJRubyを動かす方法を紹介します。

GlassFish上でJRubyを動かす方法は大きくわけて3通りあります。


1. JRubyでwarファイルを作成してwarをデプロイする方法

2. GlassFish上でCGI経由で実行する方法

3. GrizzlyでJRubyを動かす方法(将来的に。。。)

  3.1 GrizzlyでJRubyを動かす方法「JRuby on Rails でエンタープライズ Ruby (高井 直人)」



動作方法による簡易比較


現時点では、どの方法もまだ、一長一短があります。

1,2に関してはGlassFish v2上で動作させる事ができますが、3についてはGrizzly上で動かします。

3についてはGlassFish v3に組み込まれてくるのではないかと思いますが、現時点では???です。

そこで、今回はGlassFish v2で動作させる事のできる、1,2にしぼって説明します。



1.についてはパフォーマンスは良いのですが、毎回warを生成しデプロイしなおさなければならないのがとても面倒です。

2.については、毎回デプロイしなおさなくてもダイレクトに修正が反影される為、非常に便利です。

 しかしその一方、CGI呼び出しの為非常にパフォーマンスは悪くなっています。

 そこでこの方法は、開発時に使用していただければと思います。


 そんな開発者の為に、GlassFish v2のインストールから、GlassFish v2上でJRubyを呼び出す方法(CGI版)を下記に説明します。

 どうぞ開発者の皆様、下記の方法を試してみて下さい。






インストールする為に必要な物


GlassFish v2 Beta

  (ちなみに、私はv2-b41dより少し新しいv2-b50で試しています。)

JRuby: jruby-bin-1.0.tar




インストールと動作確認の手順は下記のステップに従い行います。

インストール手順


1.環境設定の確認

2.GlassFishのインストール

3.GlassFishの構成

4.GlassFishの管理ドメインの起動

5.JRubyのインストール

6.Railsのインストール

7.Railsのアプリケーション作成

8.Railsプログラムの作成

9.Railsのroute.rbの修正

10.GlassFishのドメイン中のdefault-web.xmlの修正

11.GlassFishのドメイン再起動

12.ドメイン上でサンプルアプリの動作確認

13.GlassFishのノードエージェントを作成

14.ノードエージェント上にインスタンスを作成

15.ノードエージェントとインスタンスの起動

16.インスタンス上でのサンプルアプリの動作確認




詳細手順



1. 環境設定の確認


まずは、環境設定です。最初のインストールする時点ではJAVA_HOMEだけが必要になりますが、

$GLASS_FISH_INSTALL/binにパスを通しておくとGlassFishの管理用コマンドを呼び出す事が

できるようになるので便利です。今回私はMacBookの自分のデスクトップ上にglassfishを構築しています。



  ※ DHCP環境にインストールされる場合は、host名に気をつけてください。DHCPから取得した

   ホスト名でインストールした場合、不具合が発生する可能性があります。

   (不具合例:ノードエージェントが正常に起動できない等。)





yosshi > cat ~/.cshrc

cat ~/.cshrc

set prompt=”yosshi > “

set history=200

setenv TERM vt100

setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

set path=(/Users/yt133043/Desktop/glassfish/bin /Users/yt133043/Desktop/glassfish/lib/jruby-1.0/bin

/Users/yt133043/Desktop/glassfish/lib/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/bin /usr/local/bin $path .)

setenv LD_LIBRARY_PATH /Users/yt133043/Desktop/glassfish/lib/jruby-1.0/lib:/Users/yt133043/Desktop/glassfish/lib/jruby-1.0/lib/ruby/gems/1.8/gems/rails-1.2.3/lib

setenv JRUBY_HOME /Users/yt133043/Desktop/glassfish/lib/jruby-1.0




2. GlassFishのインストール


さて準備が整いましたら、早速GlassFishをインストールしてみましょう。

インストールはコマンドラインから下記のコマンドを実行して行います。

実行するとライセンスの同意確認画面が表示されますので、[Accept]ボタンを押下します。





yosshi > java -Xmx256m -jar glassfish-installer-v2-b50.jar

glassfish

glassfish/docs

glassfish/docs/css

glassfish/docs/figures

glassfish/docs/graphics

glassfish/docs/images

********************************************中略

glassfish/updatecenter/lib/schema2beans.jar

glassfish/updatecenter/lib/schema2beansdev.jar

glassfish/updatecenter/lib/swing-layout-1.0.1.jar

glassfish/updatecenter/lib/updatecenter-gui.jar

glassfish/updatecenter/lib/updatecenter-installer.jar

glassfish/updatecenter/lib/updatecenter-javahelp.jar

glassfish/updatecenter/lib/updatecenter.jar

glassfish/updatecenter/LICENSE.txt

glassfish/updatecenter/README

glassfish/updatecenter/registry/SYSTEM/local.xml

installation complete





3. GlassFishの構成


インストールが無事完了[instllation complete]するとGlassFishを構成します。


構成を行う前に、Profileについて簡単に説明します。

GlassFish v2より構成を行うために、新たにProfileという概念が導入されました。

Profileは初期設定を簡素化する為、頻繁に利用される3種類の構成をテンプレート化したものです。

Profileには、開発者用、クラスタ用、エンタープライズ用が用意されており、それぞれ異なる

設定が可能になっております。Profileの詳細については下記を参照してください。


Profileの詳細(One Pager: Usage Profile Support for Application Server)


今回、私は構成の為、クラスタ用のプロファイルを使用する事にしました。


   ※開発者用で構成するにはsetup.xmlを指定してください。


GlassFishの構成を行うと下記のトレースが出力されます。ここでGlassFishの管理サーバに

接続する為のポート番号の他、管理サーバインスタンスで使用されるポート番号等が

出力されますので、確認しておいてください。




yosshi > chmod -R 755 ./lib/ant/bin

yosshi > ./lib/ant/bin/ant -f setup-cluster.xml

Buildfile: setup-cluster.xml

all:

[mkdir] Created dir: /Users/yt133043/Desktop/glassfish/bin

get.java.home:

********************************************中略

create.domain:

[exec] Using port 4848 for Admin.

[exec] Using port 8080 for HTTP Instance.

[exec] Using port 7676 for JMS.

[exec] Using port 3700 for IIOP.

[exec] Using port 8181 for HTTP_SSL.

[exec] Using default port 3820 for IIOP_SSL.

[exec] Using default port 3920 for IIOP_MUTUALAUTH.

[exec] Using default port 8686 for JMX_ADMIN.

[exec] Domain being created with profile:cluster, as specified by variable AS_ADMIN_PROFILE in configuration file.

[exec] Security Store used should be: JKS

[exec] Domain domain1 created.

[exec] Admin login information for host [localhost] and port [4848] is being overwritten with credentials provided. This is because the –savelogin option was used during create-domain command.

[exec] Login information relevant to admin user name [admin] for this domain [domain1] stored at [/Users/yt133043/.asadminpass] successfully.

[exec] Make sure that this file remains protected. Information stored in this file will be used by asadmin commands to manage this domain.

[delete] Deleting: /Users/yt133043/Desktop/glassfish/passfile



BUILD SUCCESSFUL

Total time: 31 seconds

yosshi > rehash




4. GlassFish管理ドメインの起動


構成が正常に終了すると次にGlassFishの管理ドメインを起動します。

GlassFishを管理する為には2通りの管理方法が存在します。

一つはコマンドラインから行うasadminコマンドと、そして

もう一つは、管理画面から操作を行う方法です。


※ 一部の操作(管理ドメインの起動等)はコマンドラインからしか実行できない物もあります。

  asadminコマンドで実行できる操作の詳細についてはコマンド引数に–help

  をつけて実行してください。引数で指定可能な一覧が表示されます。



asadinコマンドから管理ドメインを起動した後、ブラウザより [ http://HOST:4848 ] にアクセス

してみてください。管理画面へのログイン画面が出力されます。デフォルトの管理ユーザ名、パスワードは

それぞれ、 [ admin ] , [ adminadmin ] です。




yosshi > asadmin start-domain –user=admin domain1

Starting Domain domain1, please wait.

Log redirected to /Users/yt133043/Desktop/glassfish/domains/domain1/logs/server.log.

Redirecting output to /Users/yt133043/Desktop/glassfish/domains/domain1/logs/server.log

Domain domain1 started.

Domain [domain1] is running [Sun Java System Application Server 9.1 (build b50-beta3)] with its configuration and logs at:
[/Users/yt133043/Desktop/glassfish/domains].

Admin Console is available at [http://localhost:4848].

Use the same port [4848] for “asadmin” commands.

User web applications are available at these URLs:

[http://localhost:8080 https://localhost:8181 ].

Following web-contexts are available:

[/web1 /__wstx-services ].

Standard JMX Clients (like JConsole) can connect to JMXServiceURL:

[service:jmx:rmi:///jndi/rmi://yosshi1.japan.sun.com:8686/jmxrmi] for domain management purposes.

Domain listens on at least following ports for connections:

[8080 8181 4848 3700 3820 3920 8686 ].

Domain supports application server clusters and other standalone instances.





5. JRubyのインストール


GlassFishのインストールが完了すると、次にJRubyのインストールを行います。

JRubyはGlassFishのインストールしたディレクトリに存在する/lib配下に行います。





yosshi > cp jruby-bin-1.0.tar ./glassfish/lib/

yosshi > cd ./glassfish/lib/

yosshi > tar xvf jruby-bin-1.0.tar

jruby-1.0/bin/

jruby-1.0/bin/_jrubycleanup.bat

jruby-1.0/bin/_jrubysetcp.bat

jruby-1.0/bin/_jrubyvars.bat

jruby-1.0/bin/_jrubyvmopts.bat

*****************************************中略

jruby-1.0/samples/scripting.rb

jruby-1.0/samples/swing.rb

jruby-1.0/samples/swing2.rbv
jruby-1.0/samples/xslt.rb

yosshi > rehash





6. Railsのインストール


JRubyのインストールが完了すると、Railsもインストールしておきます。

Railsのダウンロード・インストールは約10〜15分程かかりますので、

その間はしばらく別の作業でもしておいてください。







yosshi > jruby -S gem install rails –include-dependencies

Need to update 43 gems from http://gems.rubyforge.org

…………………………………….

complete

Successfully installed rails-1.2.3

Successfully installed activesupport-1.4.2

Successfully installed activerecord-1.15.3

Successfully installed actionpack-1.13.3

Successfully installed actionmailer-1.3.3

******************************************中略

Installing RDoc documentation for actionmailer-1.3.3…

Installing RDoc documentation for actionwebservice-1.2.3…





6.1 Activerecord-JDBCのインストール(必要な場合)


これは、必要に応じてインストールしてください。goldspikeでwarを作成する場合、

本ライブラリが必要なようです。




yosshi > jruby -S gem install activerecord-jdbc

Successfully installed ActiveRecord-JDBC-0.4

Installing ri documentation for ActiveRecord-JDBC-0.4…

Installing RDoc documentation for ActiveRecord-JDBC-0.4…

yosshi > jruby -v

ruby 1.8.5 (2007-06-07 rev 3841) [i386-jruby1.0]

yosshi > jruby -S rails -v

Rails 1.2.3





7. Rails アプリケーションの作成


JRubyとRailsのインストールが完了しましたので、実際にサンプルの

アプリケーションを作成しましょう。JRuby on Railsのアプリケーションは、

GlassFishのドキュメントルート配下に直接作成します。





yosshi > cd /Users/yt133043/Desktop/glassfish/domains/domain1/

yosshi > pwd

/Users/yt133043/Desktop/glassfish/domains/domain1/

yosshi > ls

addons bin generated jbi master-password

applications config imq lib session-store

autodeploy docroot java-web-start logs


yosshi > cd docroot/

cd docroot/

yosshi > jruby -S rails sample-app

create

create app/controllers

create app/helpers

create app/models

create app/views/layouts

create config/environments

create components

**************************************************中略

create public/javascripts/effects.js

create public/javascripts/dragdrop.js

create public/javascripts/controls.js

create public/javascripts/application.js

create doc/README_FOR_APP

create log/server.log

create log/production.log

create log/development.log

create log/test.log





8. Railsプログラムの作成


HelloWorldの簡単なプログラムを作成してみます。




yosshi > cd /Users/yt133043/Desktop/glassfish/domains/domain1/docroot/sample-app

yosshi > pwd

/Users/yt133043/Desktop/glassfish/domains/domain1/docroot/sample-app

yosshi > jruby script/generate controller hello

exists app/controllers/

exists app/helpers/

create app/views/hello

exists test/functional/

create app/controllers/hello_controller.rb

create test/functional/hello_controller_test.rb

create app/helpers/hello_helper.rb

yosshi > cd app/controllers/

cd app/controllers/

yosshi > vi hello_controller.rb



class HelloController  “<H2>Hello World</H2>”
end
end





9. Railsのroute.rbの修正


プログラムの作成が終わると、Routingを設定します。

ここでは、REQUEST_URI(sample-app/)を解釈し、controllerとactionを指定します。





yosshi > cd ../../config/

yosshi > vi routes.rb

下記を追加


map.connect ‘sample-app/:id’, :controller => ‘hello’, :action => ‘index’




10. GlassFishのドメイン中のdefault-web.xmlファイルの修正


JRuby on Railsのプログラムを作成した後、GlassFish上から作成したアプリケーションを

呼び出すための設定を行います。default-web.xmlという設定ファイルに、下記のコードを

記載してください。



yosshi > cd /Users/yt133043/Desktop/glassfish/domains/domain1/config

yosshi > vi default-web.xml


<servlet>

<servlet-name>cgi</servlet-name>

<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>

<init-param>

<param-name>cgiPathPrefix</param-name>

<param-value>sample-app/public/dispatch.cgi</param-value>

</init-param>

<init-param>

<param-name>executable</param-name>

<param-value>/Users/yt133043/Desktop/glassfish/lib/jruby-1.0/bin/jruby</param-value>

</init-param>

<init-param>

<param-name>passShellEnvironment</param-name>

<param-value>true</param-value>

</init-param>

</servlet>



<servlet-mapping>

<servlet-name>cgi</servlet-name>

<url-pattern>/sample-app/*</url-pattern>

</servlet-mapping>






11. ドメインの再起動(起動/停止)


ここで、設定を修正したので、ドメインの再起動を行います。




yosshi > asadmin stop-domain domain1
Domain domain1 stopped.
yosshi > asadmin start-domain domain1
Starting Domain domain1, please wait.
Log redirected to /Users/yt133043/Desktop/glassfish/domains/domain1/logs/server.log.
2007/06/20 4:12:23 com.sun.portal.portletcontainer.sdkinstaller.PortletContainerConfigurator main
…… ( 中略 )
Domain listens on at least following ports for connections:
[8080 8181 4848 3700 3820 3920 8686 ].
Domain supports application server clusters and other standalone instances.





12. ドメイン上でサンプルアプリの動作確認


それでは、実際に、ブラウザ経由でサーバインスタンスに接続してみてください。



http://HOST:8080/sample-app


如何でしょう。HelloWorldは正常に表示されましたか?

正常に表示されたら、直接 controllerを修正して再度ブラウザより

アクセスしてみてください。

動的に修正が反影されている事が確認できましたか?





13. GlassFishのノードエージェントの作成


今、管理サーバインスタンスと同一上にアプリケーションを作成しています。

そこで、セキュリティ的にも問題ですので、新たにサービスを提供する為の

インスタンスを作成しましょう。インスタンスを作成する前にまず、

インスタンスを稼働させる為のノードエージェントを作成します。





yosshi > asadmin create-node-agent –user=admin yosshi1

Command create-node-agent executed successfully.





14. ノードエージェント上にインスタンスの作成


ノードエージェントを作成した後、ノードエージェント上にインスタンスを

作成します。作成したインスタンスに接続する為のポート番号はHTTP_LISTENER_PORT

に記載されている(ここでは、38083)番号になります。




yosshi > asadmin create-instance –nodeagent yosshi1 instance1

Using 38,083 for HTTP_LISTENER_PORT.

Using 38,184 for HTTP_SSL_LISTENER_PORT.

Using 33,823 for IIOP_SSL_LISTENER_PORT.

Using 37,678 for JMS_PROVIDER_PORT.

Using 33,703 for IIOP_LISTENER_PORT.

Using 38,689 for JMX_SYSTEM_CONNECTOR_PORT.

Using 33,923 for IIOP_SSL_MUTUALAUTH_PORT.

Command create-instance executed successfully.





15. ノードエージェント+インスタンスの起動


ノードエージェントとインスタンスを作成した後、それぞれを起動します。

ここで、インスタンスはノードエージェントを起動した際に自動的に起動されます。

また、起動時に問い合わせされるadminとmasterのデフォルトのパスワードは、

それぞれ、 [ adminadmin ] , [ changeit ] になります。





yosshi > asadmin start-node-agent –user=admin yosshi1

Please enter the admin password> [ adminadmin ]



Please enter the master password [Enter to accept the default]:> [ changeit ]



Redirecting output to /Users/yt133043/Desktop/glassfish/nodeagents/yosshi1/agent/logs/server.log

Redirecting application output to /Users/yt133043/Desktop/glassfish/nodeagents/yosshi1/agent/logs/server.log

Redirecting output to /Users/yt133043/Desktop/glassfish/nodeagents/yosshi1/instance1/logs/server.log

Command start-node-agent executed successfully.





16. インスタンス上でのサンプルアプリの動作確認


それでは、最後に作成したインスタンスに接続してみましょう。


http://HOST:HTTP_LISTENER_PORT/sample-app


如何でしょう。HelloWorldは正常に表示されましたか?


※ プログラムの修正はかならず、domain/docroot配下に存在するコードを修正してください。

 ノードエージェント上に存在するdocrootを修正しても、インスタンスを再起動した後

 domain/docroot配下に存在する内容で上書きされてしまいます。

 GlassFishではCentral Repositoryという機能が存在し、

 ドメインで全てのコンテンツを管理しています。

 そして、各インスタンスでは、そのRepositoryのキャッシュが存在するという

 アーキテクチャになっていますので、キャッシュ上のコンテンツを編集しても

 オリジナルのコンテンツが変更されていない場合、キャッシュに施した修正が

 上書きされてしまいます。

 そこで、修正は全てドメインに存在するコンテンツに対して行い、

 各インスタンスに対する変更のアップデートは、インスタンスの再起動を実施し

 行ってください。



asadmin stop-instance

asadmin start-instance





最後に


以上で、GlassFish上でCGI経由でJRubyを動かす方法について説明しましたが、

最初にも述べましたが、CGI経由の呼び出しは毎回JVMが起動されるため、

非常にコストが高くなっています。ただそれでも動的に変更が確認できるという点は

非常に有用です。ケースバイケースで本設定を御試しください。

Have a good JRuby environment !!



ビデオ





2007年6月19日 at 9:44 午後

UNIX MagazineでApplication Server特集



さて、今日はGlassFishの紹介記事の紹介です。



JavaOneから帰ってきて、本来はサンフランシスコから

最新情報をタイムリーにお伝えする予定だったのですが、

あまり多くかけなかった理由を報告します。

実は、本日発売のUNIX Magazineで

アプリケーションサーバの特集を組むという事を、

現地で聞き、まだ構成等も含め何も決まっていない

状況だった為、掲載記事と重なると問題がでる可能性もあり

多くを書く事ができませんでした。すいません。



その分今回、日本サンのJavaエバンジェリストや

アプリケーションサーバ担当エンジニアでSJS Application Serverや

GlassFishに関して記載しておりますので、是非ご覧になってみてください。





UNIX magazine 2007年7月号

アプリケーションサーバのすべて

日本最速のスーパーコンピューター「TSUBAME」の技術





Sun Java System Application Server

サン・マイクロシステムズ

片貝正紀、荻布真也、吉田正人、岡崎隆之、寺田佳央


2007年6月17日 at 7:16 午後

ホットトピックセミナーの開催



私事で恐縮ですが、2007年06月20日(水)に弊社用賀オフィスで

GlassFishに関するセミナーを開催することになりました。

まだ、若干席が空いてますので、御興味のある方は是非、

ご登録の上御参加いただければと思います




http://jp.sun.com/company/events/2007/000027.html




【開催概要】

■ タイトル 『2 時間で学ぶ今月の Java ホットトピック (6月号)』

■ 日程 2007年06月20日 (水)

■ 会場 世田谷ビジネススクエア 27F

■ 定員 60名

■ 費用 無料(事前登録制)

■ 主催 サン・マイクロシステムズ株式会社





【プログラム】



18:00 開場、18:30 セミナー開始、20:30 終了予定



1.「今が旬の GlassFish をおいしくいただくために」



Java エバンジェリスト 寺田 佳央



完成間近の GlassFish v2 のインストールからアプリケーション実行までを、実

演を交えて丁寧に解説します。また、少しずつ見え始めてきた、次期 v3 の新機

能についてもこっそり紹介します。



2.「リアルタイム Java はここが違う!」



Java エバンジェリスト 草薙 昭彦



時間についての制約が厳しいリアルタイムシステムにおいては、GC による遅延

やタスクのスケジューリングなど、さまざまな課題があります。リアルタイム

Java が、これらの課題をどのようにして解決するかを、その実装である Sun

Java Real-Time System 2.0 を使って解説します。




2007年6月14日 at 9:39 午後


Java Champion & Evangelist

Translate

ご注意

このエントリは個人の見解であり、所属する会社の公式見解ではありません

カレンダー

2007年6月
 123
45678910
11121314151617
18192021222324
252627282930  

カテゴリー

clustermap

ブログ統計情報

  • 1,288,448 hits

Feeds

アーカイブ