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
Parstream server is included in the EFM install package.
It can be installed on Linux using the "efm-linux" command, with "install" and "parstream" options.

ParStream is installed by default into the folder "/opt/cisco/kinetic/parstream"
Create a parstream configuration file and name it "parstream.ini"
The configuration attributes to note:
- server name: server.parstream1
- port: 23456
- data directory: datadir
Sample parstream configuration file (parstream.ini)

Store this file in the configuration directory of your choice.
Start the ParStream server
Change directory to where the parstream.ini file is stored. For example:
cd /parstream/config
Setup the Library path:
export LD_LIBRARY_PATH=/opt/cisco/kinetic/parstream/lib
Start the Parstream server:
nohup /opt/cisco/kinetic/parstream/bin/parstream-server parstream1 &
Verify that the parstream server is running:
ps -ef | grep parstream-server

Create a table
Once the database is started, you need to create a table to allow data to be stored in the database.
Sample create table script, named "sensorTelemetry.sql".

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.
- Open the dataflow webpage at https://BrokerIP:8443/dataflow.html.
- Go to the Data panel and select downstream and then ParStream-Import.
- Right click ParStream-Import and select Add Database.
- 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
- Click Invoke.

Insert data into the ParStream table
Navigate to Data > downstream > ParStream-Import > historian > Tables > sensorTelemetry.
Right-click sensorTelemetry and drag the Insert Row action to the canvas.

In the properties section for the "insertRow", set the following:
- siteId—CPU_Avg
- sensorId—combined
- metricName—the CPU_Avg
Bind the cpu_avg variable to the metricValue property/column on the insertRow block.
Set the autorun property on all insertRow blocks to true.
- autorun ensures that the "insert" operation is performed whenever there is new data.
To verify data is being inserted into the database, check the Metrics for the database table.

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