Creating Node.js Service Template

All actions will be performed in Design Studio workplace.

Creating Prerequisites

Creating Service Category

  1. Click on Classification view and Service Categories tab.

  2. On Activities ribbon, click on Add Service Category and set the fields:

    • Name - Application Server
    • Description - Base category for application servers.
  3. Click on OK.

Creating Service Type

  1. Click on Services view and Service Types tab.

  2. On the Activities ribbon, click on Add Service Type and enter the settings:

    • Name - put nodejs
    • Product Vendor - put vixtera
    • Category - click on Browse and choose the service category Application Server
    • OS Family - click on Browse and choose Linux
    • Description - put Node.js runtime environment
  3. Click on OK.

Creating Scripts

  1. Create a script named install_nodejs.sh with the following content:
#!/bin/bash
yum -y -q update nss
rpm --quiet -U https://rpm.nodesource.com/pub_4.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm
yum -q clean all
yum -y -q install nodejs
npm install --silent -g forever
echo "Node.js version $(node --version) installed"

Creating Service Template

  1. Click on Services view and Service Templates tab.

  2. On the Actions ribbon, click on Add Template and Add Template.

  3. In the General section, click on Properties and configure:

    • Version - click on Browse and specify the following:

      • Service Type - click on Browse and select the service type nodejs
      • Major - put 1 and leave 0 for Minor, Maintenance ID, Build #
    • Display Name - put Node.js 1.0.0.0

    • Description - Node.js Application Server.

  4. In the Media section, click on Media Folders, then click Add Media Folder and enter the following:

    • Folder Name - put nodejs
    • Description - put Contains install scripts and distributives for Node.js

    Click OK.

  5. In the Media section, click on Media Files, then click on Add Media File, Upload Media File and specify the following:

    • Media Store - automatically set
    • File Name - click Browse and locate the file install_nodejs.sh
    • Source Folder - automatically set
    • Media Folder - click Browse and choose the folder nodejs
    • Media Type - click Browse and choose Script or Configuration
    • Description - put Script that performs installation of Node.js runtime environment

    Click on OK.

  6. In the Service Management section, click on Topology. No changes at the moment.

  7. In the Service Management section, click on Service Parameters. No changes at the moment.

  8. In the Service Management section, click on Operations. Click on Add Operation and configure the following:

    • In General section, click on Properties and set:

      • Operation Type - select Install
      • Description - put Installs Node.js runtime environment.
    • In Orchestration | Execution section, click on Execute:

      • Script Name - put run_install_nodejs.sh
      • Script - put
    echo ${system-account[Service Owner].password} | sudo -S ${MediaHome}/nodejs/install_nodejs.sh || exit 1
    

    Click on OK.

  9. In the Service Management section, click on Deployment Profiles. Click on Add Deployment Profile and configure the following:

    • In General section, click on Properties and enter the following:
      • Name - put testing
      • Environment Type - click Browse and choose Testing
      • Description - Deployment with minimal hardware resources
    • In the General section, click on Default Deployment Group and enter the following:

      • In Host Group Properties box:

        • Group Name - put Node.js
        • Key - put nodejs
        • OS Platform - click Browse and choose CentOS 6 x64
        • Hardware Platform - click Browse and choose Tiny

    Click on OK.

  10. Click on OK.

Testing Service Template

  1. Click on Services view and Service Templates tab.

  2. Select template Node.js 1.0.0.0 in the Service Templates grid.

  3. On the Actions ribbon, click on Test Template.

  4. In the Provisioning section, click on Properties and set:

    • Environment Type - click on Browse and choose Testing
    • Space, Deployment Profile and System Profile will be completed automatically
  5. Click on Provision.

  6. Click on OK.