配置 Liberty 以使用 IBM Cloud dashDB 服務

使用 IBM® Bluemix® 公用程式指令行整合工具,將您的 Liberty 伺服器配置成使用 IBM Cloud dashDB® 服務。

開始之前

在配置 Liberty 伺服器來使用 IBM Cloud 服務之前,您必須先建立一個帳戶。 請參閱註冊取得 IBM Cloud,以建立您的 IBM Cloud 帳戶。

關於這項作業

Liberty 伺服器配置成使用 dashDB 服務。

程序

  1. 利用 bluemixUtility login 指令來登入。起始登入之後,您不需要再次完成這個步驟。
  2. 執行 bluemixUtility marketplace 指令來列出可以與指令行公用程式一起使用的所有 IBM Cloud 服務的詳細資料。請參閱下列範例:
    Service: dashDB
    Description: A flexible and powerful data warehouse for online analytics processing, or a highly reliable relational database for enterprise-level online transaction processing.
    Documentation: https://www.ng.bluemix.net/docs/#services/dashDB/index.html#dashDB
    Plans: Entry, Enterprise256.4, Enterprise256.12, EnterpriseMPP.4, EnterpriseTransactional12.128.1400, EnterpriseTransactional2.8.500, Enterprise
  3. dashDB 服務可針對資料倉儲和交易式處理程序,提供各種不同的服務計畫。請利用 IBM Cloud 儀表板,來建立或要求實例。
  4. 具有 dashDB 服務實例之後,請驗證它具有服務金鑰。服務金鑰含有該服務的認證資訊。例如:
    $ bluemixUtility showService myDashDB
    
    Name: myDashDB
    Type: dashDB
    Plan: EnterpriseTransactional2.8.500
    Description: A flexible and powerful data warehouse for online analytics processing, or a highly reliable relational database for enterprise-level online transaction processing.
    Documentation: https://www.ng.bluemix.net/docs/#services/dashDB/index.html#dashDB
    Service keys:
      credential-1
    如果您在清單中看不到服務金鑰,請使用 IBM Cloud 儀表板,或 bluemixUtility createService 指令,並指定 serviceTypeservicePlanserviceName 選項,來建立一個。如果您使用 createService 指令,所傳遞的服務類型、計劃名稱和服務名稱,務必要符合 showService 指令輸出中的值。例如:
    $ bluemixUtility createService dashDB EnterpriseTransactional2.8.500 myDashDB
  5. 執行 bluemixUtility import myDashDB 指令,來匯入配置。 接受存取服務所需之必要程式庫的授權條款。
  6. 選擇性的: 執行 bluemixUtility listImports 指令來檢視您匯入的服務配置。
    已匯入下列 IBM Bluemix 服務配置:
    myDashDB
  7. 執行 bluemixUtility bind [options] serverName serviceName,將配置連結至 Liberty 伺服器。 如果出現提示,請接受授權條款。 請參閱所列服務的下列範例和說明:
    $ bluemixUtility bind defaultServer myDashDB
    
    Checking if features required for the myDashDB service are installed.
    All required features are installed.
    The myDashDB is now bound to defaultServer server.
    dashDB 資料庫的預設 JNDI 名稱是 jdbc/serviceName。如果您的應用程式利用不同的 JNDI 名稱來存取資料庫實例,請利用 --vjndiName 選項來指定 JNDI 名稱。 請參閱下列範例:
    $ bluemixUtility bind defaultServer myDashDB --vjndiName=jdbc/myDataSource

結果

現在 dashDB 服務可以與您的 Liberty 伺服器搭配使用。

指示主題類型的圖示 作業主題

檔名:twlp_config_blmx_dashdb.html