ページの先頭行へ戻る
Interstage Big DataComplex Event Processing Server V1.1.0 ユーザーズガイド
FUJITSU Software

5.11.8 実行方法

サンプルアプリケーションの実行方法について説明します。

以下の作業において、コマンド実行は一般ユーザー権限で行います。

作業は以下の順番で行います。

  1. 開発資産の配備

  2. CEPエンジンの起動

  3. イベントの送信と結果の確認

  4. CEPエンジンの停止

  5. 開発資産の配備解除

5.11.8.1 開発資産の配備

CEPエンジンが一つだけ配備された状態(例:BDCEPの初期セットアップ完了直後)で、開発資産を配備します。

/opt/FJSVcep/sample/sample1/bin/deployall.shを実行します。

途中、何度か問い合わせが行われますが、全て<ENTER>と入力します。

$ cd /opt/FJSVcep/sample/sample1/bin <ENTER>
$ ./deployall.sh <ENTER>
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the rule definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.

このシェルスクリプト内部では以下のコマンドを実行しています。

5.11.8.2 CEPエンジンの起動

以下のコマンドを実行し、CEPエンジンを起動します。

$ cepstarteng<ENTER>

5.11.8.3 イベントの送信と結果の確認

イベント送信サンプルプログラム(/opt/FJSVcep/sample/sample1/bin/sendevent.sh)を使用してサンプルデータを送信し、エンジンログでルールの動作を確認します。

  1. 位置情報イベントの送信と結果の確認

    $ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>

    エンジンログに filterOut1 のイベントが出力されていることを確認します。

    出力例

    2012-07-09 11:11:57,409 [DEBUG] filterOut1:length=1
    filterOut1[0]
    areaID :2222: String
    age :30: String
    memberID :MEM0008: String

    2012-07-09 11:11:57,413 [DEBUG] filterOut1:length=1
    filterOut1[0]
    areaID :2222: String
    age :20: String
    memberID :MEM0003: String
  2. クーポンイベントの送信と結果の確認

    $ ./sendevent.sh CouponEvent /opt/FJSVcep/sample/sample1/event/CouponEvent.csv<ENTER>

    エンジンログに filterOut2 のイベントが出力されていることを確認します。

    出力例

    2012-07-09 11:15:38,054 [DEBUG] filterOut2:length=1
    filterOut2[0]

    areaID :2222: String
    targetAge :30: String
    storeID :STR0001: String
    couponID :CPN0001: String
  3. 位置情報イベントの送信と結果の確認

    クーポンイベント送信後3分以内に位置情報イベントを送信します。

    $ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>

    エンジンログにクーポン発行を示すイベントが出力されていることを確認します。

    出力例

    2012-07-09 11:17:25,314 [DEBUG] filterOut1:length=1
    filterOut1[0]

    areaID :2222: String
    age :20: String
    memberID :MEM0003: String

    2012-07-09 11:17:25,321 [DEBUG] filterOut1:length=1
    filterOut1[0]
    areaID :2222: String
    age :30: String
    memberID :MEM0008: String

    2012-07-09 11:17:25,323 [DEBUG] EPL2:length=1
    EPL2[0]
    storeID :STR0001: String
    memberID :MEM0008: String
    couponID :CPN0001: String
  4. 位置情報イベントの送信と結果の確認

    クーポンイベント送信後3分以内にもう一度位置情報イベントを送信します。

    $ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>

    エンジンログにクーポン発行を示すイベントが二重に出力されていないことを確認します。

    出力例

    2012-07-09 11:18:00,691 [DEBUG] filterOut1:length=1
    filterOut1[0]
    areaID :2222: String
    age :20: String
    memberID :MEM0003: String

    2012-07-09 11:18:00,691 [DEBUG] filterOut1:length=1
    filterOut1[0]
    areaID :2222: String
    age :30: String
    memberID :MEM0008: String

5.11.8.4 CEPエンジンの停止

以下のコマンドを実行し、CEPエンジンを停止します。

$ cepstopeng<ENTER>

5.11.8.5 開発資産の配備解除

/opt/FJSVcep/sample/sample1/bin/undeployall.sh を実行して、一括で配備解除を行います。

途中、何度か問い合わせが行われますが、全て<ENTER>と入力します。

$ ./undeployall.sh<ENTER>
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:
<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the rule definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.