doris-4.0.8集群部署

环境:
os:centos 7
doris:4.0.8
机器分布情况(我这里fe和be都部署在一台机器上,生产环境建议分开部署,至少6台机器,3台部署fe,3台部署be)
192.168.1.134 fe be
192.168.1.135 fe be
192.168.1.113 fe be

 

##########################################基础配置###################################
每台机器都要进行配置
1.查看机器是否支持avx2

[root@host113 ~]# cat /proc/cpuinfo |grep avx2
没有输出,代表不支持

[root@host135 ~]# cat /proc/cpuinfo |grep avx2
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm 3dnowprefetch invpcid_single fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm 3dnowprefetch invpcid_single fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm rdseed adx smap xsaveopt

这里有输出,代表支持

 

2.介质下载
cd /soft
支持avx2的版本
wget https://apache-doris-releases.oss-accelerate.aliyuncs.com/apache-doris-4.0.8-bin-x64.tar.gz

不支持avx2的版本
wget https://apache-doris-releases.oss-accelerate.aliyuncs.com/apache-doris-4.0.8-bin-x64-noavx2.tar.gz
我这里使用不支持avx的版本


3.设置系统最大打开文件句柄数
每台机器都要配置
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536


4.关闭交换分区
swapoff -a ##临时关闭
永久删除Swap挂载
vim /etc/fstab
# 注释 swap 行
重启系统

 

5.关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

 

6.修改/etc/sysctl.conf
#设置系统中每个进程可以拥有的最大内存映射区域数量
vi /etc/sysctl.conf

vm.max_map_count=2000000

#加载并应用内核
sysctl -p

 

7.禁用透明大页 (Transparent Huge Pages)
## 立即禁用(当前运行期临时有效)
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag

vi /etc/rc.d/rc.local
在文件最最后写入如下内容
echo never > /sys/kernel/mm/transparent_hugepage/enabled
echo never > /sys/kernel/mm/transparent_hugepage/defrag


## 赋权
chmod +x /etc/rc.d/rc.local

 

8.部署官方标准 Java 运行环境(JDK)
官方建议安装jdk17
[root@host113 soft]# java -version
java version "17.0.20.1" 2026-08-18 LTS
Java(TM) SE Runtime Environment (build 17.0.20.1+1-LTS-4)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.20.1+1-LTS-4, mixed mode, sharing)

 

##################################安装fe#################################

1.解压
每个节点上都要操作
[root@host134 soft]# cd /soft
[root@host01 soft]# tar -xvf apache-doris-4.0.8-bin-x64-noavx2.tar.gz
[root@host01 soft]# mv apache-doris-4.0.8-bin-x64-noavx2 /opt/doris_noavx2


2.创建相应的目录
程序目录和数据目录分离
每个节点上都要操作
mkdir -p /data/doris/fe/doris-meta
mkdir -p /data/doris/fe/log

3.修改fe配置参数
每个节点上都要操作
修改第一个节点的配置
vi /opt/doris_noavx2/fe/conf/fe.conf

LOG_DIR = /data/doris/fe/log
meta_dir = /data/doris/fe/doris-meta
priority_networks = 192.168.1.0/24 #新增该字段,特别是多网卡服务器上,该参数必须添加
qe_query_timeout_second=3000 ##超时设置,最大只能设置259200秒,即72小时
enable_outfile_to_local = true ##支持使用export命令导出数据
enable_batch_delete_by_default=true ##启用批量删除 

另外2个节点的配置参数,可以使用节点1的scp过去即可

节点1上操作
scp /opt/doris_noavx2/fe/conf/fe.conf root@192.168.1.135:/opt/doris_noavx2/fe/conf/
scp /opt/doris_noavx2/fe/conf/fe.conf root@192.168.1.113:/opt/doris_noavx2/fe/conf/

 

4.启动第一个节点
先启动第一个节点,ip是192.168.1.134
[root@host01 ~]#/opt/doris_noavx2/fe/bin/start_fe.sh --daemon
[root@host01 ~]#/opt/doris_noavx2/fe/bin/stop_fe.sh ##停止命令

 

5.查看是否启动
[root@host01 doris]# jps
16986 DorisFE
17210 Jps

查看相应端口情况
[root@host01 fe]# ss -nlp|grep 9030
[root@host01 fe]# ss -nlp|grep 8030
[root@host01 fe]# ss -nlp|grep 9020
[root@host01 fe]# ss -nlp|grep 9010

端口说明:
http_port = 8030
rpc_port = 9020
query_port = 9030
edit_log_port = 9010

 

5.mysql客户端登录
需要在节点上安装mysql客户端,或是直接解压mysql安装包即可使用
/opt/mysql5744/bin/mysql -uroot -P 9030 -h 127.0.0.1 #直接回车,默认没有密码

mysql> SHOW PROC '/frontends' \G;
*************************** 1. row ***************************
              Name: fe_20ad6347_e249_48bc_9049_5dec26244e85
              Host: 192.168.1.134
       EditLogPort: 9010
          HttpPort: 8030
         QueryPort: 9030
           RpcPort: 9020
ArrowFlightSqlPort: 8070
              Role: FOLLOWER
          IsMaster: true
         ClusterId: 589666371
              Join: true
             Alive: true
 ReplayedJournalId: 42
     LastStartTime: 2026-10-21 14:35:02
     LastHeartbeat: 2026-10-21 14:37:53
          IsHelper: true
            ErrMsg: 
           Version: doris-4.0.8-rc02-bc8ea1bac6d
  CurrentConnected: Yes
         LiveSince: NULL
1 row in set (0.09 sec)

ERROR: 
No query specified

 

6.添加新节点
注意:先注册 再启动进程
在节点1(192.168.1.134)上操作

/opt/mysql5744/bin/mysql -uroot -P 9030 -h 192.168.1.134
mysql> ALTER SYSTEM ADD FOLLOWER "192.168.1.135:9010";
Query OK, 0 rows affected (0.08 sec)

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

这个时候的节点状态

mysql> SHOW FRONTENDS \G;
*************************** 1. row ***************************
              Name: fe_20ad6347_e249_48bc_9049_5dec26244e85
              Host: 192.168.1.134
       EditLogPort: 9010
          HttpPort: 8030
         QueryPort: 9030
           RpcPort: 9020
ArrowFlightSqlPort: 8070
              Role: FOLLOWER
          IsMaster: true
         ClusterId: 589666371
              Join: true
             Alive: true
 ReplayedJournalId: 342
     LastStartTime: 2026-10-21 14:35:02
     LastHeartbeat: 2026-10-21 15:02:51
          IsHelper: true
            ErrMsg: 
           Version: doris-4.0.8-rc02-bc8ea1bac6d
  CurrentConnected: Yes
         LiveSince: NULL
*************************** 2. row ***************************
              Name: fe_8491c13b_58b2_4fa5_8ea8_2496ddb8311f
              Host: 192.168.1.135
       EditLogPort: 9010
          HttpPort: 8030
         QueryPort: 0
           RpcPort: 0
ArrowFlightSqlPort: 0
              Role: FOLLOWER
          IsMaster: false
         ClusterId: 589666371
              Join: false
             Alive: false
 ReplayedJournalId: 0
     LastStartTime: NULL
     LastHeartbeat: NULL
          IsHelper: true
            ErrMsg: java.net.ConnectException: Connection refused
           Version: NULL
  CurrentConnected: No
         LiveSince: NULL
*************************** 3. row ***************************
              Name: fe_bb9b3bfe_d6a8_4e30_8f0a_aeeddef894f1
              Host: 192.168.1.113
       EditLogPort: 9010
          HttpPort: 8030
         QueryPort: 0
           RpcPort: 0
ArrowFlightSqlPort: 0
              Role: FOLLOWER
          IsMaster: false
         ClusterId: 589666371
              Join: false
             Alive: false
 ReplayedJournalId: 0
     LastStartTime: NULL
     LastHeartbeat: NULL
          IsHelper: true
            ErrMsg: java.net.ConnectException: Connection refused
           Version: NULL
  CurrentConnected: No
         LiveSince: NULL
3 rows in set (0.03 sec)

ERROR: 
No query specified

 

节点没有启动的,下面这些端口都是0

         QueryPort: 0
           RpcPort: 0
ArrowFlightSqlPort: 0

 

7.启动另外两个节点
启动剩下的2个节点
节点2(192.168.1.135):
[root@host02 soft]#/opt/doris_noavx2/fe/bin/start_fe.sh --helper 192.168.1.134:9010 --daemon

 

节点3(192.168.1.113):
[root@host03 soft]#/opt/doris_noavx2/fe/bin/start_fe.sh --helper 192.168.1.134:9010 --daemon
--helper 参数仅在 FE 第一次启动(元数据目录为空)时需要.
一旦从节点成功加入集群并同步了元数据,以后重启服务只需直接运行 start_fe.sh --daemon 即可,无需再加 helper 参数.

注意:
这里先在主节点上注册从节点,再启动从节点,否则会报如下的错误:

2026-10-21 14:48:58,837 WARN (main|1) [Env.getClusterIdAndRole():1354] current node HostInfo{host='192.168.1.113', port=9010} is not added to the group. please add it first. sleep 5 seconds and retry, current helper nodes: [HostInfo{host='192.168.1.134', port=9010}]
2026-10-21 14:49:03,847 WARN (main|1) [Env.getFeNodeTypeAndNameFromHelpers():1513] failed to get fe node type from helper node: HostInfo{host='192.168.1.134', port=9010}.

 

若顺序弄反的话先停掉原来启动的进程
[root@host113 log]#/opt/doris_noavx2/fe/bin/stop_fe.sh
[root@host135 log]#/opt/doris_noavx2/fe/bin/stop_fe.sh

 

8.再次查看fe集群状态
我这里在节点1上登录查看,从启动节点登录查看也是可以的
/opt/mysql5744/bin/mysql -uroot -P 9030 -h 192.168.1.134
/opt/mysql5744/bin/mysql -uroot -P 9030 -h 192.168.1.135
/opt/mysql5744/bin/mysql -uroot -P 9030 -h 192.168.1.113

mysql> SHOW FRONTENDS \G;

 

9.重启顺序
先停掉非master的节点,最后才停掉master的节点
192.168.1.113
192.168.1.135
/opt/doris_noavx2/fe/bin/stop_fe.sh
最后停掉master,192.168.1.134
/opt/doris_noavx2/fe/bin/stop_fe.sh

然后正常方式启动(不带--helper)
启动顺序:先原 Master,再其他 Follower
/opt/doris_noavx2/fe/bin/start_fe.sh --daemon

 

10.尝试创建数据库

[root@host134 ~]# /opt/mysql5744/bin/mysql -uroot -P 9030 -h 192.168.1.134
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 0
Server version: 5.7.99

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> show dataabses;
ERROR 1105 (HY000): errCode = 2, detailMessage = 
no viable alternative at input 'show dataabses'(line 1, pos 5)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| __internal_schema  |
| information_schema |
| mysql              |
+--------------------+
3 rows in set (0.06 sec)

mysql> select * from mysql.user;
ERROR 1105 (HY000): errCode = 2, detailMessage = No backend available as scan node, please check the status of your backends.
mysql> create database db_test;
Query OK, 0 rows affected (0.14 sec)

mysql> use db_test;
Database changed
mysql> show tables;
Empty set (0.01 sec)

mysql> create table tb_test(id int,name varchar(30));
ERROR 1105 (HY000): errCode = 2, detailMessage = System has no available disk capacity or no available BE nodes
mysql> 


可以修改密码
mysql> SET PASSWORD FOR 'root' = PASSWORD('mysql');
Query OK, 0 rows affected (2.40 sec)

 

现在没有be还不能使用

 

##################################部署be############################

1.创建相应的目录
每个节点都有要操作
mkdir -p /data/doris/be/storage
mkdir -p /data/doris/be/log

 

2.修改be配置文件
在节点1上配置好之后,然后scp到另外的节点
vi /opt/doris_noavx2/be/conf/be.conf

LOG_DIR="/data/doris/be/log/"
priority_networks = 192.168.1.0/24
storage_root_path = /data/doris/be/storage

拷贝到另外2个节点
scp /opt/doris_noavx2/be/conf/be.conf root@192.168.1.135:/opt/doris_noavx2/be/conf/
scp /opt/doris_noavx2/be/conf/be.conf root@192.168.1.113:/opt/doris_noavx2/be/conf/

 

3.启动BE
每个节点都需要启动
/opt/doris_noavx2/be/bin/start_be.sh --daemon

报错误:
[root@host134 conf]# /opt/doris_noavx2/be/bin/start_be.sh --daemon
Set kernel parameter 'vm.max_map_count' to a value greater than 2000000, example: 'sysctl -w vm.max_map_count=2000000'
解决办法:
每个节点都要操作
echo "vm.max_map_count = 2000000" >> /etc/sysctl.conf
# 加载配置
sysctl -p


查看进程和端口
ss -nlp|grep 9050

 

4.登录fe添加be
通过任何一个fe节点登录进行添加
/opt/mysql5744/bin/mysql -uroot -P9030 -h 192.168.1.134 -pmysql

SQL>ALTER SYSTEM ADD BACKEND "192.168.1.134:9050";
SQL>ALTER SYSTEM ADD BACKEND "192.168.1.135:9050";
SQL>ALTER SYSTEM ADD BACKEND "192.168.1.113:9050";

 

mysql> SHOW PROC '/backends' \G;
*************************** 1. row ***************************
              BackendId: 1792577002169
                   Host: 192.168.1.113
          HeartbeatPort: 9050
                 BePort: 9060
               HttpPort: 8040
               BrpcPort: 8060
     ArrowFlightSqlPort: 8050
          LastStartTime: 2026-10-21 17:55:55
          LastHeartbeat: 2026-10-22 11:22:18
                  Alive: true
   SystemDecommissioned: false
              TabletNum: 14
       DataUsedCapacity: 0.000 
      TrashUsedCapacity: 0.000 
          AvailCapacity: 4.819 GB
          TotalCapacity: 49.976 GB
                UsedPct: 90.36 %
         MaxDiskUsedPct: 90.36 %
     RemoteUsedCapacity: 0.000 
                    Tag: {"location" : "default"}
                 ErrMsg: 
                Version: doris-4.0.8-rc02-bc8ea1bac6d
                 Status: {"lastSuccessReportTabletsTime":"2026-10-22 11:21:41","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false,"isActive":true,"isShutdown":false,"currentFragmentNum":0,"lastFragmentUpdateTime":1792576549122}
HeartbeatFailureCounter: 0
               CpuCores: 6
                 Memory: 9.65 GB
              LiveSince: 2026-10-22 11:22:18
           RunningTasks: 0
               NodeRole: mix
*************************** 2. row ***************************
              BackendId: 1792577002087
                   Host: 192.168.1.134
          HeartbeatPort: 9050
                 BePort: 9060
               HttpPort: 8040
               BrpcPort: 8060
     ArrowFlightSqlPort: 8050
          LastStartTime: 2026-10-22 11:09:48
          LastHeartbeat: 2026-10-22 11:22:18
                  Alive: true
   SystemDecommissioned: false
              TabletNum: 20
       DataUsedCapacity: 0.000 
      TrashUsedCapacity: 0.000 
          AvailCapacity: 201.928 GB
          TotalCapacity: 499.545 GB
                UsedPct: 59.58 %
         MaxDiskUsedPct: 59.58 %
     RemoteUsedCapacity: 0.000 
                    Tag: {"location" : "default"}
                 ErrMsg: 
                Version: doris-4.0.8-rc02-bc8ea1bac6d
                 Status: {"lastSuccessReportTabletsTime":"2026-10-22 11:21:29","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false,"isActive":true,"isShutdown":false,"currentFragmentNum":0,"lastFragmentUpdateTime":1792639324727}
HeartbeatFailureCounter: 0
               CpuCores: 2
                 Memory: 11.58 GB
              LiveSince: 2026-10-22 11:22:18
           RunningTasks: 0
               NodeRole: mix
*************************** 3. row ***************************
              BackendId: 1792577002126
                   Host: 192.168.1.135
          HeartbeatPort: 9050
                 BePort: 9060
               HttpPort: 8040
               BrpcPort: 8060
     ArrowFlightSqlPort: 8050
          LastStartTime: 2026-10-21 17:59:08
          LastHeartbeat: 2026-10-22 11:22:18
                  Alive: true
   SystemDecommissioned: false
              TabletNum: 16
       DataUsedCapacity: 0.000 
      TrashUsedCapacity: 0.000 
          AvailCapacity: 206.897 GB
          TotalCapacity: 499.545 GB
                UsedPct: 58.58 %
         MaxDiskUsedPct: 58.58 %
     RemoteUsedCapacity: 0.000 
                    Tag: {"location" : "default"}
                 ErrMsg: 
                Version: doris-4.0.8-rc02-bc8ea1bac6d
                 Status: {"lastSuccessReportTabletsTime":"2026-10-22 11:21:40","lastStreamLoadTime":-1,"isQueryDisabled":false,"isLoadDisabled":false,"isActive":true,"isShutdown":false,"currentFragmentNum":0,"lastFragmentUpdateTime":1792639319073}
HeartbeatFailureCounter: 0
               CpuCores: 2
                 Memory: 11.58 GB
              LiveSince: 2026-10-22 11:22:18
           RunningTasks: 0
               NodeRole: mix
3 rows in set (0.03 sec)

ERROR: 
No query specified

 

###################界面访问fe####################
http://192.168.1.134:8030
http://192.168.1.135:8030
http://192.168.1.113:8030

image

 

image

 

##################################建库建表建用户######################

1.建库

[root@localhost conf]#/opt/mysql5744/bin/mysql -uroot -P9030 -h 192.168.1.134 -pmysql

mysql> create database db_test;

 

2.建表

CREATE TABLE tb_test (
    id LARGEINT NOT NULL COMMENT "id",
    name VARCHAR(20)
) AGGREGATE KEY(id,name) 
DISTRIBUTED BY HASH(id) BUCKETS 1;

默认副本数是3,若特别设置(比如下面的副本数是1),可以使用如下的语法:

CREATE TABLE tb_test01
(
    id LARGEINT NOT NULL COMMENT "id",
    name VARCHAR(20)
)
AGGREGATE KEY(id,name)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES (
    "replication_allocation" = "tag.location.default: 1"
);

查看

mysql> SHOW PARTITIONS FROM tb_test;
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
| PartitionId   | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       | IsMutable | SyncWithBaseTables | UnsyncTables | CommittedVersion | RowCount |
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
| 1792577002233 | tb_test       | 1              | 2026-10-22 11:35:49 | NORMAL |              |       | id              | 1       | 3              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 3 | true      | true               | NULL         | 1                | 0        |
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
1 row in set (0.09 sec)

mysql> SHOW PARTITIONS FROM tb_test01;
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
| PartitionId   | PartitionName | VisibleVersion | VisibleVersionTime  | State  | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime        | RemoteStoragePolicy | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation       | IsMutable | SyncWithBaseTables | UnsyncTables | CommittedVersion | RowCount |
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
| 1792577002241 | tb_test01     | 1              | 2026-10-22 11:35:55 | NORMAL |              |       | id              | 1       | 1              | HDD           | 9999-12-31 23:59:59 |                     | NULL                     | 0.000    | false      | tag.location.default: 1 | true      | true               | NULL         | 1                | 0        |
+---------------+---------------+----------------+---------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+---------------------+--------------------------+----------+------------+-------------------------+-----------+--------------------+--------------+------------------+----------+
1 row in set (0.01 sec)

 

或是使用show create table 查看

CREATE TABLE `tb_test` (
  `id` largeint NOT NULL COMMENT "id",
  `name` varchar(20) NULL
) ENGINE=OLAP
AGGREGATE KEY(`id`, `name`)
DISTRIBUTED BY HASH(`id`) BUCKETS 1
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"min_load_replica_num" = "-1",
"is_being_synced" = "false",
"storage_medium" = "hdd",
"storage_format" = "V2",
"inverted_index_storage_format" = "V3",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false",
"group_commit_interval_ms" = "10000",
"group_commit_data_bytes" = "134217728"
); 

 

3.创建用户
同时通过fe链接的登录的
/opt/mysql5744/bin/mysql -uroot -P9030 -h 192.168.1.134 -pmysql

CREATE USER 'hxl' IDENTIFIED BY 'mysql';
GRANT ALL ON db_test.* TO 'hxl'@'%';

mysql> show grants for 'hxl'@'%';
+--------------+---------+----------+------------+-------+-------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+----------+---------------+-------------------+-----------------+-------------------+--------------------+-------------------+
| UserIdentity | Comment | Password | RequireSan | Roles | GlobalPrivs | CatalogPrivs | DatabasePrivs                                                                                                                                                  | TablePrivs | ColPrivs | ResourcePrivs | CloudClusterPrivs | CloudStagePrivs | StorageVaultPrivs | WorkloadGroupPrivs | ComputeGroupPrivs |
+--------------+---------+----------+------------+-------+-------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+----------+---------------+-------------------+-----------------+-------------------+--------------------+-------------------+
| 'hxl'@'%'    |         | Yes      | NULL       |       | NULL        | NULL         | internal.db_test: Select_priv,Load_priv,Alter_priv,Create_priv,Drop_priv,Show_view_priv; internal.information_schema: Select_priv; internal.mysql: Select_priv | NULL       | NULL     | NULL          | NULL              | NULL            | NULL              | normal: Usage_priv | NULL              |
+--------------+---------+----------+------------+-------+-------------+--------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+----------+---------------+-------------------+-----------------+-------------------+--------------------+-------------------+
1 row in set (0.01 sec)

使用刚才创建的账号登录
/opt/mysql5744/bin/mysql -uhxl -P9030 -h 192.168.1.134 -pmysql

 

############################节点宕机验证###############################
1.验证fe停掉
3个节点组成的fe集群,宕机2个就不可使用了的.


2.单副本的表
单副本的表只落在一个be节点,若该be节点down机,该表不可用

mysql> select * from tb_test01;
ERROR 1105 (HY000): errCode = 2, detailMessage = tablet 1792577002244 has no queryable replicas. err: replica 1792577002245's backend 1792577002126 with tag {"location" : "default"} does not exist or not alive

下面语句可以查看表落在那个机器

mysql> SHOW TABLETS FROM tb_test01;
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+---------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
| TabletId      | ReplicaId     | BackendId     | SchemaHash | Version | LstSuccessVersion | LstFailedVersion | LstFailedTime | LocalDataSize | RemoteDataSize | RowCount | State  | LstConsistencyCheckTime | CheckVersion | VisibleVersionCount | VersionCount | QueryHits | WindowAccessCount | LastAccessTime | PathHash            | Path                   | MetaUrl                                                 | CompactionStatus                                                      | CooldownReplicaId | CooldownMetaId |
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+---------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
| 1792577002244 | 1792577002245 | 1792577002126 | 1407101575 | 2       | 2                 | -1               | NULL          | 570           | 0              | 3        | NORMAL | NULL                    | -1           | 2                   | 2            | 0         | 0                 | 0              | 2296316066896382849 | /data/doris/be/storage | http://192.168.1.135:8040/api/meta/header/1792577002244 | http://192.168.1.135:8040/api/compaction/show?tablet_id=1792577002244 | -1                |                |
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+---------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
1 row in set (0.01 sec)

mysql> SHOW TABLETS FROM tb_test;
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+----------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
| TabletId      | ReplicaId     | BackendId     | SchemaHash | Version | LstSuccessVersion | LstFailedVersion | LstFailedTime | LocalDataSize | RemoteDataSize | RowCount | State  | LstConsistencyCheckTime | CheckVersion | VisibleVersionCount | VersionCount | QueryHits | WindowAccessCount | LastAccessTime | PathHash             | Path                   | MetaUrl                                                 | CompactionStatus                                                      | CooldownReplicaId | CooldownMetaId |
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+----------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
| 1792577002236 | 1792577002237 | 1792577002126 | 264921273  | 2       | 2                 | -1               | NULL          | 570           | 0              | 3        | NORMAL | NULL                    | -1           | 2                   | 2            | 0         | 0                 | 0              | 2296316066896382849  | /data/doris/be/storage | http://192.168.1.135:8040/api/meta/header/1792577002236 | http://192.168.1.135:8040/api/compaction/show?tablet_id=1792577002236 | -1                |                |
| 1792577002236 | 1792577002238 | 1792577002169 | 264921273  | 2       | 2                 | -1               | NULL          | 570           | 0              | 3        | NORMAL | NULL                    | -1           | 2                   | 2            | 0         | 0                 | 0              | -3320378586578762552 | /data/doris/be/storage | http://192.168.1.113:8040/api/meta/header/1792577002236 | http://192.168.1.113:8040/api/compaction/show?tablet_id=1792577002236 | -1                |                |
| 1792577002236 | 1792577002239 | 1792577002087 | 264921273  | 2       | 2                 | -1               | NULL          | 570           | 0              | 3        | NORMAL | NULL                    | -1           | 2                   | 2            | 0         | 0                 | 0              | 2942361751619624953  | /data/doris/be/storage | http://192.168.1.134:8040/api/meta/header/1792577002236 | http://192.168.1.134:8040/api/compaction/show?tablet_id=1792577002236 | -1                |                |
+---------------+---------------+---------------+------------+---------+-------------------+------------------+---------------+---------------+----------------+----------+--------+-------------------------+--------------+---------------------+--------------+-----------+-------------------+----------------+----------------------+------------------------+---------------------------------------------------------+-----------------------------------------------------------------------+-------------------+----------------+
3 rows in set (0.02 sec)

 

3副本的表
3个节点组成的be,宕机2个be就不能写入数据

 

posted @ 2026-10-22 14:33  slnngk  阅读(22)  评论(0)    收藏  举报