插入数据(python接口)
data = "mycomputer,uuser=yzh cpu={}".format(cpu)
async with session.post("http://localhost:8086/write?db=test",
data=data) as resp:
pass
插入取样
create continuous query cpu_1 on test
begin
select mean(cpu) into cpu_1min from mycomputer group by time(1m)
end
查询
# 查询表
show measurements;
# 查询series
show series from test;
# 查询continuous queries
show continuous queries
select * from mycomputer where uuser='yzh'
删库跑路
drop database test
drop measurement mycomputer;
添加用户
CREATE USER ti_monitor WITH PASSWORD 'ti-matrix' WITH ALL PRIVILEGES
telegraph
安装
wget https://dl.influxdata.com/telegraf/releases/telegraf_1.3.0-1_amd64.deb
dpkg -i telegraf_1.3.0-1_amd64.deb
修改配置:定位到
outputs.influxdb
然后service telegraf restart
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有