@athiththan11/hydrogen-cli

An interactive CLI tool for WSO2 Servers

Athiththan Kathirgamasegaran
4 min readOct 26, 2019
hydrogen-cli

Hydrogen is an interactive CLI tool developed to set up and configure WSO2 servers with ease

The initial focus and effort of developing hydrogen-cli is to provide an easy environment to configure and replace default shipped H2 databases (Carbon database, etc.) with other supported databases such as MySQL, Postgres, MSSQL and etc. The first few releases of hydrogen focused only on WSO2 Identity Server to replace H2 databases.

Along with success stories, hydrogen has been evolving and with the latest release v0.4.0-beta, now you can set up distributed environments, IS-KM configurations and also can generate Docker containerized databases for WSO2 servers.
And there are more to come on the line.

Check out the hydrogen-project board for future releases and features.

The current releases and development cycles of hydrogen-cli are more into the major and latest released versions of WSO2 servers which includes API Manager v2.6, Identity Server v5.7 and Enterprise Integrator v6.5.

Take a look at hydrogen-cli and get back with your feedback, suggestions, feature requests and issues to make the platform more viable.

Check out for examples at hydrogen-wiki

Love & Enjoying hydrogen, shout-out and spread the word. Don’t forget to star it

Hydrogen

Install & Run

hydrogen-cli is available via NPM to install in your favorite environments. Use the following NPM command to install

hydrogen-cli recommends to use and run on Node v8.9.0 for error-free environment due to packages and dependencies
You can use nvm to manage multiple Node versions in a single machine

npm install -g @athiththan11/hydrogen-cli

Examples

# Replace H2 Database with Postgres

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

  • Download and extract a fresh pack of WSO2 Identity Server v5.7
  • Fire up a terminal and navigate to the root of the extracted pack
  • Execute the following
# inside wso2is-5.7.0
hydrogen datasource:is --replace --datasource postgres --version 5.7

Before starting up the servers, download and place the postgres driver inside <HOME>/repository/components/lib

# Replace H2 Database with Postgres (Container Support)

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

  • Download and extract a fresh pack of WSO2 Identity Server v5.7
  • Start the Docker service in your environment
  • Fire up a terminal and navigate to the root of the extracted pack
  • Execute the following
# inside wso2is-5.7.0
hydrogen datasource:is --replace --datasource postgres --version 5.7 --container --generate

Before starting up the servers, download and place the postgres driver inside <HOME>/repository/components/lib

# 5 Node Distributed Setup with Postgres (Container Support)

When you need to configure a 5 node distributed setup with WSO2 API Manager v2.6 pack and Postgres database and also to generate a Docker container for Postgre with related databases

  • Download and extract a fresh pack of WSO2 API Manager v2.6 inside a new directory (only the extracted WSO2 AM pack)
- MyNewFolder
| - wso2am-2.6.0
  • Start the Docker service in your environment
  • Fire up a terminal and navigate to the root directory (MyNewFolder)
  • Execute the following
# inside MyNewFolder
hydrogen distribute:am --distributed --version 2.6 --datasource postgres --container --generate

hydrogen-cli creates a new folder named distributed and places all configured 5 nodes within it along with profile-optimizations

Before starting up the servers, download and place the postgres driver inside <HOME>/repository/components/lib

# IS as Key Manager with Postgres (Container Support)

When you need to configure WSO2 API Manager v2.6 with WSO2 Identity Server as Key Manager (IS-KM) v5.7 along with the Postgres database and also to generate a Docker container for Postgre with related databases

  • Download and extract both WSO2 API Manager v2.6 and WSO2 IS-KM v5.7 inside a new directory (only the extracted WSO2 packs)
- MyNewFolder
| - wso2am-2.6.0
| - wso2is-km-5.7.0
  • Start the Docker service in your environment
  • Fire up a terminal and navigate to the root folder (MyNewFolder)
  • Execute the following
# inside MyNewFolder
hydrogen distribute:am --is-km --version 2.6 --datasource postgres --container --generate

Before starting up the servers, download and place the postgres driver inside <HOME>/repository/components/lib

--

--

Athiththan Kathirgamasegaran
Athiththan Kathirgamasegaran

Written by Athiththan Kathirgamasegaran

@athiththan11 | GH:athiththan11 | Site Reliability Engineer@WSO2

No responses yet