Skip to main content

Get Started with TDengine Using an Installation Package

You can install TDengine on a local machine and perform some basic tests to verify its performance. The TDengine OSS server can be installed on Linux and macOS, and the TDengine OSS client can be installed on Linux, macOS, and Windows.

To install TDengine in a Docker container instead of on your machine, see Get Started with TDengine in Docker.

Before You Begin

Procedure

The TDengine OSS installation package is provided for Linux users in .deb, .rpm, and .tar.gz format and can also be installed via APT from our repository. Installation packages are also provided for macOS (client and server) and Windows (client only).

  1. Select the appropriate package for your machine and follow the steps to install TDengine.

    1. Download the .deb installation package:

      • Run the following command to install TDengine:

        sudo dpkg -i TDengine-server-<version>-Linux-x64.deb

        Replace <version> with the version of the package that you downloaded.

    2. When installing the first node and prompted with Enter FQDN:, you do not need to input anything. Only when installing the second or subsequent nodes do you need to input the FQDN of any available node in the existing cluster to join the new node to the cluster. Alternatively, you can configure it in the new node's configuration file before starting.

    3. Select your operating system and follow the steps to start TDengine services.

      Run the following command to start all TDengine services:

      sudo start-all.sh 

      Alternatively, you can manage specific TDengine services through systemd:

      sudo systemctl start taosd
      sudo systemctl start taosadapter
      sudo systemctl start taoskeeper
      sudo systemctl start taos-explorer
      note

      If your machine does not support systemd, you can manually run the TDengine services located in the /usr/local/taos/bin directory.

      You can now work with TDengine on your local machine. For example, you can run the taos command to open the TDengine command-line interface.

    What to Do Next

    Test Data Ingestion

    Your TDengine installation includes taosBenchmark, a tool specifically designed to test TDengine’s performance. taosBenchmark can simulate data generated by many devices with a wide range of configuration options so that you can perform tests on sample data similar to your real-world use cases. For more information about taosBenchmark, see taosBenchmark.

    Perform the following steps to use taosBenchmark to test TDengine's ingestion performance on your machine:

    1. Run taosBenchmark with the default settings:

      taosBenchmark -y

    taosBenchmark automatically creates the test database and the meters supertable inside that database. This supertable contains 10,000 subtables, named d0 to d9999, with each subtable containing 10,000 records. Each record includes the following four metrics:

    • ts (timestamp), ranging from 2017-07-14 10:40:00 000" to "2017-07-14 10:40:09 999
    • current
    • voltage
    • phase

    Each subtable also has the following two tags:

    • groupId, ranging from 1 to 10
    • location, indicating a city and state such as California.Campbell or California.Cupertino

    When the ingestion process is finished, taosBenchmark outputs the time taken to ingest the specified sample data. From this, you can estimate how TDengine would perform on your system in a production environment.

    Test Data Querying

    After inserting data with taosBenchmark as described above, you can use the TDengine CLI to test TDengine's query performance on your machine:

    1. Start the TDengine CLI:

      taos
    2. Query the total number of records in the meters supertable:

      SELECT COUNT(*) FROM test.meters;
    3. Query the average, maximum, and minimum values of 100 million records:

      SELECT AVG(current), MAX(voltage), MIN(phase) FROM test.meters;
    4. Query the total number of records where the value of the location tag is California.SanFrancisco:

      SELECT COUNT(*) FROM test.meters WHERE location = "California.SanFrancisco";
    5. Query the average, maximum, and minimum values of all records where the value of the groupId tag is 10:

      SELECT AVG(current), MAX(voltage), MIN(phase) FROM test.meters WHERE groupId = 10;
    6. Calculate the average, maximum, and minimum values for the d1001 table every 10 seconds:

      SELECT _wstart, AVG(current), MAX(voltage), MIN(phase) FROM test.d1001 INTERVAL(10s);