doris常用命令

# 连接
mysql -uroot -P9030 -h127.0.0.1

# 添加be节点
ALTER SYSTEM ADD BACKEND "10.0.0.201:9050";

# 删除be节点出现以下错误信息:解决:drop需要再加一个P,为dropp

1105 - errCode = 2, detailMessage = It is highly NOT RECOMMENDED to use DROP BACKEND stmt.It is not safe to directly drop a backend. All data on this backend will be discarded permanently. If you insist, use DROPP BACKEND stmt (double P).

# 查看数据库
mysql> show databases;

# 删除数据库
mysql> drop database game_alex;

Doris导出导入数据:

# 导出game_alex库的所有表
mysqldump -h127.0.0.1 -P9030 -uroot --no-tablespaces --databases game_alex > game_alex.sql

# 将原3副本改为1
sed -i 's/tag.location.default: 3/tag.location.default: 1/g' game_alex.sql

# 导入数据
mysql -h127.0.0.1 -uroot -P9030 < game_alex.sql

# 导出并压缩
mysqldump -h127.0.0.1 -P9030 -uroot --no-tablespaces --databases game_alex | gzip > /data/backup/game_alex.gz

# 解压并导入
gunzip < game_alex.gz | mysql -h127.0.0.1 -uroot -P9030

doris常见错误:
https://blog.csdn.net/qq_31866793/article/details/109337746

# 用户管理
## 创建新用户
mysql> CREATE USER 'game_alex_pre' IDENTIFIED BY 'gfU23aoNyZm8xnIN';
## 授权
mysql> GRANT ALL ON game_alex TO game_alex_pre;

# 查询优化

参考:
https://doris.apache.org/zh-CN/docs/dev/advanced/cache/partition-cache
https://cloud.tencent.com/document/product/1387/80304

mysql -uroot -P9030 -h127.0.0.1
set global enable_sql_cache=true;

set global enable_partition_cache=true;

fe监控:
curl -s http://127.0.0.1:8030/metrics|grep query_table # Query中有表的数量
curl -s http://127.0.0.1:8030/metrics|grep query_olap_table # Query中有Olap表的数量

curl -s http://127.0.0.1:8030/metrics|grep cache_mode_sql # 识别缓存模式为sql的Query数量
curl -s http://127.0.0.1:8030/metrics|grep cache_hit_sql # 模式为sql的Query命中Cache的数量

curl -s http://127.0.0.1:8030/metrics|grep query_mode_partition # 识别缓存模式为Partition的Query数量
curl -s http://127.0.0.1:8030/metrics|grep cache_hit_partition # 通过Partition命中的Query数量

curl -s http://127.0.0.1:8030/metrics|grep partition_all # Query中扫描的所有分区
curl -s http://127.0.0.1:8030/metrics|grep partition_hit # 通过Cache命中的分区数量

be监控:
curl -s http://127.0.0.1:8040/metrics |grep query_cache_memory_total_byte #Cache内存大小
curl -s http://127.0.0.1:8040/metrics |grep query_cache_sql_total_count #Cache的SQL的数量
curl -s http://127.0.0.1:8040/metrics |grep query_cache_partition_total_count #Cache分区数量

 

版权声明:
作者:admin
链接:https://www.chenxie.net/archives/2707.html
来源:蜀小陈
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>
文章目录
关闭
目 录