在使用tdengine 数据库时出现了
TDengine.Driver.TDengineError:"code:[0x334],error:Out of dnodes"
查找文档发现需要修改一个配置文件 。
/etc/taos/taos.cfg 中的 supportVnodes 参数
于是修改
保存。然后,运行出错。
03/21 06:56:27.986498 00000064 UTL apoll url not load
03/21 06:56:27.986572 00000064 UTL load from cfg file /etc/taos//taos.cfg success
03/21 06:56:27.986582 00000064 UTL env file:.env not load
03/21 06:56:27.986648 00000064 UTL load from env variables cfg success
03/21 06:56:27.986972 00000064 DND startup path:/root args:taosd
03/21 06:56:27.987547 00000064 UTL apoll url not load
03/21 06:56:27.987588 00000064 UTL ERROR cfg:supportVnodes, type:int32 src:cfg_file value:99990 out of range[0, 4096]
03/21 06:56:27.987707 00000064 UTL ERROR failed to load from cfg file /etc/taos//taos.cfg since Out of range
03/21 06:56:27.987716 00000064 UTL ERROR failed to load from cfg file:/etc/taos//taos.cfg since Out of range
03/21 06:56:27.987720 00000064 UTL ERROR failed to load cfg since Out of range
03/21 06:56:27.987733 00000064 DND ERROR failed to start since read config error
[root@t224yuntu1 ~]# docker exec -it tdengine /bin/bash
Error response from daemon: Container 2adfe16473d9885cd0b9a7e5668a051be711be5fcf6ab17f88a955f4f9b95a02 is not running
好吧。docker start不起来,exec bash进不去,造成无法再改里面的文件,已经玩坏了。由于数据很重要所以需要恢复。
采用了以下方式来恢复
1,docker ps --a 可以查到所有docker,包括没有运行的,找到containner ID
2,用docker CP命令,往出来拷文件,改好后,再拷进去 。
以tdengine 为例 docker ps -a | grep 'tdengine' 查找到tdengine 的内容
[root@t224yuntu1 ~]# docker ps -a | grep 'tdengine' 2adfe16473d9 tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 5 hours ago Exited (255) 13 minutes ago tdengine 62e9559efb65 tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 23 hours ago Exited (129) 20 hours ago busy_snyder 9cc5cd51f171 tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 23 hours ago Exited (255) 23 hours ago vigilant_sammet e89a0b43d714 tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 23 hours ago Exited (255) 23 hours ago affectionate_jepsen 68b78dee050e tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 23 hours ago Exited (255) 23 hours ago fervent_hypatia 8579cc938163 tdengine/tdengine:3.1.1.0 /tini -- /usr/bin/e... 24 hours ago Exited (129) 23 hours ago angry_chatterjee
使用doker cp 来复制文件
[root@t224yuntu1 ~]# docker cp tdengine:/etc/taos/taos.cfg /home Successfully copied 7.17kB to /home [root@t224yuntu1 ~]# cd /home [root@t224yuntu1 home]# ll 总用量 8 -rw-r--r-- 1 root root 5532 3月 21 14:56 taos.cfg
再次文件进行修改,
修改后将文件复制到docker 容器中
[root@t224yuntu1 home]# docker cp taos.cfg tdengine:/etc/taos/taos.cfg Successfully copied 7.17kB to tdengine:/etc/taos/taos.cfg
再次使用 docker restart tdengine
查看OK