01-pkg-install.md 5.4 KB
Newer Older
1
---
D
danielclow 已提交
2
title: Install and Uninstall
D
danielclow 已提交
3
description: This document describes how to install, upgrade, and uninstall TDengine.
4 5 6 7 8
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

D
danielclow 已提交
9
This document gives more information about installing, uninstalling, and upgrading TDengine.
10 11 12

## Install

G
gccgdb1234 已提交
13
About details of installing TDenine, please refer to [Installation Guide](../../get-started/package/).
14 15 16 17

## Uninstall

<Tabs>
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<TabItem label="Uninstall apt-get" value="aptremove">

Apt-get package of TDengine can be uninstalled as below:

```bash
$ sudo apt-get remove tdengine
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  tdengine
0 upgraded, 0 newly installed, 1 to remove and 18 not upgraded.
After this operation, 68.3 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 135625 files and directories currently installed.)
Removing tdengine (3.0.0.0) ...
TDengine is removed successfully!

```

38
Apt-get package of taosTools can be uninstalled as below:
D
danielclow 已提交
39

40 41 42 43 44 45 46 47 48 49 50 51 52
```
$ sudo apt remove taostools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  taostools
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 68.3 MB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 147973 files and directories currently installed.)
Removing taostools (2.1.2) ...
```
D
danielclow 已提交
53 54

</TabItem>
55 56 57 58
<TabItem label="Uninstall Deb" value="debuninst">

Deb package of TDengine can be uninstalled as below:

D
danielclow 已提交
59
```
60 61
$ sudo dpkg -r tdengine
(Reading database ... 137504 files and directories currently installed.)
62
Removing tdengine (3.0.0.0) ...
63 64 65 66
TDengine is removed successfully!

```

67 68 69 70 71 72 73 74
Deb package of taosTools can be uninstalled as below:

```
$ sudo dpkg -r taostools
(Reading database ... 147973 files and directories currently installed.)
Removing taostools (2.1.2) ...
```

75 76 77 78 79 80 81 82 83 84 85
</TabItem>

<TabItem label="Uninstall RPM" value="rpmuninst">

RPM package of TDengine can be uninstalled as below:

```
$ sudo rpm -e tdengine
TDengine is removed successfully!
```

86 87 88 89 90 91 92
RPM package of taosTools can be uninstalled as below:

```
sudo rpm -e taostools
taosToole is removed successfully!
```

93 94 95 96 97 98 99 100 101 102 103
</TabItem>

<TabItem label="Uninstall tar.gz" value="taruninst">

tar.gz package of TDengine can be uninstalled as below:

```
$ rmtaos
TDengine is removed successfully!
```

104 105 106 107 108
tar.gz package of taosTools can be uninstalled as below:

```
$ rmtaostools
Start to uninstall taos tools ...
109

110
taos tools is uninstalled successfully!
111 112
```

D
danielclow 已提交
113 114 115
</TabItem>
<TabItem label="Windows uninstall" value="windows">
Run C:\TDengine\unins000.exe to uninstall TDengine on a Windows system.
116 117 118
</TabItem>
</Tabs>

D
danielclow 已提交
119
:::info
120

D
danielclow 已提交
121
- We strongly recommend not to use multiple kinds of installation packages on a single host TDengine. The packages may affect each other and cause errors.
122

D
danielclow 已提交
123
- After deb package is installed, if the installation directory is removed manually, uninstall or reinstall will not work. This issue can be resolved by using the command below which cleans up TDengine package information.
124

D
danielclow 已提交
125 126 127
  ```
  $ sudo rm -f /var/lib/dpkg/info/tdengine*
  ```
128

D
danielclow 已提交
129
You can then reinstall if needed.
130

D
danielclow 已提交
131
- After rpm package is installed, if the installation directory is removed manually, uninstall or reinstall will not work. This issue can be resolved by using the command below which cleans up TDengine package information.
132

D
danielclow 已提交
133 134 135
  ```
  $ sudo rpm -e --noscripts tdengine
  ```
136

D
danielclow 已提交
137
You can then reinstall if needed.
138

D
danielclow 已提交
139
:::
140

D
danielclow 已提交
141
Uninstalling and Modifying Files
142

143
- When TDengine is uninstalled, the configuration /etc/taos/taos.cfg, data directory /var/lib/taos, log directory /var/log/taos are kept. They can be deleted manually with caution, because data can't be recovered. Please follow data integrity, security, backup or relevant SOPs before deleting any data.
144

D
danielclow 已提交
145
- When reinstalling TDengine, if the default configuration file /etc/taos/taos.cfg exists, it will be kept and the configuration file in the installation package will be renamed to taos.cfg.orig and stored at /usr/local/taos/cfg to be used as configuration sample. Otherwise the configuration file in the installation package will be installed to /etc/taos/taos.cfg and used.
146 147 148 149 150


## Upgrade
There are two aspects in upgrade operation: upgrade installation package and upgrade a running server.

151
To upgrade a package, follow the steps mentioned previously to first uninstall the old version then install the new version.
152

W
wade zhang 已提交
153
Upgrading a running server is much more complex. First please check the version number of the old version and the new version. The version number of TDengine consists of 4 sections, only if the first 2 sections match can the old version be upgraded to the new version. The steps of upgrading a running server are as below:
154
- Stop inserting data
W
wade zhang 已提交
155
- Make sure all data is persisted to disk, please use command `flush database`
156 157 158
- Stop the cluster of TDengine
- Uninstall old version and install new version
- Start the cluster of TDengine
D
danielclow 已提交
159
- Execute simple queries, such as the ones executed prior to installing the new package, to make sure there is no data loss 
160 161
- Run some simple data insertion statements to make sure the cluster works well
- Restore business services
162 163 164 165 166

:::warning
TDengine doesn't guarantee any lower version is compatible with the data generated by a higher version, so it's never recommended to downgrade the version.

:::