Documentation

Test your InfluxDB Cluster

With your InfluxDB cluster deployed and running, test to ensure you can successfully write and query data from InfluxDB.

  1. Download and install influxctl
  2. Retrieve your cluster’s admin token
  3. Configure influxctl to connect to your cluster
  4. Create a new database
  5. Write test data to the new database
  6. Query the test data from your database

Download and install influxctl

influxctl is a command line tool that lets you manage, write data to, and query data from your InfluxDB cluster from your local machine.

Download and install influxctl

Retrieve your cluster’s admin token

InfluxDB Clustered generates a valid access token (known as the admin token) and stores it as a secret in your cluster’s influxdb namespace. During this phase of the installation process, use the admin token with influxctl in lieu of configuring and using an identity provider.

Use kubectl to retrieve the admin token from your influxdb namespace secret store and copy it to a file:

kubectl get secrets/admin-token \
  --template={{.data.token}} \
  --namespace influxdb | base64 -d > token.json

Configure influxctl to connect to your cluster

Create an influxctl connection profile for your InfluxDB cluster. Connection profiles are stored in a config.toml file on your local machine and contain the credentials necessary to connect to and authorize with your InfluxDB cluster.

  1. Create a file named config.toml with the following contents:

    [[profile]]
      name = "default"
      product = "clustered"
      host = "cluster-host.com"
      port = "
    INFLUXDB_PORT
    "
    [profile.auth.token] token_file = "/
    DIRECTORY_PATH
    /token.json"

    In the example above, replace the following:

    • INFLUXDB_PORT: The port to use to connect to your InfluxDB cluster.
    • DIRECTORY_PATH: The directory path to your admin token file, token.json.

    To set your InfluxDB cluster host, click Set InfluxDB cluster URL below the codeblock above and provide your cluster’s host. This will update your cluster’s host in all code examples.

  2. Make this configuration file available to influxctl in one of the following ways:

    • Include the --config flag with all influxctl commands to specify the filepath of your config.toml.
    • Store the config.toml file at the default location that influxctl expects to find connection profiles based on your operating system. If your connection profile is in the default location, you do not need to include the --config flag with your influxctl commands.

Connection configuration examples

In the examples below, replace CONFIG_PATH with the directory path to your connection configuration file. If you placed your configuration file in the default location for your operating system, remove --config /CONFIG_PATH/config.toml from the example commands before running them.

Create a new database

Use influxctl database create to create a new database named testdb. Include the following:

  • (Optional) The path to your connection profile configuration file.
  • The database name–testdb.
influxctl --config /
CONFIG_PATH
/config.toml database create testdb

Write test data to the new database

Use influxctl write to write the following test data to your testdb database. Provide the following:

  • (Optional) The path to your connection profile configuration file.
  • The database name–testdb.
  • Line protocol to write to InfluxDB.
influxctl --config /
CONFIG_PATH
/config.toml write \
--database testdb \ "home,room=Living\ Room temp=21.1,hum=35.9,co=0i 1641024000000000000 home,room=Kitchen temp=21.0,hum=35.9,co=0i 1641024000000000000 home,room=Living\ Room temp=21.4,hum=35.9,co=0i 1641027600000000000 home,room=Kitchen temp=23.0,hum=36.2,co=0i 1641027600000000000 "

Query the test data from your database

Use influxctl query to query the test data from your testdb database. Provide the following:

  • (Optional) The path to your connection profile configuration file.
  • The database name–testdb.
  • The SQL query to execute.
influxctl --config /
CONFIG_PATH
/config.toml query \
--database testdb \ "SELECT * FROM home"

This should return results similar to:

cohumroomtemptime
035.9Living Room21.12022-01-01T08:00:00Z
035.9Kitchen212022-01-01T08:00:00Z
021.4Living Room21.42022-01-01T09:00:00Z
036.2Kitchen232022-01-01T09:00:00Z

If the query successfully returns data, your InfluxDB cluster is set up and functional.


Was this page helpful?

Thank you for your feedback!


New in InfluxDB 3.5

Key enhancements in InfluxDB 3.5 and the InfluxDB 3 Explorer 1.3.

See the Blog Post

InfluxDB 3.5 is now available for both Core and Enterprise, introducing custom plugin repository support, enhanced operational visibility with queryable CLI parameters and manual node management, stronger security controls, and general performance improvements.

InfluxDB 3 Explorer 1.3 brings powerful new capabilities including Dashboards (beta) for saving and organizing your favorite queries, and cache querying for instant access to Last Value and Distinct Value cachesβ€”making Explorer a more comprehensive workspace for time series monitoring and analysis.

For more information, check out:

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On November 3, 2025, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2