Skip to content

1. 修改inflxudb存储路径

bash
mkdir -p /data/influxdb_data/influxdb/meta

mkdir -p /data/influxdb_data/influxdb/data

mkdir -p /data/influxdb_data/influxdb/wal

mkdir -p /data/influxdb_data/logs


ln -sv /data/influxdb_data/logs /var/log/influxdb

chown -R influxdb /data/influxdb_data

systemctl start influxdb


[meta]
  dir = "/data/influxdb_data/influxdb/meta"

[data]
  dir = "/data/influxdb_data/influxdb/data"

  wal-dir = "/data/influxdb_data/influxdb/wal"



#backup
influxd backup -portable -database MarketBiyin /data/backup/MarketBiyin

#restore
influxd restore -portable -db ProxyMarket -newdb ProxyMarket /tmp/ProxyMarket_back
mkdir -p /data/influxdb_data/influxdb/meta

mkdir -p /data/influxdb_data/influxdb/data

mkdir -p /data/influxdb_data/influxdb/wal

mkdir -p /data/influxdb_data/logs


ln -sv /data/influxdb_data/logs /var/log/influxdb

chown -R influxdb /data/influxdb_data

systemctl start influxdb


[meta]
  dir = "/data/influxdb_data/influxdb/meta"

[data]
  dir = "/data/influxdb_data/influxdb/data"

  wal-dir = "/data/influxdb_data/influxdb/wal"



#backup
influxd backup -portable -database MarketBiyin /data/backup/MarketBiyin

#restore
influxd restore -portable -db ProxyMarket -newdb ProxyMarket /tmp/ProxyMarket_back

http://blog.51cto.com/10880347/2306804

#修改influxdb日志

vi /etc/rsyslog.d/influxdb.conf

### InfluxDB Rules ###
if $programname == 'influxd' then {
   action(type="omfile" file="/var/log/influxdb/influxd.log")
   stop
}
### InfluxDB Rules ###
if $programname == 'influxd' then {
   action(type="omfile" file="/var/log/influxdb/influxd.log")
   stop
}

重启systemctl stop rsyslog 和influxdb