折腾:
【未解决】试用TDeigine数据库的功能和效果
期间,先去启动服务端。
参考官网文档:
1 2 | [root@xxx tdengine] # which taosd /usr/bin/taosd |
再去启动服务端:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 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 46 47 48 49 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 77 78 79 80 81 82 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 127 128 129 130 131 | [root@xxx tdengine] # taosd --version 02/29 20:11:41.949522 3953 7f4350c35740 UTL timezone not configured, set to system default : (CST, +0800) 02/29 20:11:41.949593 3953 7f4350c35740 UTL locale not configured, set to system default :en_US.UTF-8 02/29 20:11:41.949605 3953 7f4350c35740 UTL charset not configured, set to system default :UTF-8 02/29 20:11:41.949761 3953 7f4350c35740 UTL taos config & system info: 02/29 20:11:41.949773 3953 7f4350c35740 UTL ================================== 02/29 20:11:41.949777 3953 7f4350c35740 UTL localIp: 10.173.32.11 02/29 20:11:41.949802 3953 7f4350c35740 UTL httpIp: 0.0.0.0 02/29 20:11:41.949805 3953 7f4350c35740 UTL httpPort: 6020 02/29 20:11:41.949808 3953 7f4350c35740 UTL mgmtShellPort: 6030 02/29 20:11:41.949816 3953 7f4350c35740 UTL vnodeShellPort: 6035 02/29 20:11:41.949819 3953 7f4350c35740 UTL configDir: /etc/taos 02/29 20:11:41.949822 3953 7f4350c35740 UTL logDir: / var /log/taos 02/29 20:11:41.949829 3953 7f4350c35740 UTL scriptDir: /etc/taos 02/29 20:11:41.949832 3953 7f4350c35740 UTL dataDir: / var /lib/taos 02/29 20:11:41.949835 3953 7f4350c35740 UTL numOfThreadsPerCore: 1.000000 02/29 20:11:41.949852 3953 7f4350c35740 UTL ratioOfQueryThreads: 0.500000 02/29 20:11:41.949856 3953 7f4350c35740 UTL numOfVnodesPerCore: 8 02/29 20:11:41.949859 3953 7f4350c35740 UTL numOfTotalVnodes: 0 02/29 20:11:41.949862 3953 7f4350c35740 UTL tables: 1000 02/29 20:11:41.949865 3953 7f4350c35740 UTL cache: 16384(byte) 02/29 20:11:41.949871 3953 7f4350c35740 UTL rows: 4096 02/29 20:11:41.949874 3953 7f4350c35740 UTL fileBlockMinPercent: 0.050000 02/29 20:11:41.949878 3953 7f4350c35740 UTL ablocks: 4 02/29 20:11:41.949883 3953 7f4350c35740 UTL tblocks: 100 02/29 20:11:41.949886 3953 7f4350c35740 UTL affectedRowsMod: 0 02/29 20:11:41.949889 3953 7f4350c35740 UTL monitorInterval: 30(s) 02/29 20:11:41.949894 3953 7f4350c35740 UTL rpcTimer: 300(ms) 02/29 20:11:41.949897 3953 7f4350c35740 UTL rpcMaxTime: 600(s) 02/29 20:11:41.949901 3953 7f4350c35740 UTL ctime: 3600(s) 02/29 20:11:41.949904 3953 7f4350c35740 UTL statusInterval: 1(s) 02/29 20:11:41.949909 3953 7f4350c35740 UTL shellActivityTimer: 3(s) 02/29 20:11:41.949912 3953 7f4350c35740 UTL meterMetaKeepTimer: 7200(s) 02/29 20:11:41.949914 3953 7f4350c35740 UTL metricMetaKeepTimer: 600(s) 02/29 20:11:41.949919 3953 7f4350c35740 UTL maxUsers: 1000 02/29 20:11:41.949922 3953 7f4350c35740 UTL maxDbs: 1000 02/29 20:11:41.949925 3953 7f4350c35740 UTL maxTables: 650000 02/29 20:11:41.949929 3953 7f4350c35740 UTL maxVGroups: 1000 02/29 20:11:41.949937 3953 7f4350c35740 UTL minSlidingTime: 10(ms) 02/29 20:11:41.949940 3953 7f4350c35740 UTL minIntervalTime: 10(ms) 02/29 20:11:41.949943 3953 7f4350c35740 UTL maxStreamCompDelay: 20000(ms) 02/29 20:11:41.949946 3953 7f4350c35740 UTL maxFirstStreamCompDelay:10000(ms) 02/29 20:11:41.949948 3953 7f4350c35740 UTL retryStreamCompDelay: 10(ms) 02/29 20:11:41.949951 3953 7f4350c35740 UTL clog: 1 02/29 20:11:41.949956 3953 7f4350c35740 UTL comp: 2 02/29 20:11:41.949959 3953 7f4350c35740 UTL days: 10 02/29 20:11:41.949962 3953 7f4350c35740 UTL keep: 3650 02/29 20:11:41.949965 3953 7f4350c35740 UTL defaultDB: 02/29 20:11:41.949971 3953 7f4350c35740 UTL defaultUser: root 02/29 20:11:41.949974 3953 7f4350c35740 UTL sockettype: udp 02/29 20:11:41.949977 3953 7f4350c35740 UTL compressMsgSize: -1 02/29 20:11:41.949982 3953 7f4350c35740 UTL maxSQLLength: 65380(byte) 02/29 20:11:41.949985 3953 7f4350c35740 UTL timezone: (CST, +0800) 02/29 20:11:41.949988 3953 7f4350c35740 UTL locale: en_US.UTF-8 02/29 20:11:41.949994 3953 7f4350c35740 UTL charset: UTF-8 02/29 20:11:41.949997 3953 7f4350c35740 UTL maxShellConns: 2000 02/29 20:11:41.950001 3953 7f4350c35740 UTL maxMeterConnections: 10000 02/29 20:11:41.950003 3953 7f4350c35740 UTL maxMgmtConnections: 2000 02/29 20:11:41.950006 3953 7f4350c35740 UTL maxVnodeConnections: 10000 02/29 20:11:41.950009 3953 7f4350c35740 UTL minimalLogDirGB: 0.100000(GB) 02/29 20:11:41.950013 3953 7f4350c35740 UTL minimalTmpDirGB: 0.100000(GB) 02/29 20:11:41.950017 3953 7f4350c35740 UTL minimalDataDirGB: 0.500000(GB) 02/29 20:11:41.950022 3953 7f4350c35740 UTL http: 1 02/29 20:11:41.950025 3953 7f4350c35740 UTL monitor: 1 02/29 20:11:41.950028 3953 7f4350c35740 UTL monitorDbName: log 02/29 20:11:41.950032 3953 7f4350c35740 UTL httpCacheSessions: 100 02/29 20:11:41.950041 3953 7f4350c35740 UTL httpEnableRecordSql: 0 02/29 20:11:41.950044 3953 7f4350c35740 UTL telegrafUseFieldNum: 0 02/29 20:11:41.950046 3953 7f4350c35740 UTL httpMaxThreads: 2 02/29 20:11:41.950049 3953 7f4350c35740 UTL restfulRowLimit: 10240 02/29 20:11:41.950052 3953 7f4350c35740 UTL httpEnableCompress: 0 02/29 20:11:41.950056 3953 7f4350c35740 UTL numOfLogLines: 10000000 02/29 20:11:41.950061 3953 7f4350c35740 UTL asyncLog: 1 02/29 20:11:41.950064 3953 7f4350c35740 UTL debugFlag: 131 02/29 20:11:41.950083 3953 7f4350c35740 UTL mDebugFlag: 135 02/29 20:11:41.950087 3953 7f4350c35740 UTL dDebugFlag: 131 02/29 20:11:41.950090 3953 7f4350c35740 UTL sdbDebugFlag: 135 02/29 20:11:41.950093 3953 7f4350c35740 UTL rpcDebugFlag: 131 02/29 20:11:41.950096 3953 7f4350c35740 UTL tmrDebugFlag: 131 02/29 20:11:41.950099 3953 7f4350c35740 UTL cDebugFlag: 131 02/29 20:11:41.950102 3953 7f4350c35740 UTL jniDebugFlag: 131 02/29 20:11:41.950123 3953 7f4350c35740 UTL odbcDebugFlag: 131 02/29 20:11:41.950126 3953 7f4350c35740 UTL uDebugFlag: 131 02/29 20:11:41.950129 3953 7f4350c35740 UTL httpDebugFlag: 131 02/29 20:11:41.950132 3953 7f4350c35740 UTL monitorDebugFlag: 131 02/29 20:11:41.950137 3953 7f4350c35740 UTL qDebugFlag: 131 02/29 20:11:41.950140 3953 7f4350c35740 UTL tscEnableRecordSql: 0 02/29 20:11:41.950143 3953 7f4350c35740 UTL enableCoreFile: 0 02/29 20:11:41.950146 3953 7f4350c35740 UTL gitinfo: 918cb2220f6a1f71966f7e94e697885d50fc241f 02/29 20:11:41.950170 3953 7f4350c35740 UTL gitinfoOfInternal: 02/29 20:11:41.950173 3953 7f4350c35740 UTL buildinfo: Built by root at 2020-02-09 11:06 02/29 20:11:41.950262 3953 7f4350c35740 UTL version: 1.6.5.5 02/29 20:11:41.950271 3953 7f4350c35740 UTL dataDir: / var /lib/taos 02/29 20:11:41.950274 3953 7f4350c35740 UTL os pageSize: 4096(KB) 02/29 20:11:41.950278 3953 7f4350c35740 UTL os openMax: 1024 02/29 20:11:41.950282 3953 7f4350c35740 UTL os streamMax: 16 02/29 20:11:41.950285 3953 7f4350c35740 UTL os numOfCores: 16 02/29 20:11:41.950289 3953 7f4350c35740 UTL os totalDisk: 19.622616(GB) 02/29 20:11:41.950294 3953 7f4350c35740 UTL os totalMemory: 32008(MB) 02/29 20:11:41.950300 3953 7f4350c35740 UTL os sysname: Linux 02/29 20:11:41.950307 3953 7f4350c35740 UTL os nodename: xxx.localdomain 02/29 20:11:41.950309 3953 7f4350c35740 UTL os release: 3.10.0-123.el7.x86_64 02/29 20:11:41.950312 3953 7f4350c35740 UTL os version: #1 SMP Mon Jun 30 12:09:22 UTC 2014 02/29 20:11:41.950315 3953 7f4350c35740 UTL os machine: x86_64 02/29 20:11:41.950317 3953 7f4350c35740 UTL ================================== 02/29 20:11:41.950320 3953 7f4350c35740 DND Server IP address is:10.173.32.11 02/29 20:11:41.950326 3953 7f4350c35740 DND starting to initialize TDengine ... 02/29 20:11:41.951977 3953 7f4350c35740 MND starting to initialize TDengine mgmt ... 02/29 20:11:41.953112 3953 7f4350c35740 MND dnode first access, set total vnodes:128 02/29 20:11:41.965324 3953 7f4350c35740 MND TDengine mgmt is initialized successfully 02/29 20:11:41.970409 3953 7f4350c35740 DND vnode is initialized successfully 02/29 20:11:41.970444 3953 7f4350c35740 HTP starting to initialize http service ... 02/29 20:11:41.973324 3953 7f4350c35740 DND TDengine is initialized successfully 02/29 20:11:41.973459 3953 7f432ca3b700 HTP http service init success at ip:0.0.0.0:6020 02/29 20:11:41.988057 3953 7f43421f3700 MON starting to initialize monitor service .. 02/29 20:11:41.988542 3953 7f43469fc700 MND user:monitor login from 10.173.32.11, code:0 02/29 20:11:41.989110 3953 7f43429f4700 MND DB:0.log is created by monitor 02/29 20:11:41.989560 3953 7f43471fd700 DND vid:0, vpeer cfg received, replica:1 session:33, vnodeList replica:0 session:0, acct:root db:0.log 02/29 20:11:41.989576 3953 7f43471fd700 DND vid:0, vpeer:0 ip:0x0 vid:0 02/29 20:11:41.989583 3953 7f43471fd700 DND vid:0, vnode is empty 02/29 20:11:41.989587 3953 7f43471fd700 DND vid:0, status:offline, start to create vnode 02/29 20:11:41.989845 3953 7f43471fd700 DND vid:0, cache pool is allocated:0x40008c0 02/29 20:11:41.990003 3953 7f43471fd700 DND vid:0, commit log is initialized 02/29 20:11:41.990015 3953 7f43471fd700 DND vid:0, storage initialized, version:0 fileId:0 numOfFiles:0 02/29 20:11:41.990019 3953 7f43471fd700 DND vid:0, status:creating, start to open 02/29 20:11:41.990124 3953 7f43471fd700 DND vid:0, sessions:33, shell is opened 02/29 20:11:41.990132 3953 7f43471fd700 DND vid:0, status:master numOfPeers:0 02/29 20:11:41.990135 3953 7f43471fd700 DND vid:0, stream role is changed from stop to start 02/29 20:11:41.990140 3953 7f43471fd700 DND vid:0, vnode is opened, openVnodes:1, status:master 02/29 20:11:42.003447 3953 7f4338ff9700 MON dnode:10.173.32.11 is started 02/29 20:11:42.005308 3953 7f4337ff7700 MON monitor service init success |
此处暂时没client去测试,所以暂停服务
后来再去试试
1 2 3 4 5 | [root@xxx tdengine] # taosd 02/29 20:32:47.118513 4082 7fc48e858740 UTL timezone not configured, set to system default : (CST, +0800) 02/29 20:32:47.118582 4082 7fc48e858740 UTL locale not configured, set to system default :en_US.UTF-8 02/29 20:32:47.118623 4082 7fc48e858740 UTL charset not configured, set to system default :UTF-8 02/29 20:32:47.118687 4082 7fc48e858740 ERROR DND failed to lock file:/ var /lib/taos/.running ret:-1, database may be running, quit |
失败。
去看看
1 2 | [root@xxx tdengine] # ll /var/lib/taos/.running -rwxrwxrwx 1 root root 0 Feb 29 20:32 / var /lib/taos/.running |
然后去删除掉
1 2 3 | [root@xxx tdengine] # rm -rf /var/lib/taos/ data/ mgmt/ .running tsdb/ [root@xxx tdengine] # rm -rf /var/lib/taos/.running |
再去试试,结果:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | [root@xxx tdengine] # taosd 02/29 20:34:16.714364 4087 7f7f76cbf740 UTL timezone not configured, set to system default : (CST, +0800) 02/29 20:34:16.714446 4087 7f7f76cbf740 UTL locale not configured, set to system default :en_US.UTF-8 02/29 20:34:16.714459 4087 7f7f76cbf740 UTL charset not configured, set to system default :UTF-8 02/29 20:34:16.714531 4087 7f7f76cbf740 UTL taos config & system info: 02/29 20:34:16.714541 4087 7f7f76cbf740 UTL ================================== 02/29 20:34:16.714545 4087 7f7f76cbf740 UTL localIp: 10.173.32.11 。。。 02/29 20:34:16.714943 4087 7f7f76cbf740 UTL os machine: x86_64 02/29 20:34:16.714945 4087 7f7f76cbf740 UTL ================================== 02/29 20:34:16.714949 4087 7f7f76cbf740 DND Server IP address is:10.173.32.11 02/29 20:34:16.714956 4087 7f7f76cbf740 DND starting to initialize TDengine ... 02/29 20:34:16.715178 4087 7f7f76cbf740 MND starting to initialize TDengine mgmt ... 02/29 20:34:16.715990 4087 7f7f76cbf740 MND dnode first access, set total vnodes:128 02/29 20:34:16.727057 4087 7f7f76cbf740 MND TDengine mgmt is initialized successfully 02/29 20:34:16.727063 4087 7f7f5ffff700 ERROR UTL bind tcp server socket failed, 0.0.0.0:6030, reason:98(Address already in use) 02/29 20:34:16.727107 4087 7f7f5ffff700 RPC MND-shell failed to create TCP socket 0.0.0.0:6030 for UDP server, reason:Address already in use 02/29 20:34:16.727112 4087 7f7f5ffff700 UTL taosd will shut down soon 02/29 20:34:16.727148 4087 7f7f76cbf740 DND shut down signal is 2, sender PID:4087 02/29 20:34:16.727156 4087 7f7f76cbf740 HTP http service cleanup 02/29 20:34:16.727161 4087 7f7f76cbf740 MON monitor service cleanup 02/29 20:34:16.727563 4087 7f7f76cbf740 DND TDengine is shut down! |
很明显是:
端口被占用了
说明后台正在运行
所以去找找,再杀掉:
1 2 3 4 5 6 7 8 9 10 | [root@xxx tdengine] # ps aux | grep tao root 3953 0.2 0.1 2176344 41592 pts / 0 Tl 20 : 11 0 : 03 taosd - - version root 4120 0.0 0.0 112708 968 pts / 0 S + 20 : 34 0 : 00 grep - - color = auto tao [root@xxx tdengine] # ps aux | grep tao root 3953 0.2 0.1 2176344 41592 pts / 0 Tl 20 : 11 0 : 03 taosd - - version root 4120 0.0 0.0 112708 968 pts / 0 S + 20 : 34 0 : 00 grep - - color = auto tao [root@xxx tdengine] # kill -9 3953 [root@xxx tdengine] # ps aux | grep tao root 4126 0.0 0.0 112708 968 pts / 0 S + 20 : 35 0 : 00 grep - - color = auto tao [ 19 ] + Killed taosd - - version |
再去运行试试,终于可以了:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | [root@xxx tdengine] # taosd 02/29 20:35:26.645024 4129 7f0288075740 UTL timezone not configured, set to system default : (CST, +0800) 02/29 20:35:26.645108 4129 7f0288075740 UTL locale not configured, set to system default :en_US.UTF-8 02/29 20:35:26.645120 4129 7f0288075740 UTL charset not configured, set to system default :UTF-8 02/29 20:35:26.645186 4129 7f0288075740 UTL taos config & system info: 02/29 20:35:26.645196 4129 7f0288075740 UTL ================================== 02/29 20:35:26.645200 4129 7f0288075740 UTL localIp: 10.173.32.11 ... 02/29 20:35:26.645692 4129 7f0288075740 UTL os release: 3.10.0-123.el7.x86_64 02/29 20:35:26.645694 4129 7f0288075740 UTL os version: #1 SMP Mon Jun 30 12:09:22 UTC 2014 02/29 20:35:26.645697 4129 7f0288075740 UTL os machine: x86_64 02/29 20:35:26.645700 4129 7f0288075740 UTL ================================== 02/29 20:35:26.645702 4129 7f0288075740 DND Server IP address is:10.173.32.11 02/29 20:35:26.645709 4129 7f0288075740 DND starting to initialize TDengine ... 02/29 20:35:26.645944 4129 7f0288075740 MND starting to initialize TDengine mgmt ... 02/29 20:35:26.646738 4129 7f0288075740 MND dnode first access, set total vnodes:128 02/29 20:35:26.658091 4129 7f0288075740 MND TDengine mgmt is initialized successfully 02/29 20:35:26.662274 4129 7f0288075740 DND vid:0, cache pool is allocated:0x1ffd180 02/29 20:35:26.662404 4129 7f0288075740 DND vid:0, commit log is initialized 02/29 20:35:26.662416 4129 7f0288075740 DND vid:0, storage initialized, version:31 fileId:0 numOfFiles:0 02/29 20:35:26.662863 4129 7f0288075740 DND vid:0, status:offline, start to open 02/29 20:35:26.662924 4129 7f0288075740 DND vid:0, sessions:33, shell is opened 02/29 20:35:26.662932 4129 7f0288075740 DND vid:0, status:master numOfPeers:0 02/29 20:35:26.662936 4129 7f0288075740 DND vid:0, stream role is changed from stop to start 02/29 20:35:26.662941 4129 7f0288075740 DND vid:0, vnode is opened, openVnodes:1, status:master 02/29 20:35:26.662951 4129 7f0288075740 DND vnode is initialized successfully 02/29 20:35:26.662959 4129 7f0288075740 HTP starting to initialize http service ... 02/29 20:35:26.665782 4129 7f0288075740 DND TDengine is initialized successfully 02/29 20:35:26.665820 4129 7f0263e5c700 HTP http service init success at ip:0.0.0.0:6020 02/29 20:35:26.676859 4129 7f0279633700 MON starting to initialize monitor service .. 02/29 20:35:26.677200 4129 7f027de3c700 MND user:monitor login from 10.173.32.11, code:0 02/29 20:35:26.678727 4129 7f027060d700 MON dnode:10.173.32.11 is started 02/29 20:35:26.681105 4129 7f026f60b700 MON monitor service init success |
就可以了。
【后记】
去启动服务器端
之前是直接运行
1 | taosd |
此处不这么操作,去作为系统服务器启动
1 | systemctl start taosd |
没有任何输出:
1 | [root@xxx tdengine] # systemctl start taosd |
然后再去看看状态:
1 2 3 4 5 6 7 8 9 10 11 | [root@xxx tdengine] # systemctl status taosd ● taosd.service - TDengine server service Loaded: loaded (/etc/systemd/system/taosd.service; enabled; vendor preset: disabled) Active: active (running) since 日 2020-03-01 11:00:51 CST; 7s ago Main PID: 8331 (taosd) CGroup: /system.slice/taosd.service └─8331 /usr/bin/taosd 3月 01 11:00:51 xxx.localdomain systemd[1]: Started TDengine server service. 3月 01 11:00:51 xxx.localdomain TDengine:[8331]: Starting TDengine service... 3月 01 11:00:52 xxx.localdomain TDengine:[8331]: Started TDengine service successfully. |

【总结】
启动TDengine的服务端的方式是:
方式1:(推荐)作为系统服务去启动运行
1 | systemctl start taosd |
启动后,去查看状态,确认已正在运行:
1 | systemctl status taosd |
看到
Active: active (running)
即可。
注:如果系统没有systemctl的话,则需要去安装
此处CentOS中是:
1 | yum install systemd |
注:systemctl包含在systemd工具中
方式2:手动的、单次的、直接的、运行
1 | taosd |
注意:
如果Control+C去关闭掉,可能会导致:
后台其实还在运行,会导致:
下次再运行会失败,会报错:
- 指示正在运行的文件已存在:/var/lib/taos/.running
- 解决办法:删除掉
- rm -rf /var/lib/taos/.running
- 端口被占用
- 解决办法:杀掉
- ps aux | grep tao
- 能看到对应的pid
- kill -9 tao_pid
转载请注明:在路上 » 【已解决】启动TDengine的服务端taosd