9. #3 Use Shell Pipelines With Multimode
• シェルスクリプトによる複数処理の走らせ方
• $ for i in {1..10};
do
echo "create-local-instance server${i}";
done ¦ asadmin
#glassfishjp
35. #22 How To Enable Server Monitoring
• 監視には結構いいのを揃えている。(CLI,
REST, JMX access, Web Console)。
• 監視レベルは、LOW/HIGH/OFFの三つ。
• デフォルトではオフになっているが、再起
動することなくオンにできる。
#glassfishjp
36. #22 How To Enable Server Monitoring
• 例:すべての監視データを取得
• $ asadmin get -m "*"
$ asadmin get --monitor "*"
報告する監視データがありません。
• 例:Web Container on the DAS を監視
• $ asadmin enable-monitoring --modules
web-container=HIGH
#glassfishjp
37. #22 How To Enable Server Monitoring
• 例:EHB Cointainer on cluster(c1)を監視
• $ asadmin enable-monitoring --target
c1 --modules ejb-countainer=LOW
#glassfishjp
38. #22 How To Enable Server Monitoring
• モジュール名とそれぞれの監視レベルは以下
のコマンドで確認できる
• $ asadmin get server.monitoring-
service.*
server.monitoring-service.dtrace-enabled=false
server.monitoring-service.mbean-enabled=true
server.monitoring-service.monitoring-enabled=true
:
• 正直、モジュール名を打つのが面倒なのでGUI(管理コンソール)から
やった方が早い。
#glassfishjp
39. #22 How To Enable Server Monitoring
#glassfishjp
40. #23 How To View Monitoring Data (CLI)
• コマンドラインで監視データを取得する方法
• 監視データは以下によって変更される階層木
構造である。
• どのモジュールがロードされているか
• どのモジュールが監視中(monitoring-
enabled)になっているか
• デプロイされているアプリケーション
#glassfishjp
41. #23 How To View Monitoring Data (CLI)
• 監視データの例
• server.applications
¦--- application1
¦ ¦--- ejb-module-1
¦ ¦ ¦--- ejb1 *
¦ ¦ ¦--- bean-cache (for entity/sfsb)
#glassfishjp
42. #23 How To View Monitoring Data (CLI)
• 例:JVMのベンダー確認
• $ asadmin get -m
"server.jvm.runtime.vmvendor-current-
current"
• server.jvm.runtime.vmvendor-current-
current = Oracle Corporation
#glassfishjp
43. #23 How To View Monitoring Data (CLI)
• 例:ヒープ使用量
• $ asadmin get -m
"server.jvm.memory.usedheapsize*"
server.jvm.memory.dotted-name = server.jvm.memory
server.jvm.memory.usedheapsize-count-count = 95042176
server.jvm.memory.usedheapsize-count-description =
Amount of used memory in bytes
server.jvm.memory.usedheapsize-count-lastsampletime =
1355317444825
server.jvm.memory.usedheapsize-count-name =
UsedHeapSize
server.jvm.memory.usedheapsize-count-starttime =
1355317091175
#glassfishjp
44. #23 How To View Monitoring Data (CLI)
• 例:デプロイしているアプリケーションのア
クティブセッション数
• $ asadmin get -m
"server.applications.mywebapp.server.ac
tivesessionscurrent-current"
server.applications.mywebapp.server.activesessionscurrent-
current = 5
#glassfishjp
52. #40 Detecting JDBC statement and
connections leaks and reclaim
• 設定後、サーバ再起動が必要。close漏れの可能性があ
る場合、デプロイ時に以下のようなメッセージが出る
• WARNING: A potential statement leak detected for connection
pool DerbyPool. The stack trace of the thread is provided
below :
com.sun.gjc.spi.base.StatementWrapper.
(StatementWrapper.java:81)
:
com.mypackage.MyTestBean.execute(TestBean.java:00)
#glassfishjp
54. #41 Using Update Center to Keep Current
• Update Centerを使ってネットワークリポジトリから
更新する
• <InstallDir>/bin/pkg
• $ pkg list -u で更新保留中のパッケージが解る
• $ pkg image-update でGlassFishをアップデー
トできる
• > You are running on a 64 bit Linux distribution
and the 32 bit Linux compatibility libraries do
not appear to be installed.
• oh...
#glassfishjp
55. #41 Using Update Center to Keep Current
• pkg のコアな使い方は以下を参照!
• http://www.coppermine.jp/docs/programming/
2012/12/glassfish-internals.html
• @btnrougeさんのサイト
• Web Profiler, Full Profiler以外の俺俺Profilerも作れる
#glassfishjp