1. Doris分布式环境搭建

一. 环境准备

本次测试集群采用3台机器hadoop1、hadoop2、hadoop3, Frontend和Backend部署在同一台机器上,Frontend部署3台组成高可用,Backend部署3个节点,组成3副本存储。

主机IP操作系统FrontendBackend
hadoop1192.168.47.128Centos7FollowerBE1
hadoop2192.168.47.129Centos7FollowerBE2
hadoop3192.168.47.130Centos7FollowerBE3

1.安装JDK8,具体的安装过程这里不赘述。
2.安装mysql客户端,具体的安装过程这里不赘述。
3.关闭交换分区
在三台主机分别执行如下命令

# hadoop1关闭swap分区
[root@hadoop1 ~]# swapoff -a
# hadoop2关闭swap分区
[root@hadoop2 ~]# swapoff -a
# hadoop3关闭swap分区
[root@hadoop3 ~]# swapoff -a

4.关闭防火墙

# hadoop1关闭防火墙
[root@hadoop1 ~]# systemctl  stop firewalld
# hadoop2关闭防火墙
[root@hadoop2 ~]# systemctl  stop firewalld
# hadoop3关闭防火墙
[root@hadoop3 ~]# systemctl  stop firewalld

5.设置系统最大打开文件句柄数
三台主机都执行如下命令

vi /etc/security/limits.conf 
* soft nofile 1000000
* hard nofile 1000000

6.修改虚拟内存区域数量为

# hadoop1修改内存区域
[root@hadoop1 ~]# sysctl -w vm.max_map_count=2000000
vm.max_map_count = 2000000
# hadoop2修改内存区域
[root@hadoop2 ~]# sysctl -w vm.max_map_count=2000000
vm.max_map_count = 2000000
# hadoop3修改内存区域
[root@hadoop3 ~]# sysctl -w vm.max_map_count=2000000
vm.max_map_count = 2000000

7.关闭透明大页
三台主机都执行如下命令

echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

二. 集群部署

1.下载Doris安装包,并解压

[root@hadoop1 opt]# wget https://apache-doris-releases.oss-accelerate.aliyuncs.com/apache-doris-2.0.3-bin-x64.tar.gz
[root@hadoop1 opt]# tar xf apache-doris-2.0.3-bin-x64.tar.gz
[root@hadoop1 opt]# mv apache-doris-2.0.3-bin-x64 doris-2.0.3

2.修改配置,同步安装包到另外两台主机

# 修改FE配置
[root@hadoop1 doris-2.0.3]# vim fe/conf/fe.conf
priority_networks = 192.168.47.0/24
# 修改BE配置
[root@hadoop1 doris-2.0.3]# vim be/conf/be.conf
priority_networks = 192.168.47.0/24

#将安装包同步到hadoop2和hadoop3
[root@hadoop1 opt]# scp -r doris-2.0.3/ root@hadoop2:/opt
[root@hadoop1 opt]# scp -r doris-2.0.3/ root@hadoop3:/opt

3.启动 FE Master 节点
前面集群规划时选择hadoop3作为Frontend Master节点,因此先在hadoop3启动Frontend。

[root@hadoop3 doris-2.0.3]# ./fe/bin/start_fe.sh --daemon

使用mysql客户端连接Frontend并修改root用户的密码

[root@hadoop3 doris-2.0.3]# mysql -uroot -P9030 -h hadoop3 -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>  SET PASSWORD FOR 'root' = PASSWORD('root123'); 

4.启动BE进程并注册
三台主机分别启动Backend

# hadoop1启动be
[root@hadoop1 doris-2.0.3]# ./be/bin/start_be.sh --daemon
# hadoop2启动be
[root@hadoop2 doris-2.0.3]# ./be/bin/start_be.sh --daemon
# hadoop3启动be
[root@hadoop3 doris-2.0.3]# ./be/bin/start_be.sh --daemon

三个Backend分别向hadoop3 Frontend注册

[root@hadoop3 doris-2.0.3]# mysql -uroot -P9030 -h 192.168.47.130 -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 三个BE分别注册
mysql> ALTER SYSTEM ADD BACKEND "192.168.47.128:9050";
Query OK, 0 rows affected (0.02 sec)

mysql> ALTER SYSTEM ADD BACKEND "192.168.47.129:9050";
Query OK, 0 rows affected (0.02 sec)

mysql> ALTER SYSTEM ADD BACKEND "192.168.47.130:9050";
Query OK, 0 rows affected (0.01 sec)

# 查看已经注册的BE
mysql> SHOW BACKENDS;
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
| BackendId | Host           | HeartbeatPort | BePort | HttpPort | BrpcPort | LastStartTime       | LastHeartbeat       | Alive | SystemDecommissioned | TabletNum | DataUsedCapacity | TrashUsedCapcacity | AvailCapacity | TotalCapacity | UsedPct | MaxDiskUsedPct | RemoteUsedCapacity | Tag                      | ErrMsg | Version                  | Status                                                                                                                        | HeartbeatFailureCounter | NodeRole |
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
| 11128     | 192.168.47.128 | 9050          | 9060   | 8040     | 8060     | 2025-01-10 00:37:03 | 2025-01-10 00:45:32 | true  | false                | 24        | 29.771 KB        | 0.000              | 24.742 GB     | 38.278 GB     | 35.36 % | 35.36 %        | 0.000              | {"location" : "default"} |        | doris-2.0.3-rc06-37d31a5 | {"lastSuccessReportTabletsTime":"2025-01-10 00:44:38","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} | 0                       | mix      |
| 11129     | 192.168.47.129 | 9050          | 9060   | 8040     | 8060     | 2025-01-10 00:37:12 | 2025-01-10 00:45:32 | true  | false                | 24        | 29.771 KB        | 0.000              | 23.307 GB     | 38.278 GB     | 39.11 % | 39.11 %        | 0.000              | {"location" : "default"} |        | doris-2.0.3-rc06-37d31a5 | {"lastSuccessReportTabletsTime":"2025-01-10 00:44:40","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} | 0                       | mix      |
| 11130     | 192.168.47.130 | 9050          | 9060   | 8040     | 8060     | 2025-01-10 00:37:35 | 2025-01-10 00:45:32 | true  | false                | 24        | 29.771 KB        | 0.000              | 23.814 GB     | 38.278 GB     | 37.79 % | 37.79 %        | 0.000              | {"location" : "default"} |        | doris-2.0.3-rc06-37d31a5 | {"lastSuccessReportTabletsTime":"2025-01-10 00:45:05","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false} | 0                       | mix      |
+-----------+----------------+---------------+--------+----------+----------+---------------------+---------------------+-------+----------------------+-----------+------------------+--------------------+---------------+---------------+---------+----------------+--------------------+--------------------------+--------+--------------------------+-------------------------------------------------------------------------------------------------------------------------------+-------------------------+----------+
3 rows in set (0.02 sec)

5.FE Follower注册与启动
对Hadoop1和hadoop2的Follower进行注册

[root@hadoop3 doris-2.0.3]# mysql -uroot -P9030 -h 192.168.47.130 -p
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 两个Follower分别注册
mysql> ALTER SYSTEM ADD FOLLOWER "192.168.47.128:9010";
Query OK, 0 rows affected (0.02 sec)

mysql> ALTER SYSTEM ADD FOLLOWER "192.168.47.129:9010";
Query OK, 0 rows affected (0.02 sec)

启动hadoop1和haoop2上的Frontend进程,第一次启动时需要从hadoop3同步元数据。

# 同步元数据
[root@hadoop1 fe]# ./bin/start_fe.sh --helper 192.168.47.130:9010 --daemon
[root@hadoop2 fe]# ./bin/start_fe.sh --helper 192.168.47.130:9010 --daemon

# 非第一次启动
[root@hadoop1 fe]# ./bin/start_fe.sh  --daemon
[root@hadoop2 fe]# ./bin/start_fe.sh  --daemon

此时可以登录到集群的web管理页面上查看集群Backend和Frontend的状态,入口地址为http://192.168.47.130:8030/login

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

6.验证集群功能
集群搭建完成后,下面进行集群功能验证。

[root@hadoop3 doris-2.0.3]# mysql -uroot -P9030 -h hadoop3 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.99 Doris version doris-2.0.3-rc06-37d31a5

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 创建数据库
mysql> create database testdb;
Query OK, 0 rows affected (0.01 sec)

# 创建测试表
mysql> USE testdb;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t1
(
    id INT,
    name VARCHAR(100) 
) DISTRIBUTED BY HASH(id) BUCKETS 10;

# 插入数据
mysql> INSERT INTO t1 values(1, 'name1'), (2, 'name2'), (3, 'name3'), (4, 'name4');
Query OK, 4 rows affected (0.53 sec)
{'label':'insert_9a435c2107994208_b19dcc43b6a92119', 'status':'VISIBLE', 'txnId':'2004'}


# 查询数据
mysql> select * from t1;
+------+-------+
| id   | name  |
+------+-------+
|    2 | name2 |
|    4 | name4 |
|    3 | name3 |
|    1 | name1 |
+------+-------+
4 rows in set (0.60 sec)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/952093.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

计算机毕业设计Python机器学习农作物健康识别系统 人工智能 图像识别 机器学习 大数据毕业设计 算法

温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:文末有 CSDN 平台官方提供的学长联系方式的名片! 作者简介:Java领…

gesp(C++四级)(11)洛谷:B4005:[GESP202406 四级] 黑白方块

gesp(C四级)(11)洛谷:B4005:[GESP202406 四级] 黑白方块 题目描述 小杨有一个 n n n 行 m m m 列的网格图,其中每个格子要么是白色,要么是黑色。对于网格图中的一个子矩形,小杨认为它是平衡的…

在Mac上使用 Docker 构建一个 noVNC 环境并运行 MyCobot

本文展示了Mycobot 280 M5 上的 Mycobot 280 M5 moveit2 模拟环境,以及详细介绍了使用 Docker 在 macOS(arm64)上构建 moveit2 环境的步骤。 一、引言 这篇文章主要内容是关于如何在 Ros2 环境中构建在 Mac 上模拟 Mycobot 280 M5 的环境。 …

c语言提供后端,提供页面显示跳转服务

后端代码: #define SERVER_IP_ADDR "0.0.0.0" // 服务器IP地址 #define SERVER_PORT 8080 // 服务器端口号 #define BACKLOG 10 #define BUF_SIZE 8192 #define OK 1 #define ERROR 0#include <stdio.h> #include <stdlib.h> #include <st…

AnaConda下载PyTorch慢的解决办法

使用Conda下载比较慢&#xff0c;改为pip下载 复制下载链接到迅雷下载 激活虚拟环境&#xff0c;安装whl&#xff0c;即可安装成功 pip install D:\openai.wiki\ChatGLM2-6B\torch-2.4.1cu121-cp38-cp38-win_amd64.whl

Sentinel服务保护 + Seata分布式事务

服务保护 【雪崩问题】微服务调用链路中某个服务&#xff0c;引起整个链路中所有微服务都不可用。 【原因】&#xff1a; 微服务相互调用&#xff0c;服务提供者出现故障。服务调用这没有做好异常处理&#xff0c;导致自身故障。调用链中所有服务级联失败&#xff0c;导致整个…

六、Angular 发送请求/ HttpClient 模块

一、应用 HttpClient 模块 angular/common/http 中的 HttpClient 类基于浏览器提供的 XMLHttpRequest 接口。要想使用 HtpClient 模块&#xff0c;就要先导入 Anqular 的 HttpClientModule。大多数 Web 应用程序都会在根模块 AppModule 中导入它。 编辑 src/app/app.module.ts…

CompletableFuture // todo

相比较所有代码都在主线程执行&#xff0c;使用Future的好处&#xff1a;利用服务器多核、并发的优势。 不足&#xff1a; 开启没有返回值的异步线程&#xff1a; 1、runAsync 使用lambda表达式&#xff1a; 开启有返回值的异步线程&#xff1a; 1、supplyAsync 异步任务中的…

css面试常考布局(圣杯布局、双飞翼布局、三栏布局、两栏布局、三角形)

两栏布局 <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>Document</title> </head> &…

arcgisPro加载天地图(CGCS2000)影像

1、注册天地图账号&#xff1b; 2、申请key&#xff1b; 3、添加WMTS服务器。 这里已经办好了前两步&#xff0c;下面详细介绍最后一步。 添加WMTS服务器。 在天地图网站&#xff0c;找到如下页面&#xff0c; 复制网址&#xff0c;如&#xff1a;http://t0.tianditu.gov.cn…

继承(7)

大家好&#xff0c;今天我们继续来学习一下继承的知识&#xff0c;这方面需要大家勤动脑才能理解&#xff0c;那么我们来看。 1.9 protected关键字 在类和对象章节中&#xff0c;为了实现封装特性,java中引入访向限定符,主要限定:类或者类中成员能否在类外和其他包中被访问. …

ModuleNotFoundError: No module named ‘podm.metrics‘报错等解决方法

ModuleNotFoundError: No module named podm.metrics’报错等解决方法 podm.metrics 在运行时报错&#xff1a; ModuleNotFoundError: No module named ‘podm.metrics’ 安装了podm后还是报错 解决方法&#xff1a; 查看安装位置 查看podm的安装位置&#xff0c;并打开到该…

HDFS异构存储和存储策略

一、HDFS异构存储类型 1.1 冷、热、温、冻数据 通常&#xff0c;公司或者组织总是有相当多的历史数据占用昂贵的存储空间。典型的数据使用模式是新传入的数据被应用程序大量使用&#xff0c;从而该数据被标记为"热"数据。随着时间的推移&#xff0c;存储的数据每周…

sklearn-逻辑回归-制作评分卡

目录 数据集处理 分箱 分多少个箱子合适 分箱要达成什么样的效果 对一个特征进行分箱的步骤 分箱的实现 封装计算 WOE 值和 IV值函数 画IV曲线&#xff0c;判断最佳分箱数量 结论 pd.qcut 执行报错 功能函数封装 判断分箱个数 在银行借贷场景中&#xff0c;评分卡是…

中学综合素质笔记3

第一章职业理念 第三节 教师观 考情提示&#xff1a; 单选题材料分析题 学习要求&#xff1a; 理解、 识记、 运用 &#xff08;一&#xff09;教师职业角色的转变&#xff08;单选材料分析&#xff09; 从教师与学生的关系看——对学生 新课程要求教师应该是学生学习的引…

【Linux】设备驱动中的ioctl详解

在Linux设备驱动开发中&#xff0c;ioctl&#xff08;输入输出控制&#xff09;是一个非常重要的接口&#xff0c;用于用户空间应用程序与内核空间设备驱动之间进行通信。通过ioctl&#xff0c;应用程序可以发送命令给设备驱动&#xff0c;控制设备的行为或获取设备的状态信息。…

linux上使用cmake编译的方法

一、hello 例程仅基于一个cpp文件 C文件或工程进行编译时可以使用g指令&#xff08;需要对每一个程序和源文件分别使用g指令编译&#xff09;&#xff0c;当程序变大时&#xff0c;一个工程文件往往会包含很文件夹和源文件&#xff0c;这时我们需要的编译指令将越来越长&#…

(vue)el-table-column type=“selection“表格选框怎么根据条件添加禁选

(vue)el-table-column type"selection"表格选框怎么根据条件添加禁选 html <el-table:data"tableData"style"width: 100%"><el-table-columntype"selection"width"55":selectable"checkSelectable">…

linux nginx 安装后,发现SSL模块未安装,如何处理?

&#x1f468;‍⚕ 主页&#xff1a; gis分享者 &#x1f468;‍⚕ 感谢各位大佬 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! &#x1f468;‍⚕ 收录于专栏&#xff1a;运维工程师 文章目录 前言SSL模块安装 前言 nginx 安装后&#xff0c;发现SSL模块未安装&…

kubeneters-循序渐进Cilium网络(二)

文章目录 概要IP 地址配置接口配置解析结论 概要 接续前一章节&#xff0c;我们还是以这张图继续深入Cilium网络世界 IP 地址配置 通过检查 Kubernetes 集群的当前环境&#xff0c;可以获取实际的 IP 地址和配置信息。这些信息将被补充到之前的网络示意图中&#xff0c;以使…