doc: replace taos shell with TDengine CLI
This commit is contained in:
parent
ff5c1f1cc4
commit
a2ffacc261
|
@ -114,7 +114,7 @@ The above process can be repeated to add more dnodes in the cluster.
|
||||||
|
|
||||||
Any node that is in the cluster and online can be the firstEp of new nodes.
|
Any node that is in the cluster and online can be the firstEp of new nodes.
|
||||||
Nodes use the firstEp parameter only when joining a cluster for the first time. After a node has joined the cluster, it stores the latest mnode in its end point list and no longer makes use of firstEp.
|
Nodes use the firstEp parameter only when joining a cluster for the first time. After a node has joined the cluster, it stores the latest mnode in its end point list and no longer makes use of firstEp.
|
||||||
However, firstEp is used by clients that connect to the cluster. For example, if you run `taos shell` without arguments, it connects to the firstEp by default.
|
However, firstEp is used by clients that connect to the cluster. For example, if you run TDengine CLI `taos` without arguments, it connects to the firstEp by default.
|
||||||
Two dnodes that are launched without a firstEp value operate independently of each other. It is not possible to add one dnode to the other dnode and form a cluster. It is also not possible to form two independent clusters into a new cluster.
|
Two dnodes that are launched without a firstEp value operate independently of each other. It is not possible to add one dnode to the other dnode and form a cluster. It is also not possible to form two independent clusters into a new cluster.
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
@ -72,7 +72,7 @@ Next, ensure the hostname "tdengine" is resolvable in `/etc/hosts`.
|
||||||
echo 127.0.0.1 tdengine |sudo tee -a /etc/hosts
|
echo 127.0.0.1 tdengine |sudo tee -a /etc/hosts
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, the TDengine service can be accessed from the taos shell or any connector with "tdengine" as the server address.
|
Finally, the TDengine service can be accessed from the TDengine CLI or any connector with "tdengine" as the server address.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
taos -h tdengine -P 6030
|
taos -h tdengine -P 6030
|
||||||
|
|
|
@ -344,7 +344,7 @@ The charset that takes effect is UTF-8.
|
||||||
| Attribute | Description |
|
| Attribute | Description |
|
||||||
| -------- | --------------------------------- |
|
| -------- | --------------------------------- |
|
||||||
| Applicable | Server and Client |
|
| Applicable | Server and Client |
|
||||||
| Meaning | The interval for taos shell to send heartbeat to mnode |
|
| Meaning | The interval for TDengine CLI to send heartbeat to mnode |
|
||||||
| Unit | second |
|
| Unit | second |
|
||||||
| Value Range | 1-120 |
|
| Value Range | 1-120 |
|
||||||
| Default Value | 3 |
|
| Default Value | 3 |
|
||||||
|
|
|
@ -71,7 +71,7 @@ serverPort 6030
|
||||||
|
|
||||||
## 启动集群
|
## 启动集群
|
||||||
|
|
||||||
按照《立即开始》里的步骤,启动第一个数据节点,例如 h1.taosdata.com,然后执行 taos,启动 taos shell,从 shell 里执行命令“SHOW DNODES”,如下所示:
|
按照《立即开始》里的步骤,启动第一个数据节点,例如 h1.taosdata.com,然后执行 taos,启动 TDengine CLI,在其中执行命令 “SHOW DNODES”,如下所示:
|
||||||
|
|
||||||
```
|
```
|
||||||
taos> show dnodes;
|
taos> show dnodes;
|
||||||
|
@ -115,7 +115,7 @@ SHOW DNODES;
|
||||||
|
|
||||||
任何已经加入集群在线的数据节点,都可以作为后续待加入节点的 firstEp。
|
任何已经加入集群在线的数据节点,都可以作为后续待加入节点的 firstEp。
|
||||||
firstEp 这个参数仅仅在该数据节点首次加入集群时有作用,加入集群后,该数据节点会保存最新的 mnode 的 End Point 列表,不再依赖这个参数。
|
firstEp 这个参数仅仅在该数据节点首次加入集群时有作用,加入集群后,该数据节点会保存最新的 mnode 的 End Point 列表,不再依赖这个参数。
|
||||||
接下来,配置文件中的 firstEp 参数就主要在客户端连接的时候使用了,例如 taos shell 如果不加参数,会默认连接由 firstEp 指定的节点。
|
接下来,配置文件中的 firstEp 参数就主要在客户端连接的时候使用了,例如 TDengine CLI 如果不加参数,会默认连接由 firstEp 指定的节点。
|
||||||
两个没有配置 firstEp 参数的数据节点 dnode 启动后,会独立运行起来。这个时候,无法将其中一个数据节点加入到另外一个数据节点,形成集群。无法将两个独立的集群合并成为新的集群。
|
两个没有配置 firstEp 参数的数据节点 dnode 启动后,会独立运行起来。这个时候,无法将其中一个数据节点加入到另外一个数据节点,形成集群。无法将两个独立的集群合并成为新的集群。
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
@ -366,7 +366,7 @@ kubectl scale statefulsets tdengine --replicas=1
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
在 taos shell 中的所有数据库操作将无法成功。
|
在 TDengine CLI 中的所有数据库操作将无法成功。
|
||||||
|
|
||||||
```
|
```
|
||||||
taos> show dnodes;
|
taos> show dnodes;
|
||||||
|
|
|
@ -32,7 +32,7 @@ taos> show databases;
|
||||||
Query OK, 2 rows in database (0.033802s)
|
Query OK, 2 rows in database (0.033802s)
|
||||||
```
|
```
|
||||||
|
|
||||||
因为运行在容器中的 TDengine 服务端使用容器的 hostname 建立连接,使用 taos shell 或者各种连接器(例如 JDBC-JNI)从容器外访问容器内的 TDengine 比较复杂,所以上述方式是访问容器中 TDengine 服务的最简单的方法,适用于一些简单场景。如果在一些复杂场景下想要从容器化使用 taos shell 或者各种连接器访问容器中的 TDengine 服务,请参考下一节。
|
因为运行在容器中的 TDengine 服务端使用容器的 hostname 建立连接,使用 TDengine CLI 或者各种连接器(例如 JDBC-JNI)从容器外访问容器内的 TDengine 比较复杂,所以上述方式是访问容器中 TDengine 服务的最简单的方法,适用于一些简单场景。如果在一些复杂场景下想要从容器化使用 TDengine CLI 或者各种连接器访问容器中的 TDengine 服务,请参考下一节。
|
||||||
|
|
||||||
## 在 host 网络上启动 TDengine
|
## 在 host 网络上启动 TDengine
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ docker run -d \
|
||||||
echo 127.0.0.1 tdengine |sudo tee -a /etc/hosts
|
echo 127.0.0.1 tdengine |sudo tee -a /etc/hosts
|
||||||
```
|
```
|
||||||
|
|
||||||
最后,可以从 taos shell 或者任意连接器以 "tdengine" 为服务端地址访问 TDengine 服务。
|
最后,可以从 TDengine CLI 或者任意连接器以 "tdengine" 为服务端地址访问 TDengine 服务。
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
taos -h tdengine -P 6030
|
taos -h tdengine -P 6030
|
||||||
|
@ -354,7 +354,7 @@ test-docker_td-2_1 /tini -- /usr/bin/entrypoi ... Up
|
||||||
test-docker_td-3_1 /tini -- /usr/bin/entrypoi ... Up
|
test-docker_td-3_1 /tini -- /usr/bin/entrypoi ... Up
|
||||||
```
|
```
|
||||||
|
|
||||||
4. 用 taos shell 查看 dnodes
|
4. 用 TDengine 查看 dnodes
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ description: 如何导出 TDengine 中的数据
|
||||||
|
|
||||||
## 按表导出 CSV 文件
|
## 按表导出 CSV 文件
|
||||||
|
|
||||||
如果用户需要导出一个表或一个 STable 中的数据,可在 taos shell 中运行:
|
如果用户需要导出一个表或一个 STable 中的数据,可在 TDengine CLI 中运行:
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
select * from <tb_name> >> data.csv;
|
select * from <tb_name> >> data.csv;
|
||||||
|
|
|
@ -116,7 +116,7 @@ charset UTF-8
|
||||||
|
|
||||||
### 9. 表名显示不全
|
### 9. 表名显示不全
|
||||||
|
|
||||||
由于 taos shell 在终端中显示宽度有限,有可能比较长的表名显示不全,如果按照显示的不全的表名进行相关操作会发生 Table does not exist 错误。解决方法可以是通过修改 taos.cfg 文件中的设置项 maxBinaryDisplayWidth, 或者直接输入命令 set max_binary_display_width 100。或者在命令结尾使用 \G 参数来调整结果的显示方式。
|
由于 TDengine CLI 在终端中显示宽度有限,有可能比较长的表名显示不全,如果按照显示的不全的表名进行相关操作会发生 Table does not exist 错误。解决方法可以是通过修改 taos.cfg 文件中的设置项 maxBinaryDisplayWidth, 或者直接输入命令 set max_binary_display_width 100。或者在命令结尾使用 \G 参数来调整结果的显示方式。
|
||||||
|
|
||||||
### 10. 如何进行数据迁移?
|
### 10. 如何进行数据迁移?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue