Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Examples

athiththan11 edited this page Oct 14, 2019 · 6 revisions

Datasource

datasource:is


Example 01 : Replace H2 Database with Postgres

When you need to configure WSO2 Identity Server v5.7.0 pack with Postgres by replacing the default shipped H2 Carbon database

  1. Download and extract a fresh pack of wso2is-5.7.0

  2. Open a terminal and navigate to the root of the extracted WSO2 IS pack

  3. Execute the following

    # inside wso2is-5.7.0
    hydrogen datasource:is --replace --datasource postgres --version 5.7

Example 02 : Replace H2 Database with Postgres (Container Support)

When you need to configure WSO2 Identity Server v5.7.0 pack with Postgres by replacing the default shipped H2 Carbon database and also to generate a Docker container for Postgre with databases

NOTE: The latest release of hydrogen can pull Postgre Docker image from DockerHub if none exists.

  1. Download and extract a fresh pack of wso2is-5.7.0

  2. Start the Docker service in your environment (if you don't have Docker installed, install Docker before executing the command to work without any errors)

  3. Open a terminal and navigate to the root of the extracted WSO2 IS pack

  4. Execute the following

    # inside wso2is-5.7.0
    hydrogen datasource:is --replace --datasource postgres --version 5.7 --container --generate

The above command will create a Postgres Docker container with a random name (an animal name) including the databases and tables.


datasource:am


Example 01: Replace H2 Database with Postgres

When you need to configure WSO2 API Manager v2.6.0 pack with Postgres by replacing the default shipped H2 Carbon database (WSO2 AM DB)

  1. Download and extract a fresh pack of wso2am-2.6.0

  2. Open a terminal and navigate to the root of the extracted WSO2 AM pack

  3. Execute the following

    #inside wso2am-2.6.0
    hydrogen datasource:am --replace --datasource postgres --version 2.6

Example 02: Replace H2 Database with Postgres (Container Support)

When you need to configure WSO2 API Manager v2.6.0 pack with Postgres by replacing the default shipped H2 Carbon database (WSO2 AM DB) and also to generate a Docker container for Postgre with databases

  1. Download and extract a fresh pack pf wso2am-2.6.0

  2. Start the Docker service in your environment (if you don't have Docker installed, install Docker before executing the command to work without any errors)

  3. Open a terminal and navigate to the root of the extracted WSO2 AM pack

  4. Execute the following

    #inside wso2am-2.6.0
    hydrogen datasource:am --replace --datasource postgres --version 2.6 --container --generate

The above command will create a Postgres Docker container with a random name (an animal name) including the databases and tables for apimgt, userdb, and regdb.


Example 03: Replace and Setup AM, UM, & REG Databases with Postgres

When you need to configure WSO2 API Manager v2.6.0 pack with Postgres by replacing the default shipped H2 Carbon database (WSO2 AM DB) and setting up am, um, and reg databases

  1. Download and extract a fresh pack of wso2am-2.6.0

  2. Open a terminal and navigate to the root of the extracted WSO2 AM pack

  3. Execute the following

    #inside wso2am-2.6.0
    hydrogen datasource:am --setup --datasource postgres --version 2.6

Example 04: Replace and Setup AM, UM, & REG Databases with Postgres (Container Support)

When you need to configure WSO2 API Manager v2.6.0 pack with Postgres by replacing the default shipped H2 Carbon database (WSO2 AM DB) and also to generate a Docker container for Postgre with databases

  1. Download and extract a fresh pack pf wso2am-2.6.0

  2. Start the Docker service in your environment (if you don't have Docker installed, install Docker before executing the command to work without any errors)

  3. Open a terminal and navigate to the root of the extracted WSO2 AM pack

  4. Execute the following

    #inside wso2am-2.6.0
    hydrogen datasource:am --setup --datasource postgres --version 2.6 --container --generate

The above command will create a Postgres Docker container with a random name (an animal name) including the databases and tables for apimgt, userdb, and regdb.


Distribute

distribute:am


Example 01 : 5 Node Distributed Setup with Postgres

When you need to configure a 5 node distributed setup with WSO2 API Manager v2.6.0 pack and Postgres datasource

  1. Download and extract a fresh pack of wso2am-2.6.0 inside a new directory (only the extracted WSO2 API Manager pack)

    - MyNewFolder
        |- wso2am-2.6.0
    
  2. Open a terminal and navigate to the parent folder of the extracted WSO2 APIM pack

  3. Execute the following

    # inside MyNewFolder
    hydrogen distribute:am --distributed --version 2.6 --datasource postgres

The above command will create a new folder named distributed and places all configured 5 nodes within it.


Example 02 : 5 Node Distributed Setup with Postgres (Container Support)

When you need to configure a 5 node distributed setup with WSO2 API Manager v2.6.0 pack and also to generate a Docker container for Postgres datasource

  1. Start the Docker service in your environment (if you don't have Docker installed, install Docker before exeucting the command to work without any errors)

  2. Download and extract a fresh pack of wso2am-2.6.0 inside a new directory (only the extracted WSO2 API Manager pack)

    - MyNewFolder
        |- wso2am-2.6.0
    
  3. Open a terminal and navigate to the parent folder of the extracted WSO2 APIM pack

  4. Execute the following

    # inside MyNewFolder
    hydrogen distribute:am --distributed --version 2.6 --datasource postgres --container --generate

The above command will create a new folder named distributed and places all configured 5 nodes within it and also generates a Docker container for the Postgres datasource.


Example 03 : Publish through Multiple Gateway

When you need to configure WSO2 API Manager v2.6.0 pack for Publish through Multiple-Gateway setup.

  1. Download and extract a fresh pack of wso2am-2.6.0 inside a new directory (only the extracted WSO2 API Manager pack)

    - MyNewFolder
        |- wso2am-2.6.0
    
  2. Open a terminal and navigate to the parent folder of the extracted WSO2 APIM pack

  3. Execute the following

    # inside MyNewFolder
    hydrogen distribute:am --multiple-gateway --version 2.6

The above command will create a new folder named distributed and places all configured nodes within it.


Example 04 : IS as Key Manager with Postgres

When you need to configure WSO2 API Manager v2.6.0 with WSO2 IS-KM v5.7.0 and Postgres datasource

  1. Download and extract both wso2am-2.6.0 and wso2is-km-5.7.0 inside a new directory (only the extracted WSO2 APIM pack & the IS-KM pack)

    - MyNewFolder
        |- wso2am-2.6.0
        |- wso2is-km-5.7.0
    
  2. Open a terminal and navigate to the parent folder of the extracted packs

  3. Execute the following

    # inside MyNewFolder
    hydrogen distribute:am --is-km --version 2.6 --datasource postgres

Example 05 : IS as Key Manager with Postgres (Container Support)

When you need to configure WSO2 API Manager v2.6.0 with WSO2 IS-KM v5.7.0 and also to generate a Docker container for Postgres datasource

  1. Start the Docker service in your environment (if you don't have Docker installed, install Docker before executing the command to work without any errors)

  2. Download and extract both wso2am-2.6.0 and wso2is-km-5.7.0 inside a new directory (only the extracted WSO2 APIM pack & the IS-KM pack)

    - MyNewFolder
        |- wso2am-2.6.0
        |- wso2is-km-5.7.0
    
  3. Open a terminal and navigate to the parent folder of the extracted packs

  4. Execute the following

    # inside MyNewFolder
    hydrogen distribute:am --is-km --version 2.6 --datasource postgres --container --generate

[ ✏️ Under Progress ]