Welcome Guest! Log in

Installing Stambia DI Runtime in a CentOS 7 server

    Installing Java 8

    [support@centos7vm ~]$ sudo yum install java
    ...
    [support@centos7vm ~]$ java -version
    openjdk version "1.8.0_191"
    OpenJDK Runtime Environment (build 1.8.0_191-b12)
    OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

    Installing the Runtime

    [support@centos7vm opt]$ ls -l
    total 46348
    -rw-r--r--.  1 root root 47454806 Dec 21 16:16 stambiaRuntime_S17.6.3_20181220_113216.zip
    [support@centos7vm opt]$
    [support@centos7vm opt]$ sudo unzip stambiaRuntime_S17.6.3_20181220_113216.zip
    inflating...
    [support@centos7vm opt]$
    [root@centos7vm opt]# ls -l
    total 46348
    drwxr-xr-x. 13 root    root   4096 Jan  8 10:51 stambiaRuntime
    -rw-r--r--.  1 root    root    47454806 Dec 21 16:16 stambiaRuntime_S17.6.3_20181220_113216.zip

    You can adjust the file owner and permission to your security policy, for example :

    [support@centos7vm opt]$ sudo chown -R stambia:stambia stambiaRuntime
    [support@centos7vm opt]$ sudo chmod 755 stambiaRuntime/*.sh

    At this point, take the time to configure your Runtime (ports, log database, security options...) in /opt/stambiaRuntime/properties/engineParameters.xml.

    Also add your JDBC drivers and addons to /opt/stambiaRuntime/lib

    Declaring the Runtime service in systemd

    Create a systemctl service file, for example /etc/systemd/system/stambiaRuntime.service :

    [Unit]
    Description=Stambia Runtime
    After=network.target
    [Service]
    Type=simple
    Restart=always
    RestartSec=5
    User=support
    WorkingDirectory=/opt/stambiaRuntime
    Environment="STAMBIA_HOME=/opt/stambiaRuntime"
    ExecStart=/opt/stambiaRuntime/startengine.sh
    [Install]
    WantedBy=multi-user.target

     Please consult your Linux Distribution documentation for more information on systemd and how to configure this file to match your needs and requirements.

    Operating the service

    [support@centos7vm stambiaRuntime]$ sudo systemctl start stambiaRuntime
    [support@centos7vm stambiaRuntime]$ sudo systemctl restart stambiaRuntime
    [support@centos7vm stambiaRuntime]$ sudo systemctl stop stambiaRuntime
    [support@centos7vm stambiaRuntime]$ sudo systemctl status stambiaRuntime

     

    Checking the Linux service status

    [support@centos7vm log]$ sudo systemctl status stambiaRuntime
    [sudo] password for support:
    ● stambiaRuntime.service - Stambia Runtime
       Loaded: loaded (/etc/systemd/system/stambiaRuntime.service; disabled; vendor preset: disabled)
       Active: active (running) since Fri 2018-12-28 13:50:42 CET; 11min ago
     Main PID: 3630 (startengine.sh)
       CGroup: /system.slice/stambiaRuntime.service
               ├─3630 /bin/sh /opt/stambiaRuntime/startengine.sh
               └─3633 java -Xms32m -Xmx512m -Xss256k -Dstambia.classpath.v1.root= -classpath /opt/stambiaRuntime/.:/opt/stambiaRuntime/lib/comdcom:/opt/stamb...
    Dec 28 13:50:46 centos7vm startengine.sh[3630]: 28/12/2018 13:50:46,380 - Runtime version: s17.6.3_20181220
    Dec 28 13:50:46 centos7vm startengine.sh[3630]: 28/12/2018 13:50:46,381 - Java version: 1.8.0_191 vendor: Oracle Corporation home: /usr/lib/jvm/j...6_64/jre
    Dec 28 13:50:47 centos7vm startengine.sh[3630]: 28/12/2018 13:50:47,287 - Internal Database is started: 192.168.75.134:42100
    Dec 28 13:50:47 centos7vm startengine.sh[3630]: 28/12/2018 13:50:47,350 - Internal Database Web Server is started: http://192.168.75.134:42101
    Dec 28 13:50:50 centos7vm startengine.sh[3630]: 28/12/2018 13:50:50,902 - RMI server is started: rmi://192.168.75.134:42000
    Dec 28 13:50:54 centos7vm startengine.sh[3630]: 28/12/2018 13:50:54,129 - Scheduler is started
    Dec 28 13:50:55 centos7vm startengine.sh[3630]: 28/12/2018 13:50:55,797 - SOAP Endpoint: http://centos7vm:42200/wsi/DeliverableService?WSDL
    Dec 28 13:50:55 centos7vm startengine.sh[3630]: 28/12/2018 13:50:55,798 - SOAP Legacy "Non WSI-Compliant" Endpoint: http://centos7vm:42200/Stambi...ice?WSDL
    Dec 28 13:50:55 centos7vm startengine.sh[3630]: 28/12/2018 13:50:55,798 - HTTP Rest Endpoint v2: http://centos7vm:42200/rest/StambiaDeliveryServi...eryName>
    Dec 28 13:50:55 centos7vm startengine.sh[3630]: 28/12/2018 13:50:55,798 - HTTP Rest Endpoint v1: http://centos7vm:42200/rest/StambiaDeliveryServi...eryName>
    Hint: Some lines were ellipsized, use -l to show in full.

     

    Checking the Runtime state

    See this article: http://www.stambia.org/doc/58-stambia-di-software/runtime/how-to/64-checking-that-the-runtime-is-up-and-running

    [support@centos7vm stambiaRuntime]$ ./startcommand.sh "connect to localhost port 42000;get services"
    Connecting to localhost on port 42000
    Connected
    Name      Status  Duration
    rmi       Running 0:14:36.715
    soap      Running 0:14:31.819
    listener  Running 0:14:36.928
    rdbms     Running 0:14:40.266
    execution Running 0:14:36.927
    scheduler Running 0:14:33.487

     

    Installing the Runtime as a Linux service

      Here is a sample init.d script for executing the Runtime as a Linux service.

      This sample script should be adapted to your specific Linux distribution, server architecture and enterprise best practices.
      Please consult your Linux distribution's docs to know how to install and register a service.

      Sample script

      This sample script executes the Runtime as the "stambia" user. Please adapt it to your particular needs (directory, runtime port, user...).

      We have created this script in file /etc/init.d/stambiaRuntime

      And then we registered the service for startup with this command: sudo update-rc.d stambiaRuntime defaults

      #!/bin/sh

      # runtime install dir
      export dir=/data/stambiaRuntimeSupport

      # runtime port - necessary for stopping the runtime
      export port=42000

      start()
      {
        su - stambia -c "cd $dir;nohup ./startengine.sh &"
      }

      stop()
      {
        su - stambia -c "cd $dir;./stopengine.sh -port $port"
      }

      restart()
      {
          stop;
          sleep 1;
          start;
      }

      case $1 in
      start)
        start;;
      stop)
        stop;;
      restart)
        restart;;
      *)
        start;;
      esac

      Starting / Stopping the service

      Simply replace "stambiaRuntime" with your init.d script name:

      $ sudo service stambiaRuntime start
      $ sudo service stambiaRuntime stop
      $ sudo service stambiaRuntime restart

       

       

       

      Tips to install a new runtime

        When you install a new runtime there are some things you have to think about.

         

        Designer's help

        First, the help in the stambia designer is a good overview of how to do that, with examples of the different options.

        You can find it under :

        Help menu > Help Contents > Stambia > Configuration and Setup Guide > Installation

        Choosing a Java version

        We can't really tell which Java version you should choose, but we can help you choose by yourself.

        • When installing a dev / test / QA Runtime, simply choose the same Java version as your Production environment. This is a really good practice to avoid bad surprise when deploying jobs in production
        • Stambia works well with java versions 7 or 8 minimum
        • Make sure to select a version compatible with:
          • your JDBC drivers (Oracle, Mysql, Sqlserver...)
          • the connectors you will use (SAP, Salesforce, Amazon...)
          • the encryption algorythms you may need for SSL-secured connections (SFTP, SSH, HTTPS...)

        Tips and advices

        Here is some other usefull tips which may help you during the process.

        First run : Check the output of the startengine

        Before installing the runtime as a service, check if everything is working by starting the runtime with the startengine.bat (or startengine.sh) script.

        It is easier to see the errors that might happen during the startup this way. Then if everything is correct and working, you can install it as a service.

        Example of Output :

        C:\Users\stambia\Developpement\Designers\stambiaDesigner_S18.0.3_20150625_081118\stambia\stambiaRuntime>echo off
        21/08/2015 11:00:18,485 - Runtime version: s17.2.14_20150625
        21/08/2015 11:00:18,486 - Java version: 1.6.0_43 vendor: Sun Microsystems Inc. home: C:\Program Files\Java\jdk1.6.0_43\jre
        21/08/2015 11:00:19,052 - Internal Database is started: stambia-pc20:42100
        21/08/2015 11:00:19,073 - Internal Database Web Server is started: http://stambia-pc20:42101
        21/08/2015 11:00:21,885 - RMI server is started: rmi://stambia-pc20:42000
        21/08/2015 11:00:24,400 - Scheduler is started
        21/08/2015 11:00:25,633 - SOAP Endpoint: http://stambia-pc20:42200/wsi/DeliverableService?WSDL
        21/08/2015 11:00:25,633 - SOAP Legacy "Non WSI-Compliant" Endpoint: http://stambia-pc20:42200/StambiaDeliveryService?WSDL
        21/08/2015 11:00:25,633 - HTTP Rest Endpoint: http://stambia-pc20:42200/rest/StambiaDeliveryService/1/<deliveryName>

        Prevent the command line from closing when errors at startup

        When launching the startengine script, if there are errors at startup then the console's window opens and closes immediately, and you cannot see the errors.

        To avoid that :

        1. Open a command line prompt
        2. Then, type cmd (in windows, or bash for example in linux) in order to open a sub process.
        3. Navigate to the place where the startengine script is, and execute it.

        Now, if the runtime closes on errors it will come back to the first command line process, and you will still have the errors displayed.

        Once the reasons for the errors are solved (most often Java installation issues), of course you do not need to do this again.

         

         

        Articles

        Suggest a new Article!