Get Started
Welcome to the NebulaStream self-hosted demo guide. This guide will walk you through setting up and running a demo that showcases NebulaStream’s capabilities with two different scenarios: keystrokes and system monitoring. This demo contains multiple queries for trying out the data streaming system NebulaStream. It includes two scenarios:
- Keystrokes: A game similar to testing how fast one can type. It records the keystrokes and sends them to NebulaStream.
- System Monitoring: Monitors the streams of CPU and memory usage.
Both scenarios use simple bash scripts to create a TCP server and send data over TCP to NebulaStream in CSV format.
Keystrokes
- Description: Records keystrokes and sends them to NebulaStream.
- Data Schema:
key
: VARSIZEDtimestamp
: UINT64
System Monitoring
- Description: Monitors CPU and memory usage.
- Data Schemas:
CPU Resources:
timestamp
: UINT64user
: FLOAT64nice
: FLOAT64system
: FLOAT64idle
: FLOAT64iowait
: FLOAT64irq
: FLOAT64softirq
: FLOAT64steal
: FLOAT64guest
: FLOAT64guest_nice
: FLOAT64
Memory Resources:
timestamp
: UINT64MemTotal
: FLOAT64MemFree
: FLOAT64MemAvailable
: FLOAT64Buffers
: FLOAT64Cached
: FLOAT64SwapTotal
: FLOAT64SwapFree
: FLOAT64
Getting Started
Running the Demo with Docker Compose
The scripts run_monitoring_scenario.sh and run_keystrokes_scenario.sh bundle the necessary steps from below into an executable script. Both scripts
- Clone the Repository
- Do the following steps
git clone https://github.com/nebulastream/nebulastream/
cd nebulastream/docs/guide/get_started
bash ./run_monitoring_scenario.sh <query file.yaml>
Running the Demo from Local Sources
- Build NebulaStream: Refer to the Development Guide
- Start generating data: Copy the following files into generate_data/
cd generate_data
./sys_resources.sh # For the system monitoring scenario
./send_keystrokes_to_nebulastream.sh # For the keystrokes scenario
./write_stdin_to_file.sh # For the keystrokes scenario
- Start the NebulaStream Node Worker:
./build_dir/nes-single-node-worker/nes-single-node-worker
- Submit a query via Nebuli:
cat scripts/demo/queries/some_query.yaml | ./build_dir/nes-nebuli/nes-nebuli register -x -s localhost:8080
Extra information for the keystrokes use-case
It is not possible to open a standard input stream (stdin) and forward it to the data generator service. Therefore, we have created an additional script that forwards all stdin to a file that the docker-compose service reads and passes on to NebulaStream.
bash generate_data/write_stdin_to_file.sh
Expected output
When you successfully deploy a query using Docker Compose, you can expect to see a variety of console outputs, which may differ depending on the specific query being executed. However, there are common indicators of a successful deployment that you should look for. We focus on getting you started with Docker Compose to streamline your experience. A successful deployment typically results in a console output similar to the one illustrated in the image below. You should see the services starting up in sequence, followed by the execution of your query.
Upon successful completion, the terminal output for Docker Compose should indicate that the get_started_nebuli_1
container has exited with code 0
, signifying that the process was completed without errors.
This visual confirmation helps ensure that your setup is correct and that NebulaStream is functioning as expected, allowing you to proceed with confidence in exploring its capabilities.
