01-pkg-install.md 10.4 KB
Newer Older
D
dingbo 已提交
1
---
2 3
title: Install & Uninstall
description: Install, Uninstall, Start, Stop and Upgrade
D
dingbo 已提交
4 5 6 7 8
---

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

9
TDengine community version provides dev and rpm package for users to choose based on the system environment. deb supports Debian, Ubuntu and systems derived from them. rpm supports CentOS, RHEL, SUSE and systems derived from them. Furthermore, tar.gz package is provided for enterprise customers.
D
dingbo 已提交
10

11
## Install
D
dingbo 已提交
12 13

<Tabs>
14
<TabItem label="Install Deb" value="debinst">
D
dingbo 已提交
15

16 17
1. Download deb package from official website, for example TDengine-server-2.4.0.7-Linux-x64.deb
2. In the directory where the package is located, execute below command
D
dingbo 已提交
18

19
```bash
D
dingbo 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
$ sudo dpkg -i TDengine-server-2.4.0.7-Linux-x64.deb
(Reading database ... 137504 files and directories currently installed.)
Preparing to unpack TDengine-server-2.4.0.7-Linux-x64.deb ...
TDengine is removed successfully!
Unpacking tdengine (2.4.0.7) over (2.4.0.7) ...
Setting up tdengine (2.4.0.7) ...
Start to install TDengine...

System hostname is: ubuntu-1804

Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join
OR leave it blank to build one:

Enter your email address for priority support or enter empty to skip:
Created symlink /etc/systemd/system/multi-user.target.wants/taosd.service → /etc/systemd/system/taosd.service.

To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine     : sudo systemctl start taosd
To access TDengine    : taos -h ubuntu-1804 to login into TDengine server


TDengine is installed successfully!
```

</TabItem>

46
<TabItem label="Install RPM" value="rpminst">
D
dingbo 已提交
47

48 49
1. Download rpm package from official website, for example TDengine-server-2.4.0.7-Linux-x64.rpm;
2. In the directory where the package is located, execute below command
D
dingbo 已提交
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76

```
$ sudo rpm -ivh TDengine-server-2.4.0.7-Linux-x64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tdengine-2.4.0.7-3               ################################# [100%]
Start to install TDengine...

System hostname is: centos7

Enter FQDN:port (like h1.taosdata.com:6030) of an existing TDengine cluster node to join
OR leave it blank to build one:

Enter your email address for priority support or enter empty to skip:

Created symlink from /etc/systemd/system/multi-user.target.wants/taosd.service to /etc/systemd/system/taosd.service.

To configure TDengine : edit /etc/taos/taos.cfg
To start TDengine     : sudo systemctl start taosd
To access TDengine    : taos -h centos7 to login into TDengine server


TDengine is installed successfully!
```

</TabItem>

77
<TabItem label="Install tar.gz" value="tarinst">
D
dingbo 已提交
78

79 80
1. Download the tar.gz package, for example TDengine-server-2.4.0.7-Linux-x64.tar.gz;
   2、In the directory where the package is located, firstly decompress the file, then switch to the sub-directory generated in decompressing, i.e. "TDengine-enterprise-server-2.4.0.7/" in this example, and execute the `install.sh` script.
D
dingbo 已提交
81

82
```bash
D
dingbo 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
$ tar xvzf TDengine-enterprise-server-2.4.0.7-Linux-x64.tar.gz
TDengine-enterprise-server-2.4.0.7/
TDengine-enterprise-server-2.4.0.7/driver/
TDengine-enterprise-server-2.4.0.7/driver/vercomp.txt
TDengine-enterprise-server-2.4.0.7/driver/libtaos.so.2.4.0.7
TDengine-enterprise-server-2.4.0.7/install.sh
TDengine-enterprise-server-2.4.0.7/examples/
...

$ ll
total 43816
drwxrwxr-x  3 ubuntu ubuntu     4096 Feb 22 09:31 ./
drwxr-xr-x 20 ubuntu ubuntu     4096 Feb 22 09:30 ../
drwxrwxr-x  4 ubuntu ubuntu     4096 Feb 22 09:30 TDengine-enterprise-server-2.4.0.7/
-rw-rw-r--  1 ubuntu ubuntu 44852544 Feb 22 09:31 TDengine-enterprise-server-2.4.0.7-Linux-x64.tar.gz

$ cd TDengine-enterprise-server-2.4.0.7/

 $ ll
total 40784
drwxrwxr-x  4 ubuntu ubuntu     4096 Feb 22 09:30 ./
drwxrwxr-x  3 ubuntu ubuntu     4096 Feb 22 09:31 ../
drwxrwxr-x  2 ubuntu ubuntu     4096 Feb 22 09:30 driver/
drwxrwxr-x 10 ubuntu ubuntu     4096 Feb 22 09:30 examples/
-rwxrwxr-x  1 ubuntu ubuntu    33294 Feb 22 09:30 install.sh*
-rw-rw-r--  1 ubuntu ubuntu 41704288 Feb 22 09:30 taos.tar.gz

$ sudo ./install.sh

Start to update TDengine...
Created symlink /etc/systemd/system/multi-user.target.wants/taosd.service → /etc/systemd/system/taosd.service.
Nginx for TDengine is updated successfully!

To configure TDengine : edit /etc/taos/taos.cfg
To configure Taos Adapter (if has) : edit /etc/taos/taosadapter.toml
To start TDengine     : sudo systemctl start taosd
To access TDengine    : use taos -h ubuntu-1804 in shell OR from http://127.0.0.1:6060

TDengine is updated successfully!
Install taoskeeper as a standalone service
taoskeeper is installed, enable it by `systemctl enable taoskeeper`
```

:::info
127
Some configuration will be prompted for users to provide when install.sh is executing, the interactive mode can be disabled by executing `./install.sh -e no`. `./install -h` can show all parameters and detailed explanation.
D
dingbo 已提交
128 129 130 131 132 133 134

:::

</TabItem>
</Tabs>

:::note
135
When installing on the first node in the cluster, when "Enter FQDN:" is prompted, nothing needs to be provided. When installing on following nodes, when "Enter FQDN:" is prompted, the end point of the first dnode in the cluster can be input if it has been already up; or just ignore it and configure later after installation is done.
D
dingbo 已提交
136 137 138

:::

139
## Uninstall
D
dingbo 已提交
140 141

<Tabs>
142
<TabItem label="Uninstall Deb" value="debuninst">
D
dingbo 已提交
143

144
Deb package of TDengine can be uninstalled as below:
D
dingbo 已提交
145

146
```bash
D
dingbo 已提交
147 148 149 150 151 152 153 154 155
$ sudo dpkg -r tdengine
(Reading database ... 137504 files and directories currently installed.)
Removing tdengine (2.4.0.7) ...
TDengine is removed successfully!

```

</TabItem>

156
<TabItem label="Uninstall RPM" value="rpmuninst">
D
dingbo 已提交
157

158
RPM package of TDengine can be uninstalled as below:
D
dingbo 已提交
159 160 161 162 163 164 165 166

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

</TabItem>

167
<TabItem label="Uninstall tar.gz" value="taruninst">
D
dingbo 已提交
168

169
tar.gz package of TDengine can be uninstalled as below:
D
dingbo 已提交
170 171 172 173 174 175 176 177 178 179 180 181

```
$ rmtaos
Nginx for TDengine is running, stopping it...
TDengine is removed successfully!

taosKeeper is removed successfully!
```

</TabItem>
</Tabs>

182
:::note
D
dingbo 已提交
183

184 185
- It's strongly suggested not to use multiple kinds of installation packages on single host TDengine
- After deb package is installed, if the installation directory is removed manually so that uninstall or reinstall can't succeed, it can be resolved by cleaning up TDengine package information as below command and then reinstalling.
D
dingbo 已提交
186

187
```bash
D
dingbo 已提交
188
   $ sudo rm -f /var/lib/dpkg/info/tdengine*
189
```
D
dingbo 已提交
190

191
- After rpm package is installed, if the installation directory is removed manually so that uninstall or reinstall can't succeed, it can be resolved by cleaning up TDengine package information as below command and then reinstalling.
D
dingbo 已提交
192

193
```bash
D
dingbo 已提交
194
   $ sudo rpm -e --noscripts tdengine
195
```
D
dingbo 已提交
196 197 198

:::

199
## Installation Directory
D
dingbo 已提交
200

201
TDengine is installed at /usr/local/taos if successful.
D
dingbo 已提交
202

203
```bash
D
dingbo 已提交
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
$ cd /usr/local/taos
$ ll
$ ll
total 28
drwxr-xr-x  7 root root 4096 Feb 22 09:34 ./
drwxr-xr-x 12 root root 4096 Feb 22 09:34 ../
drwxr-xr-x  2 root root 4096 Feb 22 09:34 bin/
drwxr-xr-x  2 root root 4096 Feb 22 09:34 cfg/
lrwxrwxrwx  1 root root   13 Feb 22 09:34 data -> /var/lib/taos/
drwxr-xr-x  2 root root 4096 Feb 22 09:34 driver/
drwxr-xr-x 10 root root 4096 Feb 22 09:34 examples/
drwxr-xr-x  2 root root 4096 Feb 22 09:34 include/
lrwxrwxrwx  1 root root   13 Feb 22 09:34 log -> /var/log/taos/
```

219
During the installation process:
D
dingbo 已提交
220

221 222 223 224 225 226 227
- Configuration directory, data directory, and log directory are created automatically if they don't exist
- The default configuration file is located at /etc/taos/taos.cfg, which is a copy of /usr/local/taos/cfg/taos.cfg if not existing
- The default data directory is /var/lib/taos, which is a soft link to /usr/local/taos/data
- The default log directory is /var/log/taos, which is a soft link to /usr/local/taos/log
- The executables at /usr/local/taos/bin are linked to /usr/bin
- The DLL files at /usr/local/taos/driver are linked to /usr/lib
- The header files at /usr/local/taos/include are linked to /usr/include
D
dingbo 已提交
228

229
:::note
D
dingbo 已提交
230

231 232
- 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 once
- 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/loca/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.
D
dingbo 已提交
233

234
## Start and Stop
D
dingbo 已提交
235

236
Linux system services `systemd`, `systemctl` or `service` is used to start, stop and restart TDengine. The server process of TDengine is `taosd`, which is started automatically after the Linux system is started. System operator can use `systemd`, `systemctl` or `service` to start, stop or restart TDengine server.
D
dingbo 已提交
237

238
For example, if using `systemctl` , the commands to start, stop, restart and check TDengine server are as below:
D
dingbo 已提交
239

240
- Start server:`systemctl start taosd`
D
dingbo 已提交
241

242
- Stop server:`systemctl stop taosd`
D
dingbo 已提交
243

244
- Restart server:`systemctl restart taosd`
D
dingbo 已提交
245

246
- Check server status:`systemctl status taosd`
D
dingbo 已提交
247

248
From version 2.4.0.0, a new independent component named as `taosAdapter` has been included in TDengine. `taosAdapter` should be started and stopped using `systemctl`.
D
dingbo 已提交
249

250
If the server process is OK, the output of `systemctl status` is like below:
D
dingbo 已提交
251

252 253 254
```
Active: active (running)
```
D
dingbo 已提交
255

256
Otherwise, the output is as below:
D
dingbo 已提交
257

258 259 260 261 262
```
Active: inactive (dead)
```

## Upgrade
D
dingbo 已提交
263

264
There are two aspects in upgrade operation: upgrade installation package and upgrade a running server.
D
dingbo 已提交
265

266
Upgrading package should follow the steps mentioned previously to firstly uninstall old version then install new version.
D
dingbo 已提交
267

268 269 270 271 272 273 274 275 276 277
Upgrading a running server is much more complex. Firstly please check the version number of old version and new version. The version number of TDengine consists of 4 sections, only the first 3 section match can the old version be upgraded to the new version. The steps of upgrading a running server are as below:

- Stop inserting data
- Make sure all data persisted into disk
- Stop the cluster of TDengine
- Uninstall old version and install new version
- Start the cluster of TDengine
- Make some simple queries to make sure no data loss
- Make some simple data insertion to make sure the cluster works well
- Restore business data
D
dingbo 已提交
278 279

:::warning
280
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.
D
dingbo 已提交
281

282
:::