惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
Jina AI
Jina AI
博客园_首页
M
MIT News - Artificial intelligence
D
DataBreaches.Net
L
LangChain Blog
宝玉的分享
宝玉的分享
F
Fortinet All Blogs
A
About on SuperTechFans
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
腾讯CDC
Vercel News
Vercel News
雷峰网
雷峰网
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】

博客园 - Morya

不当心升级到 redis 7.4 怎么回到 valkey8 使用 cert-manager 为 traefik 自动申请和续约 https 证书 traefik学习 k8s 1.28 安装配置 knative-serving v1.15.2 + cert-manager v1.16.1 ssh端口映射玩法 golang echo group 用法的微妙注意点 使用docker最小化部署Git CI环境 使用mailpopbox构建个人独享EmailServer 通过php docker快速验证简单代码 通过k8s service代理外部服务 run gitlab-runner in k8s K8S配置traefik ingressroutes支持TLS ucloud k8s部署traefik的forward-auth 使用nginx构建限频、限速、限并发的应用保护层 macos 更改罗技k810无线键盘的映射 - Morya - 博客园 C++11 thread condition_variable mutex 综合使用 goland scope pattern 设置 Go 1.11 Module 介绍 - Morya hustOJ 添加 golang 支持
Influx cli cheetsheet
Morya · 2021-01-20 · via 博客园 - Morya

Influx cli cheetsheet

-- 管理用户
CREATE USER "hsj" WITH PASSWORD 'hsj'
CREATE USER "zx" WITH PASSWORD 'zx'

--- 创建admin账号
CREATE USER "todd" WITH PASSWORD '123456' WITH ALL PRIVILEGES

-- 管理用户权限
grant ALL on "online_peak" to "hsj"
GRANT ALL PRIVILEGES TO "todd"

revoke all on "onlinecount" from "hsj"
revoke all on "onlinecount" from "zx"
revoke all on "_internal" from "zx"
revoke all on "_internal" from "hsj"

-- 管理db
create database "online_peak"
drop database "online_peak"

-- 管理 RETENTION POLICY
CREATE RETENTION POLICY "two_hours" on "online_peak" DURATION 2h REPLICATION 1 [DEFAULT] 
--- 给定default参数,则把当前RP设置为db的默认rp,否则只创建,不设置default

-- 管理 CONTINUOUS QUERY
CREATE CONTINUOUS QUERY "cq_team_peak" ON "onlinecount" BEGIN select sum(all_user) as max_user, team_id  into onlinecount.one_month.team_peak_minute  from room_stat  group by time(5m), team_id  END

CREATE CONTINUOUS QUERY "cq_team_peak_5m" ON "onlinecount" BEGIN select sum(all_user) as max_user,team_id  into onlinecount..team_peak_5m  from room_stat  group by time(5m),team_id END

-- 其它配置
precision rfc3339  -- 设置时间显示格式为rfc3339  --> 2021-01-20T10:17:00Z

-- 查看当前配置
settings
--------          --------
Host              172.16.210.109:8086
Username          zx
Database          zx
RetentionPolicy
Pretty            false
Format            column
Write Consistency all
Chunked           true
Chunk Size        0


-- 查看各种参数
show MEASUREMENTS
show CONTINUOUS QUERIES
show RETENTION POLICIES

-- 从一个表导出数据到其它位置
-- 导出到另外一个measurement
-- 导出到另外 rp 下 measurements
-- 导出到别的 db 下
select sum(all_user) as "team_peak" from room_stat_1m where (time >= '2021-01-20T06:10:00Z') and (time < '2021-01-20T07:10:00Z' ) and team_id = '1005' limit 30

select sum("all_user") as "team_peak" into  "team_stat_1m"  from "room_stat_1m" where (time >= '2021-01-20T06:10:00Z') and (time < '2021-01-20T07:10:00Z' ) group by time(1m), "team_id"