influxdb数据库损坏重建索引方法

问题描述:项目服务器断电或者中毒,导致influxdb数据库损坏,influxdb数据库无法启动,平台无法连接influxdb数据库;
解决方法:
1、查看influxdb数据库服务是否还存在,如果存在找到进程并kill进程;

  1. ps -ef |grep influxdb
  2. kill -9 (对应influxdb数据库pid进程)

2、删除所有_series 文件夹;默认保存在/home/seekcy/database/influxdb/data/js_open_location中

  1. cd /home/seekcy/database/influxdb/data/js_open_location
  2. rm -rf _series
  3. /home/seekcy/database/influxdb/data/_internal
  4. rm -rf _series

3、使用以下命令重建influxdb数据库索引;

  1. influx_inspect buildtsi \
  2. -datadir /home/seekcy/database/influxdb/data \
  3. -waldir /home/seekcy/database/influxdb/wal

4、使用以下命令重启influxdb;

  1. # 切换到InfluxDB目录
  2. cd /home/seekcy/database/influxdb/bin
  3. # 启动InfluxDB
  4. nohup ./influxd -config ../influxdb.conf &

5、重启完成后执行diyib第一步查看influxdb是否正常启动;
ZGL(260601)

转载请注明作者和出处,并添加本页链接。
原文链接: //svn.seekcy.com/897