LoginSignup
6
5

More than 5 years have passed since last update.

Spring Cloud Data Flow 1.0.0.M2 を試す

Last updated at Posted at 2015-12-30

2015年9月に Spring XD のリファクタリングがアナウンスされて生まれた Spring Cloud Data Flow ですが、このたび 1.0.0.M2、および Flo for Spring Cloud Data Flow (BETA) がリリースされたため試してみました。

環境

  • Ubuntu 14.04
  • Java 1.8.0_66
  • Spring Cloud Data Flow 1.0.0.M2
  • Flo for Spring Cloud Data Flow (BETA) 1.0 M1
terminal
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

$ java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

$ java -jar spring-cloud-dataflow-admin-local-1.0.0.M2.jar

...

2015-12-30 19:26:53.030  INFO 25800 --- [           main] o.s.c.dataflow.admin.AdminApplication    : Started AdminApplication in 1.638 seconds (JVM running for 2.532)
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| '_ \| '__| | '_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \ \
 | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \ \
 | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

 1.0.0.M2

Spring Cloud Data Flow

リファレンスはこちら。
http://docs.spring.io/spring-cloud-dataflow/docs/1.0.0.M2/reference/html/

Redis をインストールして、モジュールを取得して、起動するのみです。

Redis のインストール

apt-get で簡単に入れてしまう。

terminal
$ sudo apt-get install redis-server

モジュールの取得

Milestone Release を果たしたことで、SNAPSHOT のときとは異なり、ビルド済みのモジュールを直接ダウンロードできるようになりました。(SNAPSHOT 時は、自分でソースをビルドする必要があった。)

早速ダウンロードします。

terminal
wget http://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-dataflow-admin-local/1.0.0.M2/spring-cloud-dataflow-admin-local-1.0.0.M2.jar
wget http://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-dataflow-shell/1.0.0.M2/spring-cloud-dataflow-shell-1.0.0.M2.jar

起動

取得したモジュールを java -jar コマンドから起動します。

terminal
$ java -jar spring-cloud-dataflow-admin-local-1.0.0.M2.jar
2015-12-30 19:26:52.117  INFO 25800 --- [           main] o.s.c.dataflow.admin.AdminApplication    : Starting AdminApplication v1.0.0.M2 on 133-130-119-232 with PID 25800 (started by root in /opt/lib/spring-cloud-dataflow.M2/spring-cloud-dataflow-admin-local-1.0.0.M2.flo)
2015-12-30 19:26:52.126  INFO 25800 --- [           main] o.s.c.dataflow.admin.AdminApplication    : No active profile set, falling back to default profiles: default
2015-12-30 19:26:52.251  INFO 25800 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@29a988d1: startup date [Wed Dec 30 19:26:52 JST 2015]; root of context hierarchy
2015-12-30 19:26:52.576  INFO 25800 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-12-30 19:26:52.604  INFO 25800 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$b2d79124] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-12-30 19:26:53.030  INFO 25800 --- [           main] o.s.c.dataflow.admin.AdminApplication    : Started AdminApplication in 1.638 seconds (JVM running for 2.532)
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| '_ \| '__| | '_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \ \
 | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \ \
 | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

 1.0.0.M2

...

http://localhost:9393/admin-ui/ にアクセスすることで、UI を利用することができます。
見た目は以前の Spring XD と、何ら変わりません。
ロゴもそのままです。
スクリーンショット 2015-12-30 19.03.49.png

コマンドラインシェルの起動

先ほどダウンロードしてきた spring-cloud-dataflow-shell-1.0.0.M2.jar を起動して、Data Flow サーバーにアタッチします。
使い方は Spring XD のときと同じ。

terminal
$ java -jar spring-cloud-dataflow-shell-1.0.0.M2.jar
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| '_ \| '__| | '_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \ \
 | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \ \
 | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

1.0.0.M2

Welcome to the Spring Cloud Data Flow shell. For assistance hit TAB or type "help".
dataflow:>

以上で、Spring XD と同等の機能を利用できるようになりました。
続いて、Flo を適用してみます。

Flo for Spring Cloud Data Flow

リファレンスはこちら。
http://docs.pivotal.io/spring-cloud-data-flow/installing-scdf.html

Flo モジュールを取得して、Data Flow モジュールに jar コマンドを使用して、更新差分を取り込み、起動します。

Flo モジュールの取得

ダウンロードはこちらから。
https://network.pivotal.io/products/p-flo-for-spring-cloud-data-flow

ダウンロードには Pivotal アカウントでのサインインが必要なので、まだ取得していない場合は、以下の記事などを参考に取得してみてください。
Flo for Spring XD でグラフィカルに XD をあつかう話

Data Flow モジュールのバックアップ

Flo を適用するには、Data Flow モジュール自体に変更を加える必要があるため、リファレンスに従ってバックアップを取得します。

terminal
$ cp spring-cloud-dataflow-admin-local-1.0.0.M2.jar spring-cloud-dataflow-admin-local-1.0.0.M2.jar.backup

Data Flow モジュールの更新

先の手順で取得した Flo アーカイブを展開し、出てきた lib ディレクトリごと jar コマンドを使用して、Data Flow モジュールに取り込みます。
リファレンスのとおりですが、以下のように。

terminal
$ unzip flo-spring-cloud-dataflow-admin-1.0.0.M1.zip

$ ls
lib

$ jar -u0vf spring-cloud-dataflow-admin-local-1.0.0.M2.jar lib
adding: lib/(in = 0) (out= 0)(stored 0%)
adding: lib/spring-cloud-dataflow-ui-1.0.0.M1.jar(in = 4518492) (out= 4518492)(stored 0%)

起動

更新したモジュールを java -jar コマンドから起動します。

terminal
$ java -jar spring-cloud-dataflow-admin-local-1.0.0.M2.jar
2015-12-31 01:46:43.276  INFO 27450 --- [           main] o.s.c.dataflow.admin.AdminApplication    : Starting AdminApplication v1.0.0.M2 on 133-130-119-232 with PID 27450 (started by root in /opt/lib/spring-cloud-dataflow.M2/spring-cloud-dataflow-admin-local-1.0.0.M2.flo)
2015-12-31 01:46:43.292  INFO 27450 --- [           main] o.s.c.dataflow.admin.AdminApplication    : No active profile set, falling back to default profiles: default
2015-12-31 01:46:43.448  INFO 27450 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2abcd30c: startup date [Thu Dec 31 01:46:43 JST 2015]; root of context hierarchy
2015-12-31 01:46:43.800  INFO 27450 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-12-31 01:46:43.831  INFO 27450 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$3df2bf30] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2015-12-31 01:46:44.242  INFO 27450 --- [           main] o.s.c.dataflow.admin.AdminApplication    : Started AdminApplication in 1.73 seconds (JVM running for 2.861)
  ____                              ____ _                __
 / ___| _ __  _ __(_)_ __   __ _   / ___| | ___  _   _  __| |
 \___ \| '_ \| '__| | '_ \ / _` | | |   | |/ _ \| | | |/ _` |
  ___) | |_) | |  | | | | | (_| | | |___| | (_) | |_| | (_| |
 |____/| .__/|_|  |_|_| |_|\__, |  \____|_|\___/ \__,_|\__,_|
  ____ |_|    _          __|___/                 __________
 |  _ \  __ _| |_ __ _  |  ___| | _____      __  \ \ \ \ \ \
 | | | |/ _` | __/ _` | | |_  | |/ _ \ \ /\ / /   \ \ \ \ \ \
 | |_| | (_| | || (_| | |  _| | | (_) \ V  V /    / / / / / /
 |____/ \__,_|\__\__,_| |_|   |_|\___/ \_/\_/    /_/_/_/_/_/

 1.0.0.M2

...

コンソール出力こそ変化はないように見えますが、これで Flo 適用済みの Data Flow が起動しました。
Flo 適用前と同じ URL、http://localhost:9393/admin-ui/ へアクセスすることで利用できます。
なお、Flo 適用前の Admin UI へ過去にアクセスしたことがある場合は、XD での利用時と同様に、一度ブラウザキャッシュの削除を行ってください。
ブラウザキャッシュが残ったままだと Flo の適用された Admin UI が表示されません。

Flo の適用を確認できると、以下のように、Flo for Spring XD と同様の操作感で使用できることがわかります。
スクリーンショット 2015-12-30 19.29.15.png

まとめ

Spring XD をリファクタリングしたプロダクトとしてアナウンスされただけあって、XD で提供されていた機能、UI は相変わらず利用できるようです。

ただし、Stream の Source、Sink などにはサポートの変化があるようで、以前のものとすこし内容が異なるようなので、実際に利用する場合には、差分や、マイグレーション方法の確認などが必要になるかもしれません。
これについては、まだ Milestone version ということもあり、このあたりのサポートバリエーションは、今後増える可能性も期待できます。

また、アーキテクチャが Spring Boot ベースに変更されたこともあり、パラメタの引き渡しなどが非常に柔軟になったのも特徴の一つと言えるでしょう。
起動方法や、Flo の適用も XD の時期よりずっと簡易的になっていたのも、とても好印象でした。

先にも触れたように、まだ Milestone version ということもあり、まだまだ完全とはいえませんが、GA Release に向けて、どのような変更が入るか、引き続き楽しみなプロダクトといえそうです。
2016年、注目の Spring Project の一つとなりそうな予感。

参考

http://docs.spring.io/spring-cloud-dataflow/docs/1.0.0.M2/reference/htmlsingle/#_deploying_local
http://docs.pivotal.io/spring-cloud-data-flow/installing-scdf.html

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5