doris manager 安装部署 、管理已有doris集群、使用studio进行SQL查询

前言

由于doris 自带的fe 控制台不是很好用,在社区了解到可以通过 doris manager来管理已有集群 同时 可以使用studio 控制查询SQL 特此记录

部署 Doris Manager

1、 下载安装包

下载并解压 Doris Manager 安装包。 下载地址参见: https://selectdb.com/download/enterprise#manager

本示例解压命令

shell 复制代码
tar -zxvf ./doris-manager-24.3.1-x64-bin.tar.gz -C /usr/local/develop

安装包目录结构如下:

├── agent ## anget directory

│ ├── install.sh

│ ├── manager-agent-24.2.0-x64-bin.tar.gz

│ └── validation.sh

├── deps ## Third-Party Dependency Directory

│ ├── alertmanager

│ ├── foundationdb-7.1.38.tar.gz

│ ├── grafana

│ ├── jdk

│ ├── jdk17

│ ├── prometheus

│ └── webui

├── LICENSE

└── webserver ## WebServer directory

├── bin

├── conf

├── config-tool

├── inspection

├── lib

└── static

2 、启动 WebServer 组件

  • cd 解压后的目录 本示例地址如下

    shell 复制代码
    cd /usr/local/develop/doris-manager-24.3.1-x64-bin

配置 WebServer 服务(可选)

修改 webserver/conf/manager.conf 文件可以配置 WebServer 服务,配置说明如下:

配置 默认值 说明

MANAGER_PORT 8004 Doris Manager Web 服务组件监听的端口

DB_TYPE h2 服务依赖的数据库类型:mysql、h2 或者 postgresql

DATA_PATH .../data Manager 元数据存储路径,只在 DB_TYPE 为 h2 时生效

DB_HOST - 数据库的访问地址,只在 DB_TYPE 为 mysql/postgresql 时生效

DB_PORT - 数据库的访问端口,只在 DB_TYPE 为 mysql/postgresql 时生效

DB_USER - 数据库的访问用户,只在 DB_TYPE 为 mysql/postgresql 时生效

DB_PASS - 数据库的访问密码,只在 DB_TYPE 为 mysql/postgresql 时生效

DB_DBNAME - 数据库的访问库名,只在 DB_TYPE 为 mysql/postgresql 时生效

DB_URL_SUFFIX - MySQL 数据连接 URL 的后缀

HTTP_CONNECT_TIMEOUT 30 HTTP 握手超时时间(单位为秒)

HTTP_SOCKET_TIMEOUT 60 配置 HTTP 接收响应超时时间(单位为秒)

LISTEN_PROTOCOL ALL 服务监听的 IP 协议,支持 ALL、IPV4 和 IPV6,ALL 表示同时支持 IPV4 和 IPV6

FE_MIN_DISK_SPACE_FOR_UPGRADE 10 升级时 FE 模块安装路径最小的空余磁盘空间(单位为 GB)

BE_MIN_DISK_SPACE_FOR_UPGRADE 10 升级时 BE 模块安装路径最小的空余磁盘空间(单位为 GB)

  • 启动 WebServer 服务
    通过以下命令可以启动 WebServer 服务,启动后可以观察 MANAGER_PORT 端口情况,默认为 8004:
shell 复制代码
webserver/bin/start.sh
  • 启动完成后访问web-ui ip:8004 进行初始化 Doris Manager 管理员账户

    第一次访问 Web 服务,进入初始化用户页面,创建第一个 Doris Manager 管理员用户。Doris Manager 管理员账户独立于集群账户,只用于 Manager 权限管控。

  • 配置服务组件部署信息

以下页面可以配置服务信息:配置说明如下:

配置 说明

监控告警服务 可选项,用于配置 Doris Manager 的监控告警模块,会安装 Grafana、Prometheus、Alertmanager,需要在安装 Doris Manager 的机器上选择三个可用的端口。

邮件告警 配置邮件服务器,随后可以使用告警中的"邮件告警"渠道。

代理配置 如果生产环境和外网隔离,可以设置代理发送通知到公网办公通讯软件。

安装包配置 配置本地的 Doris Core、Doris Manager 安装包存放路径,用于新建、升级集群。

重要的说明 安装包配置
这个是下载解压后安装的目录 不是其描述的安装包!
这个是下载解压后安装的目录 不是其描述的安装包!
这个是下载解压后安装的目录 不是其描述的安装包!

重要事 说3遍

配置完成选择 启动 doris manager

配置 Doris Manager 接管已有doris集群

选择接管集群

检查参数以及agent状态

没问题的情况下 状态都应该是正常

agent 提示异常 请使用 agent一键部署

另外参数修改 请按照问题里的记录

检测通过后 便可以成功接管

接管处理

接管成功

进入集群

后续可以查看监控 日志 巡检 任务功能 等

使用studio来查询 SQL

点击studio 即可进去到 studio页面

studio页面

SelectDB Studio 内置 SQL 编辑器深度适配 Apache Doris 生态,支持 Apache Doris 的所有数据类型、SQL 语法与数据库对象,提供语法高亮、自动补全、脚本格式化、会话记录、查询记录、查询模板等功能,显著提升用户 SQL 编写效率。

Apache Doris 及其兼容数据库用户可使用 SelectDB Studio SQL 编辑器功能实现数据库联邦查询与湖仓一体分析:

数据库联邦查询:通过 External Catalog 功能,映射 MySQL、PostgreSQL、Oracle、SQL Server、OceanBase 等数据源作为外表,实现与常见数据库的联邦查询;

湖仓一体分析:通过 External Catalog 功能,映射 Hive、Iceberg、Hudi、Paimon、Deltalake、Trino、Presto 等数据源作为外表,实现与常见数据湖的湖仓一体分析。

后面即可愉快的查询SQL了 会有提示以及检测 方便多了

桌面版本studio

1、下载地址 https://www.selectdb.com/studio-desktop#download-client

2、安装 。。。

3、新建连接

4、点击创建好的连接 连接

其余功能 都和 doris manager里面的 studio功能一致

问题记录

1、配置参数问题

max map count 虚拟内存区域数量 2000000

max opened files 系统最大打开文件句柄数 65536

swap memory 内存交换分区 0

transparent hugepage 透明大页 never

1.1 、配置 max map count (虚拟内存区域数量)
Bash 复制代码
# 临时生效(立即应用)
sudo sysctl -w vm.max_map_count=2000000

# 永久生效
echo "vm.max_map_count=2000000" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
# 验证
sysctl vm.max_map_count
# 应输出:vm.max_map_count = 2000000
1.2 、配置 max opened files (系统最大打开文件句柄数)
shell 复制代码
# 全局文件句柄限制
echo "fs.file-max=6553600" | sudo tee -a /etc/sysctl.conf

# 用户级限制
echo "* soft nofile 65536" | sudo tee -a /etc/security/limits.conf
echo "* hard nofile 65536" | sudo tee -a /etc/security/limits.conf
echo "root soft nofile 65536" | sudo tee -a /etc/security/limits.conf
echo "root hard nofile 65536" | sudo tee -a /etc/security/limits.conf

# 应用配置
sudo sysctl -p
sudo systemctl restart systemd-sysctl
# 验证命令:
ulimit -n
# 应输出:65536

cat /proc/sys/fs/file-max
# 应输出:6553600
1.3 、关闭 swap memory (内存交换分区)
shell 复制代码
# 临时关闭所有 swap
sudo swapoff -a

# 永久关闭(从 fstab 中移除 swap)
sudo sed -i '/swap/d' /etc/fstab

# 验证
free -h | grep Swap
# 应显示:Swap: 0B 0B 0B
1.4、 禁用 transparent hugepage (透明大页)
shell 复制代码
# 创建 systemd 服务确保开机生效
sudo tee /etc/systemd/system/disable-thp.service > /dev/null <<'EOF'
[Unit]
Description=Disable Transparent Huge Pages (THP)
After=sysinit.target

[Service]
Type=oneshot
ExecStart=/bin/sh -c "echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled"
ExecStart=/bin/sh -c "echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag"

[Install]
WantedBy=multi-user.target
EOF

# 启用服务
sudo systemctl daemon-reload
sudo systemctl enable disable-thp.service
sudo systemctl start disable-thp.service

# 手动应用(立即生效)
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
验证命令:

Bash
cat /sys/kernel/mm/transparent_hugepage/enabled
# 应输出:always madvise [never]

cat /sys/kernel/mm/transparent_hugepage/defrag
# 应输出:always madvise [never]

修改完成可以直接执行脚本检测

shell 复制代码
wget http://192.168.104.78:8004/api/download/validation.sh -O check_env.sh && chmod +x check_env.sh && sudo ./check_env.sh

没问题 提示如下

2、提示 [ERROR] command crontab not found, please install it or check privilege

shell 复制代码
# apt 更新 安装cron
sudo apt update
sudo apt install cron -y
# 启动并启用 cron 服务
sudo systemctl start cron
sudo systemctl enable cron
# 状态检查
sudo systemctl status cron

3、当前Doris集群进程的conf配置文件中 storage_root_path 未配置

be 增加配置

storage_root_path = ${DORIS_HOME}/storage

相关推荐
Faith_xzc20 天前
Apache Doris FE 问题排查与故障分析全景指南
大数据·数据仓库·apache·doris
江畔独步22 天前
Doris与DS结合实现MySQL侧的Upsert功能
数据仓库·mysql·doris·upsert
涤生大数据1 个月前
Apache Doris 在数据仓库中的作用与应用实践
数据仓库·apache·doris
IT成长日记1 个月前
【Doris基础】Doris中的Replica详解:Replica原理、架构
apache·doris·replica
IT成长日记1 个月前
【Doris基础】Apache Doris中的Coordinator节点作用详解
apache·doris·coordinator
IT成长日记1 个月前
【Doris基础】Apache Doris vs 传统数据仓库:架构与性能的全面对比
数据仓库·架构·doris·doris vs 传统数据仓库
IT成长日记1 个月前
【Doris基础】Doris中的Tablet详解:核心存储单元的设计与实现
apache·doris·tablet
IT成长日记1 个月前
【Doris基础】Apache Doris中FE和BE的职责详解
apache·doris·be·fe·职责
IT成长日记1 个月前
【Doris入门】Doris初识:分布式分析型数据库的核心价值与架构解析
数据库·分布式·架构·doris