未验证 提交 ae84aae0 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Docs/sangshuduo/td 13307 add desc to index (#10318)

* [TD-13307]<docs>: add description to docs index.

* fix the link of how to use taosBenchmark

* fix wrong links

* fix markdown format

* refine getting started section
上级 f0292723
# TDengine 安装包的安装和卸载
TDengine 开源版本提供 deb 和 rpm 格式安装包,用户可以根据自己的运行环境选择合适的安装包。其中 deb 支持 Debian/Ubuntu 等系统,rpm 支持 CentOS/RHEL/SUSE 等系统。同时我们也为企业用户提供 tar.gz 格式安装包。
## deb 包的安装和卸载
### 安装 deb
1、从官网下载获得deb安装包,比如TDengine-server-2.0.0.0-Linux-x64.deb;
2、进入到TDengine-server-2.0.0.0-Linux-x64.deb安装包所在目录,执行如下的安装命令:
```
plum@ubuntu:~/git/taosv16$ sudo dpkg -i TDengine-server-2.0.0.0-Linux-x64.deb
Selecting previously unselected package tdengine.
(Reading database ... 233181 files and directories currently installed.)
Preparing to unpack TDengine-server-2.0.0.0-Linux-x64.deb ...
Failed to stop taosd.service: Unit taosd.service not loaded.
Stop taosd service success!
Unpacking tdengine (2.0.0.0) ...
Setting up tdengine (2.0.0.0) ...
Start to install TDEngine...
Synchronizing state of taosd.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable taosd
insserv: warning: current start runlevel(s) (empty) of script `taosd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `taosd' overrides LSB defaults (0 1 6).
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
TDengine is installed successfully!
```
注:当安装第一个节点时,出现 Enter FQDN:提示的时候,不需要输入任何内容。只有当安装第二个或以后更多的节点时,才需要输入已有集群中任何一个可用节点的 FQDN,支持该新节点加入集群。当然也可以不输入,而是在新节点启动前,配置到新节点的配置文件中。
后续两种安装包也是同样的操作。
### 卸载 deb
卸载命令如下:
```
plum@ubuntu:~/git/tdengine/debs$ sudo dpkg -r tdengine
(Reading database ... 233482 files and directories currently installed.)
Removing tdengine (2.0.0.0) ...
TDEngine is removed successfully!
```
## rpm包的安装和卸载
### 安装 rpm
1、从官网下载获得rpm安装包,比如TDengine-server-2.0.0.0-Linux-x64.rpm;
2、进入到TDengine-server-2.0.0.0-Linux-x64.rpm安装包所在目录,执行如下的安装命令:
```
[root@bogon x86_64]# rpm -iv TDengine-server-2.0.0.0-Linux-x64.rpm
Preparing packages...
TDengine-2.0.0.0-3.x86_64
Start to install TDEngine...
Created symlink from /etc/systemd/system/multi-user.target.wants/taosd.service to /etc/systemd/system/taosd.service.
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
TDengine is installed successfully!
```
### 卸载 rpm
卸载命令如下:
```
[root@bogon x86_64]# rpm -e tdengine
TDEngine is removed successfully!
```
## tar.gz 格式安装包的安装和卸载
### 安装 tar.gz 安装包
1、从官网下载获得tar.gz安装包,比如TDengine-server-2.0.0.0-Linux-x64.tar.gz;
2、进入到TDengine-server-2.0.0.0-Linux-x64.tar.gz安装包所在目录,先解压文件后,进入子目录,执行其中的install.sh安装脚本:
```
plum@ubuntu:~/git/tdengine/release$ sudo tar -xzvf TDengine-server-2.0.0.0-Linux-x64.tar.gz
plum@ubuntu:~/git/tdengine/release$ ll
total 3796
drwxr-xr-x 3 root root 4096 Aug 9 14:20 ./
drwxrwxr-x 11 plum plum 4096 Aug 8 11:03 ../
drwxr-xr-x 5 root root 4096 Aug 8 11:03 TDengine-server/
-rw-r--r-- 1 root root 3871844 Aug 8 11:03 TDengine-server-2.0.0.0-Linux-x64.tar.gz
plum@ubuntu:~/git/tdengine/release$ cd TDengine-server/
plum@ubuntu:~/git/tdengine/release/TDengine-server$ ll
total 2640
drwxr-xr-x 5 root root 4096 Aug 8 11:03 ./
drwxr-xr-x 3 root root 4096 Aug 9 14:20 ../
drwxr-xr-x 5 root root 4096 Aug 8 11:03 connector/
drwxr-xr-x 2 root root 4096 Aug 8 11:03 driver/
drwxr-xr-x 8 root root 4096 Aug 8 11:03 examples/
-rwxr-xr-x 1 root root 13095 Aug 8 11:03 install.sh*
-rw-r--r-- 1 root root 2651954 Aug 8 11:03 taos.tar.gz
plum@ubuntu:~/git/tdengine/release/TDengine-server$ sudo ./install.sh
This is ubuntu system
verType=server interactiveFqdn=yes
Start to install TDengine...
Synchronizing state of taosd.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable taosd
insserv: warning: current start runlevel(s) (empty) of script `taosd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `taosd' overrides LSB defaults (0 1 6).
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :hostname.taosdata.com:7030
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
Please run: taos -h hostname.taosdata.com:7030 to login into cluster, then execute : create dnode 'newDnodeFQDN:port'; in TAOS shell to add this new node into the clsuter
TDengine is installed successfully!
```
说明:install.sh 安装脚本在执行过程中,会通过命令行交互界面询问一些配置信息。如果希望采取无交互安装方式,那么可以用 -e no 参数来执行 install.sh 脚本。运行 ./install.sh -h 指令可以查看所有参数的详细说明信息。
### tar.gz 安装后的卸载
卸载命令如下:
```
plum@ubuntu:~/git/tdengine/release/TDengine-server$ rmtaos
TDEngine is removed successfully!
```
## 安装目录说明
TDengine成功安装后,主安装目录是/usr/local/taos,目录内容如下:
```
plum@ubuntu:/usr/local/taos$ cd /usr/local/taos
plum@ubuntu:/usr/local/taos$ ll
total 36
drwxr-xr-x 9 root root 4096 7月 30 19:20 ./
drwxr-xr-x 13 root root 4096 7月 30 19:20 ../
drwxr-xr-x 2 root root 4096 7月 30 19:20 bin/
drwxr-xr-x 2 root root 4096 7月 30 19:20 cfg/
lrwxrwxrwx 1 root root 13 7月 30 19:20 data -> /var/lib/taos/
drwxr-xr-x 2 root root 4096 7月 30 19:20 driver/
drwxr-xr-x 8 root root 4096 7月 30 19:20 examples/
drwxr-xr-x 2 root root 4096 7月 30 19:20 include/
drwxr-xr-x 2 root root 4096 7月 30 19:20 init.d/
lrwxrwxrwx 1 root root 13 7月 30 19:20 log -> /var/log/taos/
```
- 自动生成配置文件目录、数据库目录、日志目录。
- 配置文件缺省目录:/etc/taos/taos.cfg, 软链接到/usr/local/taos/cfg/taos.cfg;
- 数据库缺省目录:/var/lib/taos, 软链接到/usr/local/taos/data;
- 日志缺省目录:/var/log/taos, 软链接到/usr/local/taos/log;
- /usr/local/taos/bin目录下的可执行文件,会软链接到/usr/bin目录下;
- /usr/local/taos/driver目录下的动态库文件,会软链接到/usr/lib目录下;
- /usr/local/taos/include目录下的头文件,会软链接到到/usr/include目录下;
## 卸载和更新文件说明
卸载安装包的时候,将保留配置文件、数据库文件和日志文件,即 /etc/taos/taos.cfg 、 /var/lib/taos 、 /var/log/taos 。如果用户确认后不需保留,可以手工删除,但一定要慎重,因为删除后,数据将永久丢失,不可以恢复!
如果是更新安装,当缺省配置文件( /etc/taos/taos.cfg )存在时,仍然使用已有的配置文件,安装包中携带的配置文件修改为taos.cfg.org保存在 /usr/local/taos/cfg/ 目录,可以作为设置配置参数的参考样例;如果不存在配置文件,就使用安装包中自带的配置文件。
## 注意事项
- TDengine提供了多种安装包,但最好不要在一个系统上同时使用 tar.gz 安装包和 deb 或 rpm 安装包。否则会相互影响,导致在使用时出现问题。
- 对于deb包安装后,如果安装目录被手工误删了部分,出现卸载、或重新安装不能成功。此时,需要清除 tdengine 包的安装信息,执行如下命令:
```
plum@ubuntu:~/git/tdengine/$ sudo rm -f /var/lib/dpkg/info/tdengine*
```
然后再重新进行安装就可以了。
- 对于rpm包安装后,如果安装目录被手工误删了部分,出现卸载、或重新安装不能成功。此时,需要清除tdengine包的安装信息,执行如下命令:
```
[root@bogon x86_64]# rpm -e --noscripts tdengine
```
然后再重新进行安装就可以了。
......@@ -2,18 +2,15 @@
## <a class="anchor" id="install"></a>快捷安装
TDengine 软件分为服务器、客户端,目前 2.0 版服务器仅能在 Linux 系统上安装和运行,后续会支持 Windows、Mac OS 等系统。客户端可以在 Windows 或 Linux 上安装和运行。任何 OS 的应用也可以选择 RESTful 接口连接服务器 taosd,其中 2.4 之后版本默认使用单独运行的独立组件 taosAdapter 提供 http 服务,之前版本使用内置 http 服务。支持 X64/ARM64/MIPS64/Alpha64,后续会支持 ARM32、RISC-V 等 CPU 架构。用户可根据需求选择通过 [源码](https://www.taosdata.com/getting-started/#source-install) 或者 [安装包](https://www.taosdata.com/getting-started/#package-install) 来安装
TDengine 包括服务器、客户端和周边生态工具软件,目前 2.0 版服务器仅能在 Linux 系统上安装和运行,后续将支持 Windows、Mac OS 等系统。客户端可以在 Windows 或 Linux 上安装和运行。在任何操作系统上的应用都可以使用 RESTful 接口连接服务器 taosd,其中 2.4 之后版本默认使用单独运行的独立组件 taosAdapter 提供 http 服务和更多数据写入方式。taosAdapter 需要手动启动。而之前版本 TDengine 使用内置 http 服务
* 查看完整的Release notes,请点击[这里](https://github.com/taosdata/TDengine/releases)
* 下载其他组件、最新beta版及之前版本的安装包,请点击[这里](https://www.taosdata.com/cn/all-downloads/)
TDengine 支持 X64/ARM64/MIPS64/Alpha64 硬件平台,后续将支持 ARM32、RISC-V 等 CPU 架构。
### <a class="anchor" id="source-install"></a>通过源码安装
请参考我们的 [TDengine github 主页](https://github.com/taosdata/TDengine) 下载源码并安装.
### 通过 Docker 容器运行
暂时不建议生产环境采用 Docker 来部署 TDengine 的客户端或服务端,但在开发环境下或初次尝试时,使用 Docker 方式部署是十分方便的。特别是,利用 Docker,可以方便地在 Mac OS X 和 Windows 环境下尝试 TDengine。
### 通过 Docker 容器运行 TDengine
```
docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengine
......@@ -21,65 +18,59 @@ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengin
详细操作方法请参照 [通过 Docker 快速体验 TDengine](https://www.taosdata.com/cn/documentation/getting-started/docker)
注:暂时不建议生产环境采用 Docker 来部署 TDengine 的客户端或服务端,但在开发环境下或初次尝试时,使用 Docker 方式部署是十分方便的。特别是,利用 Docker,可以方便地在 Mac OS X 和 Windows 环境下尝试 TDengine。
### <a class="anchor" id="package-install"></a>通过安装包安装
TDengine 的安装非常简单,从下载到安装成功仅仅只要几秒钟。为方便使用,标准的服务端安装包包含了客户端程序、各种编程语言的连接器和示例代码;如果您只需要用到服务端程序和客户端连接的 C/C++ 语言支持,那么也可以仅下载 lite 版本的安装包。在安装包格式上,我们提供 rpm、deb、tar.gz 三种,以方便在特定操作系统上使用。版本还分稳定版和Beta版,Beta版含有更多新功能,正式上线或测试,建议安装稳定版。您可以根据需要选择下载:
TDengine 的安装非常简单,从下载到安装成功仅仅只要几秒钟。为方便使用,标准的服务端安装包包含了客户端程序和示例代码;如果您只需要用到服务端程序和客户端连接的 C/C++ 语言支持,也可以仅下载 lite 版本的安装包。在安装包格式上,我们提供 rpm 和 deb 格式,也为企业客户提供 tar.gz 格式安装包,以方便在特定操作系统上使用。发布版本包括稳定版和 Beta 版,Beta版含有更多新功能。正式上线或测试建议安装稳定版。您可以根据需要选择下载:
<ul id="server-packageList" class="package-list"></ul>
具体的安装过程,请参见 [TDengine 多种安装包的安装和卸载](https://www.taosdata.com/blog/2019/08/09/566.html) 以及 [视频教程](https://www.taosdata.com/blog/2020/11/11/1941.html)
## <a class="anchor" id="taosBenchmark"></a> taosBenchmark 详细功能列表
具体的安装过程,请参见 [TDengine 多种安装包的安装和卸载](https://www.taosdata.com/cn/documentation/install) 以及 [视频教程](https://www.taosdata.com/blog/2020/11/11/1941.html)
taosBenchmark (曾命名 taosdemo)命令本身带有很多选项,配置表的数目、记录条数等等,请执行 `taosBenchmark --help` 详细列出。您可以设置不同参数进行体验。
taosBenchmark 详细使用方法请参照 [如何使用taosBenchmark对TDengine进行性能测试](https://www.taosdata.com/2021/10/09/3111.html)
## 仅安装客户端
## 客户端
如果客户端和服务端运行在不同的电脑上,可以单独安装客户端。下载时请注意,所选择的客户端版本号应该和在上面下载的服务端版本号严格匹配。Linux 和 Windows 安装包如下(其中 lite 版本的安装包仅带有 C/C++ 语言的连接支持,而标准版本的安装包还包含和示例代码):
如果客户端和服务端运行在不同的电脑上,可以单独安装客户端。下载时请注意,所选择的客户端版本号应该和在上面下载的服务端版本号精确匹配。Linux 和 Windows 安装包如下(其中 lite 版本的安装包仅带有 C/C++ 语言的连接支持,而标准版本的安装包还包含 Java、Python、Go、Node.js 等编程语言的连接器支持和示例代码):
<ul id="client-packagelist" class="package-list"></ul>
## taosTools
taosTools 是多个用于 TDengine 的辅助工具软件集合。
推荐下载 deb 或 rpm 安装包,方便安装依赖软件。如果使用 tar.gz 格式安装包,需要自行安装依赖包。其中:
taosTools 是多个用于 TDengine 的辅助工具软件集合。目前包含用于数据备份恢复的 taosdump 和用于安装 grafanaplugin 和 dashboard 的脚本 TDinsight.sh。
* Debian/Ubuntu 系统需要安装 libjansson4 和 libsnappy1v5
* CentOS/RHEL 系统需要安装 jansson 和 snappy
以及 TDengine server 或 TDengine client 安装包
运行 taosdump 需要安装 TDengine server 或 TDengine client 安装包,推荐使用 deb 或 rpm 格式安装包,方便安装依赖软件。
<ul id="taos-tools" class="package-list"></ul>
## 使用 apt-get 安装
如果使用 Debian 或 Ubuntu 系统,也可以使用 apt-get 从官方仓库安装,设置方法为:
如果使用 Debian 或 Ubuntu 系统,也可以使用 apt-get 工具从官方仓库安装,设置方法为:
```
wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add -
echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-stable stable main" | sudo tee /etc/apt/sources.list.d/tdengine-stable.list
[ beta 版安装包仓库为可选安装项 ] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list
[ 如果安装 Beta 版需要安装包仓库 ] echo "deb [arch=amd64] http://repos.taosdata.com/tdengine-beta beta main" | sudo tee /etc/apt/sources.list.d/tdengine-beta.list
sudo apt-get update
apt-cache policy tdengine
sudo apt-get install tdengine
```
<a class="anchor" id="start"></a>
## 轻松启动
查看完整的 Release notes,请点击[这里](https://github.com/taosdata/TDengine/releases)
下载其他组件、最新 Beta 版及之前版本的安装包,请点击[这里](https://www.taosdata.com/cn/all-downloads/)
## <a class="anchor" id="start"></a>轻松启动
安装成功后,用户可使用 `systemctl` 命令来启动 TDengine 的服务进程。
```bash
$ systemctl start taosd
systemctl start taosd
```
检查服务是否正常工作:
```bash
$ systemctl status taosd
systemctl status taosd
```
如果 TDengine 服务正常工作,那么您可以通过 TDengine 的命令行程序 `taos` 来访问并体验 TDengine。
......@@ -91,30 +82,29 @@ $ systemctl status taosd
- TDengine 采用 FQDN (一般就是 hostname )作为节点的 ID,为保证正常运行,需要给运行 taosd 的服务器配置好 hostname,在客户端应用运行的机器配置好 DNS 服务或 hosts 文件,保证 FQDN 能够解析。
- `systemctl stop taosd` 指令在执行后并不会马上停止 TDengine 服务,而是会等待系统中必要的落盘工作正常完成。在数据量很大的情况下,这可能会消耗较长时间。
* TDengine 支持在使用 [`systemd`](https://en.wikipedia.org/wiki/Systemd) 做进程服务管理的 Linux 系统上安装,用 `which systemctl` 命令来检测系统中是否存在 `systemd` 包:
TDengine 支持在使用 [`systemd`](https://en.wikipedia.org/wiki/Systemd) 做进程服务管理的 Linux 系统上安装,用 `which systemctl` 命令来检测系统中是否存在 `systemd` 包:
```bash
$ which systemctl
which systemctl
```
如果系统中不支持 `systemd`,也可以用手动运行 /usr/local/taos/bin/taosd 方式启动 TDengine 服务。
<a class="anchor" id="console"></a>
## TDengine 命令行程序
## <a class="anchor" id="console"></a>使用 TDengine 客户端程序
执行 TDengine 命令行程序,您只要在 Linux 终端执行 `taos` 即可。
执行 TDengine 客户端程序,您只要在 Linux 终端执行 `taos` 即可。
```bash
$ taos
taos
```
如果 TDengine 终端连接服务成功,将会打印出欢迎消息和版本信息。如果失败,则会打印错误消息出来(请参考 [FAQ](https://www.taosdata.com/cn/documentation/faq/) 来解决终端连接服务端失败的问题)。TDengine 终端的提示符号如下:
如果连接服务成功,将会打印出欢迎消息和版本信息。如果失败,则会打印错误消息出来(请参考 [FAQ](https://www.taosdata.com/cn/documentation/faq/) 来解决终端连接服务端失败的问题)。客户端的提示符号如下:
```cmd
taos>
```
在 TDengine 端中,用户可以通过 SQL 命令来创建/删除数据库、表等,并进行插入查询操作。在终端中运行的 SQL 语句需要以分号结束来运行。示例:
在 TDengine 客户端中,用户可以通过 SQL 命令来创建/删除数据库、表等,并进行插入查询操作。在终端中运行的 SQL 语句需要以分号结束来运行。示例:
```mysql
create database demo;
......@@ -130,11 +120,11 @@ select * from t;
Query OK, 2 row(s) in set (0.003128s)
```
除执行 SQL 语句外,系统管理员还可以从 TDengine 端进行检查系统运行状态、添加删除用户账号等操作。
除执行 SQL 语句外,系统管理员还可以从 TDengine 客户端进行检查系统运行状态、添加删除用户账号等操作。
### 命令行参数
您可通过配置命令行参数来改变 TDengine 端的行为。以下为常用的几个命令行参数:
您可通过配置命令行参数来改变 TDengine 客户端的行为。以下为常用的几个命令行参数:
- -c, --config-dir: 指定配置文件目录,默认为 `/etc/taos`
- -h, --host: 指定服务的 FQDN 地址或 IP 地址,默认为连接本地服务
......@@ -146,7 +136,7 @@ Query OK, 2 row(s) in set (0.003128s)
示例:
```bash
$ taos -h h1.taos.com -s "use db; show tables;"
taos -h h1.taos.com -s "use db; show tables;"
```
### 运行 SQL 命令脚本
......@@ -168,15 +158,25 @@ taos> source <filename>;
## <a class="anchor" id="demo"></a>TDengine 极速体验
启动 TDengine 的服务,在 Linux 终端执行 taosBenchmark (曾命名为 taosdemo,在 2.4 之后的版本请按照独立的 taosTools 软件包):
### <a class="anchor" id="taosBenchmark"></a> 使用 taosBenchmark 体验写入速度
启动 TDengine 的服务,在 Linux 终端执行 `taosBenchmark` (曾命名为 taosdemo):
```bash
$ taosBenchmark
taosBenchmark
```
该命令将在数据库 test 下面自动创建一张超级表 meters,该超级表下有 1 万张表,表名为 "d0" 到 "d9999",每张表有 1 万条记录,每条记录有 (ts, current, voltage, phase) 四个字段,时间戳从 "2017-07-14 10:40:00 000" 到 "2017-07-14 10:40:09 999",每张表带有标签 location 和 groupId,groupId 被设置为 1 到 10, location 被设置为 "beijing" 或者 "shanghai"。
执行这条命令大概需要几分钟,最后共插入 1 亿条记录。
这条命令很快完成 1 亿条记录的插入。具体时间取决于硬件性能,即使在一台普通的 PC 服务器往往也仅需十几秒。
#### taosBenchmark 详细功能列表
taosBenchmark 命令本身带有很多选项,配置表的数目、记录条数等等,请执行 `taosBenchmark --help` 详细列出。您可以设置不同参数进行体验。
taosBenchmark 详细使用方法请参照 [如何使用taosBenchmark对TDengine进行性能测试](https://www.taosdata.com/2021/10/09/3111.html)
### <a class="anchor" id="taosshell"></a> 使用 taos shell 体验查询速度
在 TDengine 客户端输入查询命令,体验查询速度。
......@@ -209,7 +209,6 @@ taos> select avg(current), max(voltage), min(phase) from test.meters where group
```mysql
taos> select avg(current), max(voltage), min(phase) from test.d10 interval(10s);
```
## <a class="anchor" id="platforms"></a>支持平台列表
......
# Quickly experience TDengine with Docker
# Quickly Taste TDengine with Docker
While it is not recommended to deploy TDengine services via Docker in a production environment, Docker tools do a good job of shielding the environmental differences in the underlying operating system and are well suited for use in development testing or first-time experience with the toolset for installing and running TDengine. In particular, Docker makes it relatively easy to try TDengine on Mac OSX and Windows systems without having to install a virtual machine or rent an additional Linux server. In addition, starting from version 2.0.14.0, TDengine provides images that support both X86-64, X86, arm64, and arm32 platforms, so non-mainstream computers that can run docker, such as NAS, Raspberry Pi, and embedded development boards, can also easily experience TDengine based on this document.
While it is not recommended to deploy TDengine services via Docker in a production environment, Docker tools do a good job of shielding the environmental differences in the underlying operating system and are well suited for use in development testing or first-time taste with the toolset for installing and running TDengine. In particular, Docker makes it relatively easy to try TDengine on Mac OSX and Windows systems without having to install a virtual machine or rent an additional Linux server. In addition, starting from version 2.0.14.0, TDengine provides images that support both X86-64, X86, arm64, and arm32 platforms, so non-mainstream computers that can run docker, such as NAS, Raspberry Pi, and embedded development boards, can also easily taste TDengine based on this document.
The following article explains how to quickly build a single-node TDengine runtime environment via Docker to support development and testing through a Step by Step style introduction.
......
# How to install/uninstall TDengine with installtion package
TDengine open source version provides `deb` and `rpm` format installation packages. Our users can choose the appropriate installation package according to their own running environment. The `deb` supports Debian/Ubuntu etc. and the `rpm` supports CentOS/RHEL/SUSE etc. We also provide `tar.gz` format installers for enterprise users.
## Install and uninstall deb package
### Install deb package
- Download and obtain the deb installation package from the official website, such as TDengine-server-2.0.0.0-Linux-x64.deb.
- Go to the directory where the TDengine-server-2.0.0.0-Linux-x64.deb installation package is located and execute the following installation command.
```
plum@ubuntu:~/git/taosv16$ sudo dpkg -i TDengine-server-2.0.0.0-Linux-x64.deb
Selecting previously unselected package tdengine.
(Reading database ... 233181 files and directories currently installed.)
Preparing to unpack TDengine-server-2.0.0.0-Linux-x64.deb ...
Failed to stop taosd.service: Unit taosd.service not loaded.
Stop taosd service success!
Unpacking tdengine (2.0.0.0) ...
Setting up tdengine (2.0.0.0) ...
Start to install TDEngine...
Synchronizing state of taosd.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable taosd
insserv: warning: current start runlevel(s) (empty) of script `taosd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `taosd' overrides LSB defaults (0 1 6).
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
TDengine is installed successfully!
```
Note: When the Enter FQDN: prompt appears when the first node is installed, nothing needs to be entered. Only when installing the second or later more nodes is it necessary to enter the FQDN of any of the available nodes in the existing cluster to support that new node joining the cluster. It is of course possible to not enter it, but to configure it into the new node's configuration file before the new node starts
in the configuration file of the new node before it starts.
The same operation is performed for the other installation packages format.
### Uninstall deb
Uninstall command is below:
```
plum@ubuntu:~/git/tdengine/debs$ sudo dpkg -r tdengine
(Reading database ... 233482 files and directories currently installed.)
Removing tdengine (2.0.0.0) ...
TDEngine is removed successfully!
```
## Install and unstall rpm package
### Install rpm
- Download and obtain the rpm installation package from the official website, such as TDengine-server-2.0.0.0-Linux-x64.rpm.
- Go to the directory where the TDengine-server-2.0.0.0-Linux-x64.rpm installation package is located and execute the following installation command.
```
[root@bogon x86_64]# rpm -iv TDengine-server-2.0.0.0-Linux-x64.rpm
Preparing packages...
TDengine-2.0.0.0-3.x86_64
Start to install TDEngine...
Created symlink from /etc/systemd/system/multi-user.target.wants/taosd.service to /etc/systemd/system/taosd.service.
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
TDengine is installed successfully!
```
### Uninstall rpm
Uninstall command is following:
```
[root@bogon x86_64]# rpm -e tdengine
TDEngine is removed successfully!
```
## Install and uninstall tar.gz
### Install tar.gz
- Download and obtain the tar.gz installation package from the official website, such as `TDengine-server-2.0.0.0-Linux-x64.tar.gz`.
- Go to the directory where the `TDengine-server-2.0.0.0-Linux-x64.tar.gz` installation package is located, unzip the file first, then enter the subdirectory and execute the install.sh installation script in it as follows
```
plum@ubuntu:~/git/tdengine/release$ sudo tar -xzvf TDengine-server-2.0.0.0-Linux-x64.tar.gz
plum@ubuntu:~/git/tdengine/release$ ll
total 3796
drwxr-xr-x 3 root root 4096 Aug 9 14:20 ./
drwxrwxr-x 11 plum plum 4096 Aug 8 11:03 ../
drwxr-xr-x 5 root root 4096 Aug 8 11:03 TDengine-server/
-rw-r--r-- 1 root root 3871844 Aug 8 11:03 TDengine-server-2.0.0.0-Linux-x64.tar.gz
plum@ubuntu:~/git/tdengine/release$ cd TDengine-server/
plum@ubuntu:~/git/tdengine/release/TDengine-server$ ll
total 2640
drwxr-xr-x 5 root root 4096 Aug 8 11:03 ./
drwxr-xr-x 3 root root 4096 Aug 9 14:20 ../
drwxr-xr-x 5 root root 4096 Aug 8 11:03 connector/
drwxr-xr-x 2 root root 4096 Aug 8 11:03 driver/
drwxr-xr-x 8 root root 4096 Aug 8 11:03 examples/
-rwxr-xr-x 1 root root 13095 Aug 8 11:03 install.sh*
-rw-r--r-- 1 root root 2651954 Aug 8 11:03 taos.tar.gz
plum@ubuntu:~/git/tdengine/release/TDengine-server$ sudo ./install.sh
This is ubuntu system
verType=server interactiveFqdn=yes
Start to install TDengine...
Synchronizing state of taosd.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable taosd
insserv: warning: current start runlevel(s) (empty) of script `taosd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `taosd' overrides LSB defaults (0 1 6).
Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join OR leave it blank to build one :hostname.taosdata.com:7030
To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine : sudo systemctl start taosd
To access TDengine : use taos in shell
Please run: taos -h hostname.taosdata.com:7030 to login into cluster, then execute : create dnode 'newDnodeFQDN:port'; in TAOS shell to add this new node into the clsuter
TDengine is installed successfully!
```
Note: The install.sh install script asks for some configuration information through an interactive command line interface during execution. If you prefer a non-interactive installation, you can execute the install.sh script with the -e no parameter. Run . /install.sh -h command to see detailed information about all parameters.
### Uninstall TDengine after tar.gz package installed
Uninstall command is following:
```
plum@ubuntu:~/git/tdengine/release/TDengine-server$ rmtaos
TDEngine is removed successfully!
```
## Installation directory description
After TDengine is successfully installed, the main installation directory is /usr/local/taos, and the directory contents are as follows:
```
plum@ubuntu:/usr/local/taos$ cd /usr/local/taos
plum@ubuntu:/usr/local/taos$ ll
total 36
drwxr-xr-x 9 root root 4096 7 30 19:20 ./
drwxr-xr-x 13 root root 4096 7 30 19:20 ../
drwxr-xr-x 2 root root 4096 7 30 19:20 bin/
drwxr-xr-x 2 root root 4096 7 30 19:20 cfg/
lrwxrwxrwx 1 root root 13 7 30 19:20 data -> /var/lib/taos/
drwxr-xr-x 2 root root 4096 7 30 19:20 driver/
drwxr-xr-x 8 root root 4096 7 30 19:20 examples/
drwxr-xr-x 2 root root 4096 7 30 19:20 include/
drwxr-xr-x 2 root root 4096 7 30 19:20 init.d/
lrwxrwxrwx 1 root root 13 7 30 19:20 log -> /var/log/taos/
```
- Automatically generates the configuration file directory, database directory, and log directory.
- Configuration file default directory: /etc/taos/taos.cfg, softlinked to /usr/local/taos/cfg/taos.cfg.
- Database default directory: /var/lib/taos, softlinked to /usr/local/taos/data.
- Log default directory: /var/log/taos, softlinked to /usr/local/taos/log.
- executables in the /usr/local/taos/bin directory, which are soft-linked to the /usr/bin directory.
- Dynamic library files in the /usr/local/taos/driver directory, which are soft-linked to the /usr/lib directory.
- header files in the /usr/local/taos/include directory, which are soft-linked to the /usr/include directory.
## Uninstall and update file instructions
When uninstalling the installation package, the configuration files, database files and log files will be kept, i.e. /etc/taos/taos.cfg, /var/lib/taos, /var/log/taos. If users confirm that they do not need to keep them, they can delete them manually, but must be careful, because after deletion, the data will be permanently lost and cannot be recovered!
If the installation is updated, when the default configuration file (/etc/taos/taos.cfg) exists, the existing configuration file is still used. The configuration file carried in the installation package is modified to taos.cfg.org and saved in the /usr/local/taos/cfg/ directory, which can be used as a reference sample for setting configuration parameters; if the configuration file does not exist, the Use the configuration file that comes with the installation package
file that comes with the installation package.
## Caution
- TDengine provides several installers, but it is best not to use both the tar.gz installer and the deb or rpm installer on one system. Otherwise, they may affect each other and cause problems when using them.
- For deb package installation, if the installation directory is manually deleted by mistake, the uninstallation, or reinstallation cannot be successful. In this case, you need to clear the installation information of the tdengine package by executing the following command:
```
plum@ubuntu:~/git/tdengine/$ sudo rm -f /var/lib/dpkg/info/tdengine*
```
Then just reinstall it.
- For the rpm package after installation, if the installation directory is manually deleted by mistake part of the uninstallation, or reinstallation can not be successful. In this case, you need to clear the installation information of the tdengine package by executing the following command:
```
[root@bogon x86_64]# rpm -e --noscripts tdengine
```
Then just reinstall it.
......@@ -2,31 +2,50 @@
## <a class="anchor" id="install"></a>Quick Install
TDengine software consists of 3 parts: server, client, and alart module. At the moment, TDengine server only runs on Linux (Windows, mac OS and more OS supports will come soon), but client can run on either Windows or Linux. TDengine client can be installed and run on Windows or Linux. Applications based-on any OSes can all connect to server taosd via a RESTful interface. From 2.4 and later version, TDengine use a stand-alone software, taosAdapteer to provide http service. The early version uses the http server embedded in the taosd. About CPU, TDengine supports X64/ARM64/MIPS64/Alpha64, and ARM32、RISC-V, other more CPU architectures will be supported soon. You can set up and install TDengine server either from the [source code](https://www.taosdata.com/en/getting-started/#Install-from-Source) or the [packages](https://www.taosdata.com/en/getting-started/#Install-from-Package).
TDengine includes server, client and ecological software and peripheral tools. Currently, version 2.0 of the server can only be installed and run on Linux, and will support Windows, Mac OS and other systems in future. The client can be installed and run on Windows or Linux. Applications on any operating system can use the RESTful interface to connect to the taosd server. After 2.4, TDengine includes taosAdapter to provide an easy-to-use and efficient way to ingest data including RESTful service. taosAdapter needs to be started manually as a stand-alone compoent. Early version use embedded http component to provide RESTful interface.
TDengine supports X64/ARM64/MIPS64/Alpha64 hardware platforms and will support ARM32, RISC-V and other CPU architectures in the future.
### <a class="anchor" id="source-install"></a>Install from Source
Please visit our [TDengine github page](https://github.com/taosdata/TDengine) for instructions on installation from the source code.
### Install from Docker Container
For the time being, it is not recommended to use Docker to deploy the client or server side of TDengine in production environments, but it is convenient to use Docker to deploy in development environments or when trying it for the first time. In particular, with Docker, it is easy to try TDengine in Mac OS X and Windows environments.
### Run TDengine with Docker Container
```
docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp tdengine/tdengine
```
Please refer to [Quickly experience TDengine with Docker](https://www.taosdata.com/en/documentation/getting-started/docker) for the details.
Please refer to [Quickly Taste TDengine with Docker](https://www.taosdata.com/en/documentation/getting-started/docker) for the details.
For the time being, it is not recommended to use Docker to deploy the client or server side of TDengine for production environments, but it is a convenient way to deploy TDengine for development purpose. In particular, it is easy to try TDengine in Mac OS X and Windows environments with Docker.
### <a class="anchor" id="package-install"></a>Install from Package
Three different packages for TDengine server are provided, please pick up the one you like. (Lite packages only have execution files and connector of C/C++, but standard packages support connectors of nearly all programming languages.) Beta version has more features, but we suggest you to install stable version for production or testing.
TDengine is very easy to install, from download to successful installation in just a few seconds. For ease of use, the standard server installation package includes the client application and sample code; if you only need the server application and C/C++ language support for the client connection, you can also download the lite version of the installation package only. The installation packages are available in rpm and deb formats, as well as tar.gz format for enterprise customers to facilitate use on specific operating systems. Releases include both stable and Beta versions, with the Beta version containing more new features. It is recommended to install the stable version for official launch or testing. You can choose to download from following as needed:
<ul id="server-packageList" class="package-list"></ul>
For details of the installation process, please refer to [Installation and Uninstallation of TDengine Multiple Installers](https://www.taosdata.com/en/documentation/install).
## Install TDengine client only
Click [here](https://www.taosdata.com/en/getting-started/#Install-from-Package) to download the install package.
If the client and server are running on different computers, you can install the client separately. When downloading, please note that the selected client version number should strictly match the server version number downloaded above. Linux and Windows installation packages are as follows (the lite version of the installer comes with connection support for the C/C++ language only, while the standard version of the installer also contains
and sample code):
<ul id="client-packagelist" class="package-list"></ul>
## Install taosTools
taosTools is a collection of helper software for TDengine. It currently includes taosdump for data backup and recovery and the script TDinsight.sh for installing grafanaplugin and dashboard.
To run taosdump, you need to install the TDengine server or TDengine client installer. It is recommended to use the deb or rpm format to install the dependent software.
<ul id="taos-tools" class="package-list"></ul>
### Install TDengine by apt-get
If you use Debian or Ubuntu system you can use 'apt-get' command to install TDengine from official repository. Please use following commands to setup:
If you use Debian or Ubuntu system you can use `apt-get` command to install TDengine from the official repository. Please use following commands to setup:
```
wget -qO - http://repos.taosdata.com/tdengine.key | sudo apt-key add -
......@@ -42,13 +61,13 @@ sudo apt-get install tdengine
After installation, you can start the TDengine service by the `systemctl` command.
```bash
$ systemctl start taosd
systemctl start taosd
```
Then check if the service is working now.
```bash
$ systemctl status taosd
systemctl status taosd
```
If the service is running successfully, you can play around through TDengine shell `taos`.
......@@ -61,7 +80,7 @@ If the service is running successfully, you can play around through TDengine she
- TDengine supports installation on Linux systems with [systemd](https://en.wikipedia.org/wiki/Systemd) as the process service management, and uses `which systemctl` command to detect whether `systemd` packages exist in the system:
```bash
$ which systemctl
which systemctl
```
If `systemd` is not supported in the system, TDengine service can also be launched via `/usr/local/taos/bin/taosd` manually.
......@@ -71,7 +90,7 @@ If `systemd` is not supported in the system, TDengine service can also be launch
To launch TDengine shell, the command line interface, in a Linux terminal, type:
```bash
$ taos
taos
```
The welcome message is printed if the shell connects to TDengine server successfully, otherwise, an error message will be printed (refer to our [FAQ](https://www.taosdata.com/en/faq) page for troubleshooting the connection error). The TDengine shell prompt is:
......@@ -122,7 +141,7 @@ You can configure command parameters to change how TDengine shell executes. Some
Examples:
```bash
$ taos -h 192.168.0.1 -s "use db; show tables;"
taos -h 192.168.0.1 -s "use db; show tables;"
```
### Run SQL Command Scripts
......@@ -133,26 +152,36 @@ Inside TDengine shell, you can run SQL scripts in a file with source command.
taos> source <filename>;
```
### Shell Tips
### taos shell tips
- Use up/down arrow key to check the command history
- To change the default password, use "alter user" command
- Use ctrl+c to interrupt any queries
- To clean the schema of local cached tables, execute command `RESET QUERY CACHE`
## <a class="anchor" id="demo"></a>Experience TDengine’s Lightning Speed
## <a class="anchor" id="demo"></a>Taste TDengine’s Lightning Speed
### <a class="anchor" id="taosBenchmark"></a> Taste insertion speed with taosBenchmark
After starting the TDengine server, you can execute the command `taosBenchmark` (was named `taosdemo`, please install taosTools package if you use TDengine 2.4 or later version) in the Linux terminal.
Once the TDengine server started, you can execute the command `taosBenchmark` (was named `taosdemo`) in the Linux terminal.
```bash
$ taosBenchmark
taosBenchmark
```
Using this command, a STable named `meters` will be created in the database `test`. There are 10k tables under this STable, named from `t0` to `t9999`. In each table there are 100k rows of records, each row with columns (`f1`, `f2` and `f3`. The timestamp is from "2017-07-14 10:40:00 000" to "2017-07-14 10:41:39 999". Each table also has tags `areaid` and `loc`: `areaid` is set from 1 to 10, `loc` is set to "beijing" or "shanghai".
Using this command, a STable named `meters` will be created in the database `test`. There are 10k tables under this STable, named from `d0` to `d9999`. In each table there are 100k rows of records, each row with columns (`ts`, `current`, `voltage` and `phase`. The timestamp is from "2017-07-14 10:40:00 000" to "2017-07-14 10:41:39 999". Each table also has tags `location` and `groupId`: `groupId` is set from 1 to 10, `location` is set to "beijing" or "shanghai".
It takes about 10 minutes to execute this command. Once finished, 1 billion rows of records will be inserted.
Once execution finished, 1 billion rows of records will be inserted. It usually takes about donzen seconds to execute this command on a normal PC server but it may be different depends on the particular hardware platform performace.
In the TDengine client, enter sql query commands and then experience our lightning query speed.
### <a class="anchor" id="taosBenchmark"></a> Using taosBenchmark in detail
you can run command `taosBenchmark` with many options, like number of tables, rows of records and so on. To know more about these options, you can execute `taosBenchmark --help` and then take a try using different options.
For more details on how to use taosBenchmark, please refer to [How to use taosBenchmark to test the performance of TDengine](https://tdengine.com/2021/10/09/3114.html).
### <a class="anchor" id="taosshell"></a> Taste query speed with taos shell
In the TDengine client, enter sql query commands and then taste our lightning query speed.
- query total rows of records:
......@@ -184,11 +213,6 @@ taos> select avg(f1), max(f2), min(f3) from test.meters where areaid=10;
taos> select avg(f1), max(f2), min(f3) from test.t10 interval(10s);
```
### <a class="anchor" id="taosBenchmark"></a> Using taosBenchmark in detail
you can run command `taosBenchmark` with many options, like number of tables, rows of records and so on. To know more about these options, you can execute `taosBenchmark --help` and then take a try using different options.
Please refer to [How to use taosBenchmark to test the performance of TDengine](https://tdengine.com/2021/10/09/3114.html) for detail.
## <a class="anchor" id="platforms"></a>List of Supported Platforms
List of platforms supported by TDengine server
......@@ -227,3 +251,5 @@ Comparison matrix as following:
Note: ● has been verified by official tests; ○ has been verified by unofficial tests.
Please visit Connectors section for more detailed information.
<script src="/wp-includes/js/quick-start.js?v=1"></script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册