记录一下Centos7系统下安装和卸载TDengine Database
安装TDengine Database
先看版本信息
[root@192 ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@192 ~]# uname -r
3.10.0-1160.119.1.el7.x86_64
[root@192 ~]# uname -a
Linux 192.168.1.6 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@192 ~]#
官网
https://docs.taosdata.com
官网安装教程
https://docs.taosdata.com/get-started/package/
官方安装和卸载
https://docs.taosdata.com/2.4/operation/pkg-install/
官网信息介绍了很详细,需要更多信息官网查询
下载rpm包
https://www.taosdata.com/assets-download/3.0/TDengine-server-3.2.3.0-Linux-x64.rpm
可以下载到本地上传到centos7系统服务器 也可以直接在系统里去下载
这是目录 习惯性放在usr/local里
安装(有权限的需要加sudo) 这里是超级账号安装
rpm -ivh TDengine-server-<version>-Linux-x64.rpm
rpm -ivh TDengine-server-3.2.3.0-Linux-x64.rpm
[root@192 local]# rpm -ivh TDengine-server-3.2.3.0-Linux-x64.rpm
准备中... ################################# [100%]
正在升级/安装...1:tdengine-3.2.3.0-3.el7 ################################# [100%]
./post.sh:行107: /var/log/taos/tdengine_install.log: 没有那个文件或目录
Start to install TDengine...
./post.sh:行107: /var/log/taos/tdengine_install.log: 没有那个文件或目录System hostname is: 192.168.1.6Enter 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 192.168.1.6 to login into TDengine serverTDengine is installed successfully!
[root@192 local]#
可以看到加入了开机启动的
启动
[root@192 local]# netstat -lnp|grep taos
[root@192 local]# systemctl start taosd
[root@192 local]# netstat -lnp|grep taos
tcp 0 0 0.0.0.0:6030 0.0.0.0:* LISTEN 22048/taosd
unix 2 [ ACC ] STREAM LISTENING 254470 22061/udfd /var/lib/taos//.udfd.sock.0
[root@192 local]# systemctl status taosd
● taosd.service - TDengine server serviceLoaded: loaded (/etc/systemd/system/taosd.service; enabled; vendor preset: disabled)Active: active (running) since 日 2025-01-19 10:44:59 CST; 12s agoProcess: 22042 ExecStartPre=/usr/local/taos/bin/startPre.sh (code=exited, status=0/SUCCESS)Main PID: 22048 (taosd)Tasks: 34CGroup: /system.slice/taosd.service├─22048 /usr/bin/taosd└─22061 /usr/bin/udfd -c /etc/taos/1月 19 10:44:59 192.168.1.6 systemd[1]: Starting TDengine server service...
1月 19 10:44:59 192.168.1.6 systemd[1]: Started TDengine server service.
[root@192 local]#
[root@192 ~]# netstat -lnp|grep taos
tcp 0 0 0.0.0.0:6030 0.0.0.0:* LISTEN 1400/taosd
unix 2 [ ACC ] STREAM LISTENING 26527 1454/udfd /var/lib/taos//.udfd.sock.0
[root@192 ~]# systemctl start taosadapter
[root@192 ~]# systemctl enable taosadapter
Created symlink from /etc/systemd/system/multi-user.target.wants/taosadapter.service to /etc/systemd/system/taosadapter.service.
[root@192 ~]# netstat -lnp|grep taos
tcp 0 0 0.0.0.0:6030 0.0.0.0:* LISTEN 1400/taosd
tcp 0 0 0.0.0.0:6041 0.0.0.0:* LISTEN 2653/taosadapter
unix 2 [ ACC ] STREAM LISTENING 26527 1454/udfd /var/lib/taos//.udfd.sock.0
[root@192 ~]#
卸载TDengine Database
卸载之前必须备份数据内容
先看TDengine Database运行状态
[root@192 ~]# netstat -lnp|grep tao
tcp 0 0 0.0.0.0:6030 0.0.0.0:* LISTEN 11210/taosd
tcp 0 0 0.0.0.0:6041 0.0.0.0:* LISTEN 1346/taosadapter
unix 2 [ ACC ] STREAM LISTENING 46745 11222/udfd /var/lib/taos//.udfd.sock.1
[root@192 ~]#
关掉和移除掉开机启动
[root@192 ~]# systemctl stop taosd
[root@192 ~]# systemctl stop taosadapter
[root@192 ~]# netstat -lnp|grep tao
[root@192 ~]# systemctl disable taosadapter
Removed symlink /etc/systemd/system/multi-user.target.wants/taosadapter.service.
[root@192 ~]# systemctl disable taosd
Removed symlink /etc/systemd/system/multi-user.target.wants/taosd.service.
[root@192 ~]#
查看taos的目录和文件
[root@192 ~]# whereis taos
taos: /usr/bin/taos /etc/taos /usr/include/taos.h /usr/local/taos
[root@192 ~]# find / -name 'taos*'
/etc/systemd/system/taosadapter.service
/etc/systemd/system/taoskeeper.service
/etc/systemd/system/taosd.service
/etc/taos
/etc/taos/taos.cfg
/etc/taos/taosadapter.toml
/etc/taos/taoskeeper.toml
/var/lib/taos
/var/log/taos
/var/log/taos/taosdlog.0
/var/log/taos/taosSlowLog
/var/log/taos/taoslog0.0
/var/log/taos/taosadapter_2021_02_02_00_00.log
/usr/bin/taos
/usr/bin/taosd
/usr/bin/taosadapter
/usr/bin/taosdemo
/usr/bin/taosBenchmark
/usr/bin/taosdump
/usr/bin/taoskeeper
/usr/include/taos.h
/usr/include/taosdef.h
/usr/include/taoserror.h
/usr/include/taosudf.h
/usr/include/taosws.h
/usr/local/taos
/usr/local/taos/bin/taos
/usr/local/taos/bin/taosBenchmark
/usr/local/taos/bin/taosadapter
/usr/local/taos/bin/taosd
/usr/local/taos/bin/taosd-dump-cfg.gdb
/usr/local/taos/bin/taosdump
/usr/local/taos/bin/taoskeeper
/usr/local/taos/cfg/taosadapter.service
/usr/local/taos/cfg/taoskeeper.service
/usr/local/taos/cfg/taos.cfg.new
/usr/local/taos/cfg/taos.cfg
/usr/local/taos/cfg/taosadapter.toml.new
/usr/local/taos/cfg/taosadapter.toml
/usr/local/taos/cfg/taoskeeper.toml.new
/usr/local/taos/cfg/taoskeeper.toml
/usr/local/taos/examples/C#/taosdemo
/usr/local/taos/examples/C#/taosdemo/taosdemo.cs
/usr/local/taos/examples/C#/taosdemo/taosdemo.csproj
/usr/local/taos/examples/JDBC/JDBCDemo/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/SpringJdbcTemplate/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/SpringJdbcTemplate/src/test/java/com/taosdata
/usr/local/taos/examples/JDBC/connectionPools/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/consumer-demo/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/mybatisplus-demo/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/mybatisplus-demo/src/test/java/com/taosdata
/usr/local/taos/examples/JDBC/springbootdemo/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/taosdemo
/usr/local/taos/examples/JDBC/taosdemo/src/main/java/com/taosdata
/usr/local/taos/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo
/usr/local/taos/examples/JDBC/taosdemo/src/test/java/com/taosdata
/usr/local/taos/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo
/usr/local/taos/examples/go/taosdemo.go
/usr/local/taos/examples/python/taosdemo
/usr/local/taos/examples/python/taosdemo/__pycache__/taosdemo.cpython-36.opt-1.pyc
/usr/local/taos/examples/python/taosdemo/__pycache__/taosdemo.cpython-36.pyc
/usr/local/taos/examples/python/taosdemo/taosdemo.py
/usr/local/taos/include/taos.h
/usr/local/taos/include/taosdef.h
/usr/local/taos/include/taoserror.h
/usr/local/taos/include/taosudf.h
/usr/local/taos/include/taosws.h
安装使用的是rpm方式 因此卸载用指令
rpm -e tdengine
[root@192 ~]# rpm -e tdengine
taosadapter is running, stopping it...
TDengine is removed successfully!
[root@192 ~]#
卸载之后再看看
[root@192 ~]# whereis taos
taos: /etc/taos
[root@192 ~]# find / -name 'taos*'
/etc/taos
/etc/taos/taos.cfg
/etc/taos/taosadapter.toml
/etc/taos/taoskeeper.toml
/var/lib/taos
/var/log/taos
/var/log/taos/taosdlog.0
/var/log/taos/taosSlowLog
/var/log/taos/taoslog0.0
/var/log/taos/taosadapter_2021_02_02_00_00.log
/usr/bin/taosdump
/usr/include/taosws.h
[root@192 ~]#
可以看到这些文件和文件夹内的都没有用了,卸载干净的话需要删掉他们
[root@192 ~]# rm -rf /etc/taos
[root@192 ~]# rm -rf /var/lib/taos
[root@192 ~]# rm -rf /var/log/taos
[root@192 ~]# find / -name 'taos*'
find: ‘/proc/26072’: 没有那个文件或目录
find: ‘/proc/26105’: 没有那个文件或目录
/usr/bin/taosdump
/usr/include/taosws.h
[root@192 ~]# whereis taos
[root@192 ~]#
这个东西我没有看到,但是也删掉
[root@192 ~]# rm -rf /usr/bin/taosdump
[root@192 ~]# rm -rf /usr/include/taosws.h
如此卸载干净了
[root@192 ~]# find / -name 'taos*'
[root@192 ~]# whereis taos
taos:[root@192 ~]#