TDengine is an innovative big data processing product launched by Taos Data in the face of the rapid growth of the Internet of Things big data market and technical challenges. In addition to reading and writing performance, storage compression ability is strong, but also has the advantages of simple installation, low difficulty of operation. Today we will start from the common usage, to comb through the TDengine installation and configuration process.

Currently, the TDengine server supports only Linux X64 operating systems. CentOS 7.9 and Ubuntu 18.04 are recommended. Hardware platform supports X64 and ARM64. The client supports Windows X64 and Linux X64. The MAC version is still under development and will provide limited functionality for the development environment in the future.

Let’s take a look at the installation and deployment of TDengine from the perspective of four usage patterns.

1. Locally use stand-alone TDengine:

Step 1: Download the installation package: www.taosdata.com/cn/all-down… , one-click installation: www.taosdata.com/cn/all-down…

Step 2: After the installation is successful, run the systemctl start taosd command to start the TDengine service process. Run the systemctl status taosd command to check whether the service is working properly.

Now you can access and experience TDengine through TDengine’s command-line program taOS.

2. Stand-alone VERSION TDengine is used for remote client connection:

Step 1 Download and install the client and server respectively (ensure that the client and server versions are the same) : www.taosdata.com/cn/all-down… , installation: www.taosdata.com/cn/all-down…

Second, configure the correct FQDN parameters in the /etc/taos/taos. CFG file on the server (avoid using names such as localhost that easily exist in the hosts file on the client machine). Configure this parameter and the correct IP address in the hosts file (or DNS service) of the client.

Step 3, open TCP+UDP ports 6030-6040 and TCP ports 6041,6042.

Finally, run the systemctl start taosd + systemctl status taosd command to ensure that the service is started properly, and then run the taos -h FQDN (or IP address) command on the client to directly connect to the server.

You can see that there are two more steps in the separation of the TDengine server and client than there are in the native TDengine trial. In the spirit of knowing what you know, IT is highly recommended that you take a look at the design of the TDengine deployment module in the following article.

The configuration differences between the two environments can be summarized simply by this logic:

That is, under the general premise of normal network environment, only the above two factors can interfere with the connection of TDengine client — 1. Port configuration; 2. The FQDN mechanism.

Let’s start with port configuration rules:

TDengine requires the database server to ensure that at least ports 6030-6042 are open for both TCP and UDP. The purpose of each port is as follows:

As you can see, ports 6030-6034 are responsible for communication between the client and the server. Ports 6035-6040 are used for communication and data synchronization between multi-node clusters.

However, in order to cover both single-machine and cluster scenarios, we ask you to open TCP+UDP ports 6030-6040 and TCP ports 6041,6042. In order to minimize the occurrence of unexpected situations, we strongly recommend turning off the firewall first and configuring ports after the environment is set up.

Since there is no firewall involved in the standalone trial of TDengine, we do not need to configure TDengine port opening rules.

The second factor is FQDN:

The full Name of FQDN is Fully Qualified Domain Name. With the domain name relative, we temporarily translate perfect domain name better understand a bit.

Due to the foundation of the last article, the FQDN related principles and configuration of TDengine can be directly obtained through this article – how to thoroughly understand the CONCEPT of TDengine FQDN? This article will suffice.

Because the default value of the FQDN parameter is the local hostname, users can access TDengine directly from the client without any configuration in a standalone trial.

3. Remote client connection using cluster version TDengine:

First of all, we need to build a usable cluster, this link please strictly according to the “TDengine cluster Installation, management” guidance for operation, can ensure that nothing is wrong.

Finally, after the cluster is set up, make sure that the HOSTS file of the client adds the IP addresses and FQDN values of all cluster nodes to ensure that it can correctly resolve the IP addresses of each node. This allows clients to access and use TDengine’s cluster without any problems.

Finally, we comb the use of connectors

TDengine provides a variety of application development interfaces, including C/C++, Java, Python, Go, Node.js, C#, Rust, RESTful, etc., for users to develop applications quickly. For them, the ability of various connectors to access and use TDengine is a major concern.

The official document says: “When using connectors (other than RESTful) on another server to access the TDengine database, we need to install a client with the same version number as the server to enable the application driver (Linux file named libtaos.so, In Windows, taos.dll) is installed on the system. Otherwise, an error “unable to find corresponding library file” will occur when connecting.

Therefore, it is important not to overlook the fact that clients can access and use TDengine properly before your application can successfully use TDengine.

Some users who are unfamiliar with the application install the client, think it’s all right, and then go to the application’s connection configuration. Some users use taOS connections, check with “show Databases “or something like that, and decide what the connection configuration is. Both of the above are not rigorous, in the test must ensure that the SELECT and INSERT operations return the expected results, such as:

create table test (ts timestamp, value int );
insert into test values (now,1);
select * from test;
Copy the code

If the verification fails, go back to the preceding steps and perform troubleshooting based on the description. If it still does not work, please contact us through wechat technical Exchange group or Github, and we will do our best to help you. I sincerely hope that you can have a clear understanding of TDengine, after all, well started is half done.

After the verification is successful, users with application requirements can go to the official document TDengine Connectors to find the correct configuration of the corresponding connector as required.