Network Observability with SuzieQ: Part Two
Learn to set up Suzieq with Docker Compose for seamless network observability in a few simple steps!
In part One of this multipart series, we covered the introduction to SuzieQ and some of the features of SuzieQ. In this part, we will cover how to set up SuzieQ using Docker Compose. If you have not read Part One yet, I recommend you read it first before proceeding with this part.
Setting up SuzieQ using Docker Compose
Setting up SuzieQ with Docker Compose simplifies deployment and management. Docker Compose is a tool for defining and running multi-container docker applications using a single YAML file. We’ll use a pre-built SuzieQ Docker image from Docker Hub, maintained and regularly updated by the SuzieQ team, to ensure you have the latest features and improvements.
Prerequisites
Before we start, make sure you have the following installed on your machine:
- Docker
- Docker Compose
Initiate Your Suzieq Setup
We'll begin with creating necessary files and directories. This will include:
suzieq/
: Directory to store configuration files for SuzieQparquet/
: Directory to store the Parquet database for SuzieQdocker-compose.yml
: File to define the services, networks, and volumes required for SuzieQsuzieq/suzieq-cfg.yml
: File to contain the configuration for SuzieQsuzieq/inventory.yml
: File to contain the inventory data for SuzieQ.env
: File to contain the environment variables required for SuzieQ
Your directory structure should look like this:
Populate the configuration and inventory files
Next, let’s populate the suzieq-cfg.yml
, inventory.yml
and .env
files with the required configuration and inventory data.
Here is an example of how the suzieq-cfg.yml
file might look:
And here is an example of how the inventory.yml
file might look:
And here is an example of how the .env
file might look:
Fix permissions
Since the SuzieQ Docker image runs as a non-root user (suzieq), we need to ensure that the configuration files are accessible to the suzieq
user. To do this, we need to first identify the user ID of the suzieq
user and group ID of the suzieq
group. You can do this by initializing a temporary container with the SuzieQ image and running the id
command.
The output of the command will give you the uid and gid of the SuzieQ user. In this case, uid=1000
and gid=1000
. You can then use these values to set the ownership of the configuration files.
Compose the docker-compose file
Next we'll write the docker compose file. Refer to the inline comments for explanation of each step
Start the services
Once you have defined the services in the docker-compose.yml
file, you can start the SuzieQ services using Docker Compose. Run the following command in the directory where the docker-compose.yml
file is located:
This command will start the SuzieQ Poller, REST API, GUI, and CLI services in detached mode. You can check the status of the services using the following command:
root@sudarshan-devbox:/suzieq/suzieq# docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------
suzieq_cli suzieq-cli -c /home/suzieq ... Up
suzieq_gui suzieq-gui -c /home/suzieq ... Up 0.0.0.0:8501->8501/tcp,:::8501->8501/tcp
suzieq_poller sq-poller -I /home/suzieq/ ... Up
suzieq_rest sq-rest-server -c /home/su ... Up 0.0.0.0:8000->8000/tcp,:::8000->8000/tcp
root@sudarshan-devbox:/suzieq/suzieq#
You can now access the SuzieQ GUI by navigating to http://localhost:8501
in your web browser. You can interact with the SuzieQ REST API by sending requests to http://localhost:8000
. You can also use the SuzieQ CLI by running the following command:
docker attach suzieq_cli
This will attach your terminal to the SuzieQ CLI container, allowing you to interact with the CLI.
Troubleshooting
Troubleshoot issues by looking at the status of the containers and also the logs:
docker-compose ps # view status of the SuzieQ containers
docker-compose logs -f # tail logs for real-time updates
For more detailed troubleshooting, you could also look at the various log files in the suzieq_poller container
root@sudarshan-devbox:/suzieq/suzieq# docker exec suzieq_poller ls -al /tmp
total 12
drwxrwxrwt 1 root root 100 Jun 12 14:09 .
drwxr-xr-x 1 root root 40 Jun 12 14:09 ..
drwxr-xr-x 3 root root 25 Jun 12 14:09 .suzieq
-rw-r--r-- 1 root root 666 Jun 12 14:10 sq-coalescer.log
-rw-r--r-- 1 root root 2064 Jun 12 14:10 sq-poller-0.log
-rw-r--r-- 1 root root 1724 Jun 12 14:10 sq-poller-controller.log
root@sudarshan-devbox:/suzieq/suzieq#
Wrapping Up
In this part, we covered how to set up SuzieQ using Docker Compose. We created the necessary files and directories, populated the configuration and inventory files, fixed permissions for the configuration files, defined the services in the docker-compose.yml
file, and started the SuzieQ services using Docker Compose. We also covered how to troubleshoot issues with SuzieQ by checking the logs of the services.
In the next part of this multipart series, we will cover how to interact with SuzieQ using the REST API. Stay tuned!