安装教程
Debian 9 安装服务端和客户端:apt update && apt install influxdb influxdb-client
启动 InfluxDB 服务:systemctl start influxdb
或者 service influxdb start
基本操作
客户端常用命令:
命令 | 说明 |
---|---|
influx | 打开客户端 |
create database "db_name" | 创建数据库 |
show databases | 显示所有数据库 |
drop database "db_name" | 删除数据库 |
use db_name | 使用数据库 |
insert meas_name,id=uid_081104,name=test count=1 | 插入数据(自动创建数据表) |
show measurements | 显示所有数据表 |
drop measurement "meas_name" | 删除数据表 |
服务端常用命令:
命令 | 说明 |
---|---|
influxd backup ./db_backup | 备份全部数据库 |
influxd backup -database db_name ./db_name_backup | 备份指定数据库 |
参考文档:Installation | InfluxData Documentation
apt update
apt install curl apt-transport-https -y
For instructions on how to install the Debian package from a file, please see the downloads page.
Debian and Ubuntu users can install the latest stable version of InfluxDB using the apt-get
package manager.
For Ubuntu users, add the InfluxData repository with the following commands:
curl -sL https://mirrors.tuna.tsinghua.edu.cn/influxdata/influxdb.key | sudo apt-key add -
source /etc/lsb-release
echo "deb https://mirrors.tuna.tsinghua.edu.cn/influxdata/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
For Debian users, add the InfluxData repository:
curl -sL https://mirrors.tuna.tsinghua.edu.cn/influxdata/influxdb.key | sudo apt-key add -
source /etc/os-release
test $VERSION_ID = "7" && echo "deb https://mirrors.tuna.tsinghua.edu.cn/influxdata/debian wheezy stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
test $VERSION_ID = "8" && echo "deb https://mirrors.tuna.tsinghua.edu.cn/influxdata/debian jessie stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Then, install and start the InfluxDB service:
sudo apt-get update && sudo apt-get install influxdb
sudo service influxdb start
Or if your operating system is using systemd (Ubuntu 15.04+, Debian 8+):
sudo apt update && sudo apt install influxdb
sudo systemctl start influxdb
版权属于:wshon
本文链接:https://blog.wshon.com/2018/05/influxdb-setup.html
转载时须注明出处及本声明
最新回复