jcconf 2015 taipei -- bluemix java liberty -auto-configration

52
© 2015 IBM Corporation Bluemix Java Liberty -- Auto-Config of Bound service -- DevOps -- Node-RED Joseph Chang Cloud Architect -Bluemix IBM Cloud Unit, Taiwan 內內內內內 cription in Traditional Chinese

Upload: joseph-chang

Post on 13-Apr-2017

437 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2015 IBM Corporation

Bluemix Java Liberty -- Auto-Config of Bound service-- DevOps-- Node-RED

Joseph Chang

Cloud Architect -Bluemix

IBM Cloud Unit, Taiwan

內容說明使用中文Description in Traditional Chinese

Page 2: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

佈建一個 J2EE Application Developer 所需的環境需要多少時間 ?

2

Acquire HW,SWx days

Configure Server1 hours

Configure Network2 hours

Install Database3 hours

Install J2EE Server5 hours

Install MQ Server4 hours

Configure server.xml6 hours

Test environmentsetting

7 hours

Ready for developer8 hours

而且這可能不是 最壞狀況… .實際花的時間可能更久

Page 3: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

如果可以透過雲端技術 直接開 Virtual Machine, 那我們就可以省去 2+ 小時的時間 .

3

Page 4: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

如果可以透過雲端上有裝好的 Database, WebServer, MQ Server, 那我們就可以省去 5 + 小時的時間 .

4

Page 5: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

那雲端有可能幫我把在 J2EE Server 中 設定 Database, MQ… 及驗證環境的 2 小時 自動做掉嗎 ?

5

Page 6: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

有的 , IBM 數位創新平台 Bluemix 中的 Java Liberty 搭配 MQ Lite , SQL DB 服務 ,可以 自動配置 server.xml 讓 Configuration 一次到位 , 省下更多的時間專心處理業務邏輯的問題

6

Page 7: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

So …. IBM 創新平台 Bluemix 是什麼 ?

7

Page 8: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

Innovation is the new currency

“Two guys in a Starbucks can have access to the same computing power as a Fortune 500 company.”

Jim DetersFounder, Galvanize

Page 9: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

What is Bluemix? How it works?

Cloud Fabric (IaaS)

Instant Runtimes Containers Virtual Machines

Platform Deployment Options that Meet Your Workload Requirements (DC)

Bluemix Public

Bluemix Dedicated

Bluemix Local

DevOpsTooling Your Own Hosted Apps / Services (SaaS)

Integration and API Mgmt

Powered by IBM SoftLayer

+ + +

+ +• Dallas (US)• London(UK)• Sydney(AU)• Beijing(CN) *

Amsterdam, Chennai,Dallas, Frankfurt, Hong Kong, Houston, London, Melbourne, Milan, Montreal, Paris, Querétaro, San Jose, Sao Paulo, Seattle, Singapore, Sydney, Tokyo, Toronto, Washington

*Bluemix Beijing is coming soon

Your Own Data Center

VPNCDNDNS

Catalog of Services that Extend Apps’ Functionality (PaaS)

Web Data Mobile AnalyticsCognitive IoT Security Yours+

Everywhere

Page 10: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

Create apps quickly with prebuilt services

10

Security Services

Web and application services

CloudIntegration Services

Mobile Services

Database services

Big Data services

Internet of Things Services

Watson Services

DevOps Services

A full range of capabilities to suit any great idea.

ComputeChoose the level of infrastructure abstraction based on your app’s architectural needs.

ServicesPick from a catalog of IBM, third party, open source, or your own services to extend your apps.

IBM

Third Party

Open Source

Yours

Page 11: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

What is Java Liberty?

The Liberty profile is a highly composable, fast-to-start, dynamic application server runtime environment. It is part of IBM WebSphere Application Server v8.5.5. The buildpack provides a complete runtime environment for running Java EE 7 and OSGi applications on top of Liberty profile. It supports popular frameworks like Spring and includes the IBM JRE. WebSphere Liberty enables rapid application development that is well suited to the cloud.

11

Page 12: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Liberty features supported in Bluemix

12

和傳統 Websperhe(Full Profile) 不同 , Websphere Liberty 只載入 指定的 jar, 而不是整套J2EE

Page 13: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Liberty features supported in Bluemix

13

Page 14: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Liberty features supported in Bluemix

14

Page 15: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

How it works?

Sign-on/login Bluemix in the http://www.bluemix.net

15

Page 16: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

點選 Java DB Web Starter 即可快速配置 Java +SQL DB 環境

16

Page 17: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

設定網站名稱

17

取好 host name , 按 Create

Page 18: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

就是這麼簡單 2 分鐘後 , 你就有一個帶有 internet 網址的 Liberty Server

18

你可以用以下三種工具寫 code:•Eclipse•Command Line•Web IDE (also know as Bluemix DeOps, Eclipse Orion)

並且可以讓Bluemix 幫你配置一組 Git Project

Page 19: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

配置好的 Liberty Server 如下 , 預設使用 1 instance ,512M 的 RAM,開發人員可以自己 Scale up, Scale out, 不用再求 OP 協助

19

Page 20: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

檢視目前的 server.xml

20

Server.xml 中的 DB2 設定自動配了

Page 21: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Which services in Bluemix can be auto-configured to Java Liberty?

ClearDB MySQL Database MySQL ElephantSQL PostgreSQL Cloudant® NoSQL Database MongoLab dashDB™ Data Cache Session Cache MQ Light Monitoring and Analytics Auto-Scaling Single Sign On New Relic

21

Auto Configure to:

Auto-Configuration 其實就是 Application Re-staging 時 , Java Liberty 針對其所認識的服務自動做Binding

Page 22: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

不只設定配好了 , 還有 Java access DB 的範例

22

我不要範例 , 我要飯粒

點選 ADD GIT

Page 23: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Bluemix DevOps –IDE, Git, Auto-Build, Auto-Deploy with Sample Source Code

23

Page 24: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

試 Run 一下 Sample

24

填一筆資料

Page 25: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

查看 DB 內容

25

由此進入 DB 管理介面

Page 26: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

查看 DB 內容

26

Yes, 範例沒造假

Page 27: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

了解 Bluemix 上的 Java 風格 – 以 JAX-RS 為核心的寫法

27

Page 28: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

了解 Bluemix 上的 Java 風格 – 以 JAX-RS 為核心的寫法

28

Page 29: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

build.xml 在 Bluemix Build 時會用到

29

Page 30: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

manifest.xml 會影響 runtime 的 hostname, 及設定

30

Page 31: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

網頁程式呼叫 api/todolist 做呈現

31

Page 32: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

來做點小修改測試一下變更及佈署

32

把 Java DB Web Starter 改成…

Page 33: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

切到 Git 畫面準備交付

33

確認修改後按 push 觸發上版

Page 34: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Build & Deploy 成功

34

Page 35: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

查看 Compile Log

35

Page 36: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

查看 Deploy Log

36

Page 37: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

改版成功

37

更改前為 Java DB Web Starter

Page 38: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

We also support deploy to Docker !!

38

只要多寫個dockerfile

Page 39: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

想知道更多有關 Bluemix Docker 嗎 ? 請參考

39

http://www.slideshare.net/JosephChang8/create-docker-image-with-bluemix-dev-ops

Page 40: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

如果在 Bluemix 上只是寫 Java access DB 就太可惜了

40

Page 41: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Bluemix 上最酷的工具 -- Node-RED

41

Page 42: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

親自體驗 Node-RED 的強大功能

42

Page 43: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Bluemix 的其它應用

43

Page 44: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

Bluemix IOT - Basic

Node-RED

DashDB

Cloudant

1

2

3

4

5

6

SMS

http://developer.ibm.com/iot

7FreeBoard

MQTT

Bluetooth

Page 45: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

Bluemix IOT – Analytic with Hadoop

Node-RED

1

2

3

4

5

SMS

BighInsight(Hadoop)

MQTT

Page 46: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Liner Regression with Hadoop &Big R on Bluemix

46

Y : ArrDelayX1: MonthX2: DayofMonthX3: DayOfweekX4: CRSDepTImeX5: Distance

Y = -0.174423*X1 -0.01547941*X2-0.03378236*X3 +0.006222544*X4+0.0003556919*X5

The Arrival Delay prediction model is :

Page 47: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

K-mans with Hadoop &Big R on Bluemix

47

Page 48: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

Cloud Trader – Architecture Overview

Page 49: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Global Distributed Database

Dallas (now)

London (now)

Sydney (public)

Taiwan (Local)

(public)

(public)

Cloudant

Cloudant

Cloudant

Cloudant DashDB

使用 In-Memory DB 技術 , 內建R分析預測工具

Web Server

Web Server

Web Server

Page 50: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Global Deployment with Bluemix DevOps

Dallas (now)

London (now)

Sydney (public)

Taiwan (Local)

(public)

(public)

Globalization Pipelinie

Web Server

Web Server

Web Server

部署時 , 針對不同地區的 Java Resource File 自動翻譯產語言檔 , 並容許調校學習

Page 51: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

Bluemix 雲端智能機器人 – 鋼彈 1 號系統架構鋼彈思考流程:中文語音辨識 -Watson邏輯判斷 -Node-Red, IOT Foundation中 / 英文語音回應 -Google/Watson身體行動 – Node.JS+Python

身體行動 (Arduino) :雙手可緊握手臂可揮舞雙腳可走路

視覺 / 表情 (Camera) :影像串流 -Node.JS影像識別 – Watson Tag人臉辨識 – Watson Face氣象播報 - Watson Weather

眼睛表情 (LED Matrix) -Python數據存儲 – Cloudant數據分析 – DashDB / R Script

高感度麥克風外接喇叭藍芽模組

序列埠溝通Beacon 裝置室內定位

Page 52: Jcconf 2015 Taipei -- Bluemix java liberty -auto-configration

© 2014 IBM Corporation

想要自己動手試試看嗎 ?

52

https://www.ng.bluemix.net/docs/starters/liberty/index.html#automaticconfigurationofboundservices

請上 www.bluemix.net 註冊帳號更多關於 Bluemix Java 的解說 :