Server installation - Storm Streaming Server

There are two ways on how to install Storm Streaming Server on your machine - you can either download files manually and start the server though provided shell scripts, or use Docker image instead. The first method requires a working JVM, as not all systems come with it preinstalled. A detailed tutorial on how to do this can be found in our Java Installation Guide.

Alternatively a Docker container can be used instead, since all Storm Streaming Server builds come with dedicated Docker images. We have prepared a complete tutorial for Docker installation and reconfiguration, that can be found in Docker Installation Guide section.

Manual installation

Storm Streaming Server can be download from My Products / Download page and comes as the compressed zip file. Please uncompress it into a desired location (we suggest something within /home or /srv directories). The package contains:

StormStreamingServer.jarMain server file (jar library)
config/log4j.xmlXML containing log4j configuration
config/preferences.xmlXML containing server configuration
log/log.logInitial log file (empty)
license/storm-license.keyLicense key (it will be updated by the server itself)
license/storm-pubic.keyPublic license key
scripts/start.shStart script
scripts/stop.shStop script
Table 1. Storm package table

Manual installation - Starting server

  1. On Linux-based and MacOS X operating system

    In order to start the server, you can edit scripts/start.sh script. It’s very short and simple:

                                    
    #!/bin/sh
    pkill -9 -f "StormStreamingServer.jar"
    echo Shutting down old instances ... 3
    sleep 1
    echo Shutting down old instances ... 2
    sleep 1
    echo Shutting down old instances ... 1
    sleep 1
    pkill -9 -f "StormStreamingServer.jar"
    echo Shutting down old instances ... 0
    sleep 1
    echo Staring new Java App
    java -server -Xmx128g -Xms32g -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -jar "/home/storm/StormStreamingServer.jar" -configRootDIR /home/storm &
                                

    The script will automatically kill all instances of Storm sever and start a new one. We’ll have to edit some parameters before we can properly launch the server.

    ParameterDescription
    -Xmx128gJVM parameter controlling the maximum amount of RAM memory can be allocated to JVM. The amount shouldn’t exceed ¾ of the total RAM In your system. You can replace memory value with any number according to this pattern: -XmxYZ, where Y is the number of Z (g – gigabytes, m -megabytes)
    -Xms32gJVM parameter controlling the minimal amount of RAM memory allocated to the JVM. This number shouldn’t be lower than ¼ of the -Xmx parameter
    -jar “<PATH_TO_JAR_FILE>”This is the direct path to the jar file
    -configRootDIR <PATH_TO_MAIN_FOLDER>This parameter points to the main folder of the server (containing license and config folders)
    &This option will keep the server running in the background
    Table 2. Parameters table
  2. On Windows-based operating system

    In order to start the server you can edit scripts/start.bash script. It’s very short and simple:

                                    
    taskkill /f /t /im java.exe
    echo Shutting down old instances ... 3
    sleep 1
    echo Shutting down old instances ... 2
    sleep 1
    echo Shutting down old instances ... 1
    sleep 1
    taskkill /f /t /im java.exe
    echo Shutting down old instances ... 0
    sleep 1
    print Staring new Java App
    START /B java -Xmx128g -Xms32g -jar C:\Program Files\Storm\StormStreamingServer.jar -configRootDIR C:\Program Files\Storm
                                

    The script will automatically kill all instances of Storm sever and start a new one. We’ll have to edit some parameters before we can properly launch the server.

    ParameterDescription
    -Xmx128gJVM parameter controlling the maximum amount of RAM memory can be allocated to JVM. The amount shouldn’t exceed ¾ of total RAM in your system. You can replace memory value with any number according to this pattern: -XmxYZ, where Y is the number of Z (g – gigabytes, m -megabytes)
    -Xms32gJVM parameter controlling the minimal amount of RAM memory allocated to the JVM. This number shouldn’t be lower than ¼ of the -Xmx parameter
    -jar “<PATH_TO_JAR_FILE>”This is the direct path to the jar file
    -configRootDIR <PATH_TO_MAIN_FOLDER>This parameter points to the main folder of the server (containing license and config folders)
    START /BThis option will keep the server running in the background
    Table 3. Parameters table

Docker installation

This is an alternative method to manual installation. In order to download storm image, please use the following command (linux, mac os terminal):

                        
docker run -it -d --name StormStreamingServer --hostname StormStreamingServer -e "JAVA_OPTS=-Xmx16G" -p 1935:1935 -p 80:8080 -p 443:8443 -v /home/storm/config:/opt/storm/data docker.stormstreaming.com/stormstreamingserver/stormstreamingserver:latest
                    

Commands explanation:

--name StormStreamingServerName (alias) of our docker container.
--hostname StormStreamingServerHostname of our docker container.
-e "JAVA_OPTS=-Xmx16G"Additional Java opts, -Xmx16G tells that JVM can use up to 16 GB of memory. We recommend to increase this value up to 2/3 of total machine memory. Eg. -Xms128GB, -Xms256GB
-p 1935:1935Assigns local port (left) to the container port. This port reserved for RTMP Server.
-p 80:8080Assigns local port (left) to the container port. This port reserved for Non-SSL HTTP Server.
-p 433:8433Assigns local port (left) to the container port. This port reserved for SSL HTTP Server.
-v /home/storm:/opt/storm/data.Assigns host directory (left) to the config holder inside the container. Please make sure that the path on your host machine is valid!
docker.stormstreaming.com/stormstreamingserver/stormstreamingserver:latestDefines which image should be downloaded from the registry. Please make sure to always check for the latest version image (number at the end). You can check it on the My Products / Download page, within your account.
Table 4. Docker run command parameters
In order for the SSL encryption layer to work, a proper certificate must be attached to the container. In order to do so, please modify the run command by adding one more volume (-v command) e.g.:
-v /etc/ssl/private:/etc/ssl/private. In this way, a certificate file added to the host folder /etc/ssl/private will also be accessible for the container under the same path.

To manage a Docker container, few commands come in handy:

  1. To display all logs generated by the container (including Storm Streaming Server output):
                                    
    docker logs StormStreamingServer
                                
  2. To shutdown the container (and the server) down:
                                    
    docker stop StormStreamingServer
                                
  3. To launch the container:
                                    
    docker start StormStreamingServer
                                

Server preferences

Before StormStreamingServer can be started for the first time, some modifications to the preferences.xml must be made prior. For Docker images it will be auto-generated upon first container launch, but must be edited nonetheless.

  1. Adding server license - a proper license key must be added to the preferences.xml file. You can obtain your serial code on the My Products / Download page, within your account.
                                    
    <License key="YOUR-SERIAL-CODE-GOES-HERE" />
                                
  2. Configuring Domain - the server must be aware of the main domain to properly serve some types of requests.
                                    
    <Domain>sub1.mydomain.com</Domain>
                                
  3. SSL Certificate and password - a properly configure JKS file and password must be provided to enable SSL Connection. A detailed guide on how to create your JKS file can be found in our SSL Configuration guide.
                                    
    <Certificate>
        <path>/etc/ssl/private/mydomain.jks</path>
        <password>mypassword</password>
    </Certificate>
                                

Log file location

One more thing that needs to be done is defining the log files directory. In order to do it, please edit log4j.xml file and search for appender name="file" tag.

One of the parameters will show the directory for the logs.

                                
<param name="file" value="H:/StormServer/log/log.log" />