Configure Parstream

ParStream is a time-series database (historian) that is included with EFM.

It is optimized for INSERT operations and complex analytical queries.

At the same time it is non-transactional, which means no support for UPDATE or DELETE operations.

The steps below will build from the average CPU utilization dataflow that was built in the previous page.

Install the ParStream server

  1. Parstream server is included in the EFM install package.

  2. It can be installed on Linux using the "efm-linux" command, with "install" and "parstream" options.

    EFM

  3. ParStream is installed by default into the folder "/opt/cisco/kinetic/parstream"

  4. Create a parstream configuration file and name it "parstream.ini"

  5. The configuration attributes to note:

    • server name: server.parstream1
    • port: 23456
    • data directory: datadir
  6. Sample parstream configuration file (parstream.ini)

    EFM

  7. Store this file in the configuration directory of your choice.

Start the ParStream server

  1. Change directory to where the parstream.ini file is stored. For example:

    cd /parstream/config

  2. Setup the Library path:

    export LD_LIBRARY_PATH=/opt/cisco/kinetic/parstream/lib

  3. Start the Parstream server:

    nohup /opt/cisco/kinetic/parstream/bin/parstream-server parstream1 &

  4. Verify that the parstream server is running:

    ps -ef | grep parstream-server

    EFM

Create a table

Once the database is started, you need to create a table to allow data to be stored in the database.

  1. Sample create table script, named "sensorTelemetry.sql".

    EFM

  2. Create a table in ParStream:

    cat sensorTelemetry.sql | /opt/cisco/kinetic/parstream/bin/pnc -p 23456

The database is now created, a table is created to store data.

The ParStream DSLink needs to be configured to connect to this created database/table, to allow the sensor data in EFM to be stored in ParStream.

  1. Open the dataflow webpage at https://BrokerIP:8443/dataflow.html.
  2. Go to the Data panel and select downstream and then ParStream-Import.
  3. Right click ParStream-Import and select Add Database.
  4. Enter the following settings. Make sure the host, port, username and password values match your ParStream installation.
    • name=historian
    • host=localhost
    • port=23456
    • user=john
    • password=doe
    • importPriority=HIGH
    • autoIntrospect=True
  5. Click Invoke.

EFM

Insert data into the ParStream table

  1. Navigate to Data > downstream > ParStream-Import > historian > Tables > sensorTelemetry.

  2. Right-click sensorTelemetry and drag the Insert Row action to the canvas.

    EFM

  3. In the properties section for the "insertRow", set the following:

    • siteId—CPU_Avg
    • sensorId—combined
    • metricName—the CPU_Avg
  4. Bind the cpu_avg variable to the metricValue property/column on the insertRow block.

  5. Set the autorun property on all insertRow blocks to true.

    • autorun ensures that the "insert" operation is performed whenever there is new data.
  6. To verify data is being inserted into the database, check the Metrics for the database table.

    EFM

  7. Now CPU Average data is being inserted into the ParStream table.