doris編譯和安裝部署詳細步驟
準備三臺機器,配置對應域名
root@doris1:~# vim /etc/hosts
192.168.1.1 doris1
192.168.1.3 doris2
192.168.1.4 doris3
備註:三臺機器上都要配置
centos7停止防火牆:
#systemctl stop firewalld.service
禁止開機啟動:
#systemctl disable firewalld
安裝如下包:
# yum groupinstall 'Development Tools'
# yum install maven cmake byacc flex automake libtool bison binutils-devel zip *libssl* unzip ncurses-devel curl
git wget python2 glibc-static libstdc++-static java-1.8.0-openjdk
升級gcc版本:
# yum install centos-release-scl -y
# yum install devtoolset-7-gcc* -y
# scl enable devtoolset-7 bash
# which gcc
# yum -y install yum-utils
安裝docker20.10版本:
備註:
叢集模式下,docker engine 版本需要大於等於18.04
--刪除以前的低版本docker(如果存在):
# yum remove -y docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
# yum-config-manager --enable docker-ce-nightly
# yum-config-manager --enable docker-ce-test
新增阿里雲yum源:
# sudo yum-config-manager \
--add-repo \
# yum makecache fast
安裝DOCKER引擎:
# yum install -y docker-ce docker-ce-cli containerd.io
啟動Docker:
# systemctl start docker
設定開機自動啟動docker:
# systemctl enable docker
設定docker映象加速器:
# mkdir -p /etc/docker
# tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["]
}
EOF
# systemctl daemon-reload
# systemctl restart docker
檢視docker版本:
# docker version
拉doris映象:
# docker pull apache/incubator-doris:build-env-1.4.2
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
apache/incubator-doris build-env-1.4.2 e568f7b2e1d8 2 months ago 3.54GB
# mkdir /data/doris-0.15
# wget https://dlcdn.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
--no-check-certificate
# tar zxvf apache-doris-0.15.0-incubating-src.tar.gz
# docker run -it -v /data/.m2:/data/.m2 -v
/data/doris-0.15/apache-doris-0.15.0-incubating-src:/data/doris-0.15/apache-doris-0.15.0-incubating-src
apache/incubator-doris:build-env-1.4.2
切換到 JDK 8:
# alternatives --set java java-1.8.0-openjdk.x86_64
# alternatives --set javac java-1.8.0-openjdk.x86_64
# export JAVA_HOME=/usr/lib/jvm/java-1.8.0
# cd /data/doris-0.15/apache-doris-0.15.0-incubating-src
# sh build.sh
出現如下介面說明編譯成功:
[INFO] Reactor Summary:
[INFO]
[INFO] doris-fe-common 1.0.0 .............................. SUCCESS [ 9.858 s]
[INFO] spark-dpp 1.0.0 .................................... SUCCESS [ 5.750 s]
[INFO] fe-core 3.4.0 ...................................... SUCCESS [10:50 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11:06 min
[INFO] Finished at: 2022-01-24T11:29:01Z
[INFO] ------------------------------------------------------------------------
***************************************
Successfully build Doris
安裝部署步驟:
規劃如下:
192.168.1.4 fe
192.168.1.3 fe
192.168.1.1 be
192.168.1.3 be
在每臺機器上執行:
# cp -r /data/doris-0.15/apache-doris-0.15.0-incubating-src/output /data/
配置和部署fe:
在fe(192.168.1.4)上執行:
#cd /data/output/fe
# mkdir doris-meta
修改配置檔案:
# vi /data/output/fe/conf/fe.conf
在# priority_networks下面新增如下行:
priority_networks = 192.168.1.4/24
啟動fe:
# sh bin/start_fe.sh --daemon
跟蹤啟動日誌:
# tailf /data/output/fe/log/fe.out
出現如下資訊,說明啟動成功:
==============================
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/data/output/fe/lib/slf4j-log4j12-1.7.28.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/output/fe/lib/log4j-slf4j-impl-2.14.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[2022-01-26 16:01:12] notify new FE type transfer: UNKNOWN
[2022-01-26 16:01:14] notify new FE type transfer: MASTER
[2022-01-26 16:01:17] notify new FE type transfer: MASTER
[2022-01-26 16:01:17] master finished to replay journal, can write now.
@@@@@@
@@@@@@@@
@@@@@@@@@
@@@ @@@@@@@ @ @@@@@ @@@@ @@@@@ @@ @@@@
@@@@@ @@@@ @@@@ @@ @@@ @@ @@@ @@ @@ @@ @@
@@@@@@@ @@@@@@@ @@ @@ @@ @ @@ @@ @@ @@@
@@@@@@@ @@@@@@@@@ @@ @ @@ @ @@ @@ @@ @@@
@@@@@ @@@@@@@@@@ @@ @@@ @@ @@@ @@ @@ @@ @@
@@@ @@@@@@@@@@ @@@@@ @@@@ @@ @@ @@ @@@@
@@@@@@@@@@
@@@@@@@@
@@@@@@@
2022-01-26 16:01:20 INFO RepositoryConfigurationDelegate:126 - Bootstrapping Spring Data repositories in DEFAULT mode.
2022-01-26 16:01:20 INFO RepositoryConfigurationDelegate:182 - Finished Spring Data repository scanning in 13ms. Found 0 repository interfaces.
2022-01-26 16:01:20 INFO log:169 - Logging initialized @14533ms to org.eclipse.jetty.util.log.Slf4jLog
2022-01-26 16:01:20 INFO Server:359 - jetty-9.4.20.v20190813; built: 2019-08-13T21:28:18.144Z; git: 84700530e645e812b336747464d6fbbf370c9a20; jvm 1.8.0_45-b14
2022-01-26 16:01:20 INFO application:2232 - Initializing Spring embedded WebApplicationContext
2022-01-26 16:01:20 INFO session:333 - DefaultSessionIdManager workerName=node0
2022-01-26 16:01:20 INFO session:338 - No SessionScavenger set, using defaults
2022-01-26 16:01:20 INFO session:140 - node0 Scavenging every 600000ms
2022-01-26 16:01:20 INFO ContextHandler:824 - Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@7ec08115{application,/,[file:///tmp/jetty-docbase.6995182569386935348.8030/],AVAILABLE}
2022-01-26 16:01:20 INFO Server:399 - Started @14675ms
2022-01-26 16:01:21 INFO AbstractContextSource:415 - Property 'userDn' not set - anonymous context will be used for read-write operations
2022-01-26 16:01:21 INFO application:2232 - Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-01-26 16:01:21 INFO AbstractConnector:293 - Started ServerConnector@61f377d1{HTTP/1.1,[http/1.1]}{0.0.0.0:8030}
檢視啟動的埠號:
# netstat -tuanlp |grep 8030
tcp6 0 0 :::8030 :::* LISTEN 14633/java
# netstat -tuanlp |grep 9030
tcp6 0 0 :::9030 :::* LISTEN 14633/java
# netstat -tuanlp |grep 9010
tcp6 0 0 192.168.1.4:9010 :::* LISTEN 14633/java
# netstat -tuanlp |grep 9020
tcp6 0 0 :::9020 :::* LISTEN 14633/java
再另外一臺fe機器上(192.168.1.3)修改fe.conf:
只需要改如下項,其他不動:
192.168.1.3
priority_networks = 192.168.1.3/24
儲存退出
啟動192.168.1.3上的fe:
# cd /data/output/fe/bin
# sh start_fe.sh --helper 192.168.1.4:9010 --daemon
跟蹤日誌:
#
==============================
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/data/output/fe/lib/slf4j-log4j12-1.7.28.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/data/output/fe/lib/log4j-slf4j-impl-2.14.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
[2022-01-27 14:29:41] notify new FE type transfer: UNKNOWN
[2022-01-27 14:29:41] notify new FE type transfer: FOLLOWER
[2022-01-27 14:29:46] notify new FE type transfer: FOLLOWER
@@@@@@
@@@@@@@@
@@@@@@@@@
@@@ @@@@@@@ @ @@@@@ @@@@ @@@@@ @@ @@@@
@@@@@ @@@@ @@@@ @@ @@@ @@ @@@ @@ @@ @@ @@
@@@@@@@ @@@@@@@ @@ @@ @@ @ @@ @@ @@ @@@
@@@@@@@ @@@@@@@@@ @@ @ @@ @ @@ @@ @@ @@@
@@@@@ @@@@@@@@@@ @@ @@@ @@ @@@ @@ @@ @@ @@
@@@ @@@@@@@@@@ @@@@@ @@@@ @@ @@ @@ @@@@
@@@@@@@@@@
@@@@@@@@
@@@@@@@
配合和部署be:
在兩臺be(192.168.1.1/13)上
192.168.1.1修改配置檔案:
# vi /data/output/be/conf/be.conf
在# priority_networks下面新增如下行:
priority_networks = 192.168.1.1/24
192.168.1.3修改配置檔案:
# vi /data/output/be/conf/be.conf
在# priority_networks下面新增如下行:
priority_networks = 192.168.1.3/24
啟動be:
# sh bin/start_be.sh --daemon
跟蹤日誌:
# tailf /data/output/be/log/be.out
出現如下資訊,說明啟動成功:
start time: 2022年 01月 26日 星期三 16:14:01 CST
檢視埠號:
# netstat -tuanlp |grep 9060
tcp6 0 0 :::9060 :::* LISTEN 21489/palo_be
# netstat -tuanlp |grep 8040
tcp 0 0 0.0.0.0:8040 0.0.0.0:* LISTEN 21489/palo_be
# netstat -tuanlp |grep 9050
tcp6 0 0 :::9050 :::* LISTEN 21489/palo_be
# netstat -tuanlp |grep 8060
tcp 0 0 0.0.0.0:8060 0.0.0.0:* LISTEN 21489/palo_be
安裝mysql客戶端;
僅安裝MySQL客戶端
# 新增rpm源
[root@k8s-master ~]# rpm -ivh
[root@test1 ~]#
# 透過yum搜尋
[root@test1 ~]# yum search mysql-community
[root@test1 ~]#
修改yum源配置檔案:
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
將gpgcheck=1改為gpgcheck=0
# 安裝x64位的 mysql客戶端
[root@test1 ~]# yum install mysql-community-client.x86_64
從mysql訪問fe(192.168.1.4),並修改root密碼:
# mysql -uroot -h 192.168.1.4 -P 9030
修改密碼:
SET PASSWORD FOR 'root' = PASSWORD('123456');
建立新使用者:
CREATE USER 'test' IDENTIFIED BY 'test';
GRANT ALL ON test TO test;
新增be:
ALTER SYSTEM ADD BACKEND "192.168.1.1:9050";
ALTER SYSTEM ADD BACKEND "192.168.1.3:9050";
檢視fe: show proc '/frontends'\G
mysql> show proc '/frontends' \G
*************************** 1. row ***************************
Name: 192.168.1.4_9010_1643184067013
IP: 192.168.1.4
HostName: doris3
EditLogPort: 9010
HttpPort: 8030
QueryPort: 9030
RpcPort: 9020
Role: FOLLOWER
IsMaster: true
ClusterId: 569842100
Join: true
Alive: true
ReplayedJournalId: 665
LastHeartbeat: 2022-01-26 16:37:54
IsHelper: true
ErrMsg:
Version: 0.15.0-rc04-Unknown
CurrentConnected: Yes
1 row in set (0.04 sec)
檢視be: show proc '/backends' \G
mysql> show proc '/backends' \G
*************************** 1. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 192.168.1.1
HostName: doris1
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2022-01-26 16:21:42
LastHeartbeat: 2022-01-26 16:38:00
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
AvailCapacity: 175.445 GB
TotalCapacity: 237.161 GB
UsedPct: 26.02 %
MaxDiskUsedPct: 26.02 %
Tag: {"location" : "default"}
ErrMsg:
Version: 0.15.0-rc04-Unknown
Status: {"lastSuccessReportTabletsTime":"2022-01-26 16:36:57","lastStreamLoadTime":-1}
*************************** 2. row ***************************
BackendId: 10003
Cluster: default_cluster
IP: 192.168.1.3
HostName: doris2
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: NULL
LastHeartbeat: NULL
Alive: false
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
AvailCapacity: 1.000 B
TotalCapacity: 0.000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
Tag: {"location" : "default"}
ErrMsg: java.net.NoRouteToHostException: 沒有到主機的路由
Version:
Status: {"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1}
2 rows in set (0.00 sec)
登入第一臺機器上的fe來新增後面一個fe和兩個be:
新增fe:
ALTER SYSTEM ADD FOLLOWER "192.168.1.3:9010";
新增be:
ALTER SYSTEM ADD BACKEND "192.168.1.1:9050";
ALTER SYSTEM ADD BACKEND "192.168.1.3:9050";
drop fe語法:
mysql> alter system DROP FOLLOWER "192.168.1.3:9010";
drop be語法:
ALTER SYSTEM DECOMMISSION BACKEND "192.168.1.3:9050";
再次檢視fe:
mysql> show proc '/backends' \G
*************************** 1. row ***************************
BackendId: 10002
Cluster: default_cluster
IP: 192.168.1.4
HostName: doris1
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2022-01-26 16:21:42
LastHeartbeat: 2022-01-26 16:44:39
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
AvailCapacity: 175.445 GB
TotalCapacity: 237.161 GB
UsedPct: 26.02 %
MaxDiskUsedPct: 26.02 %
Tag: {"location" : "default"}
ErrMsg:
Version: 0.15.0-rc04-Unknown
Status: {"lastSuccessReportTabletsTime":"2022-01-26 16:44:21","lastStreamLoadTime":-1}
*************************** 2. row ***************************
BackendId: 10003
Cluster: default_cluster
IP: 192.168.1.3
HostName: doris2
HeartbeatPort: 9050
BePort: -1
HttpPort: -1
BrpcPort: -1
LastStartTime: NULL
LastHeartbeat: NULL
Alive: false
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 0
DataUsedCapacity: 0.000
AvailCapacity: 1.000 B
TotalCapacity: 0.000
UsedPct: 0.00 %
MaxDiskUsedPct: 0.00 %
Tag: {"location" : "default"}
ErrMsg: java.net.NoRouteToHostException: 沒有到主機的路由
Version:
Status: {"lastSuccessReportTabletsTime":"N/A","lastStreamLoadTime":-1}
2 rows in set (0.04 sec)
mysql> show proc '/backends' \G
*************************** 1. row ***************************
BackendId: 11022
Cluster: default_cluster
IP: 192.168.1.1
HostName: doris1
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2022-01-26 16:21:42
LastHeartbeat: 2022-01-27 09:51:19
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 96
DataUsedCapacity: 0.000
AvailCapacity: 175.371 GB
TotalCapacity: 237.161 GB
UsedPct: 26.05 %
MaxDiskUsedPct: 26.05 %
Tag: {"location" : "default"}
ErrMsg:
Version: 0.15.0-rc04-Unknown
Status: {"lastSuccessReportTabletsTime":"2022-01-27 09:50:31","lastStreamLoadTime":-1}
*************************** 2. row ***************************
BackendId: 11029
Cluster: default_cluster
IP: 192.168.1.3
HostName: doris2
HeartbeatPort: 9050
BePort: 9060
HttpPort: 8040
BrpcPort: 8060
LastStartTime: 2022-01-27 09:36:43
LastHeartbeat: 2022-01-27 09:51:19
Alive: true
SystemDecommissioned: false
ClusterDecommissioned: false
TabletNum: 96
DataUsedCapacity: 0.000
AvailCapacity: 479.087 GB
TotalCapacity: 499.756 GB
UsedPct: 4.14 %
MaxDiskUsedPct: 4.14 %
Tag: {"location" : "default"}
ErrMsg:
Version: 0.15.0-rc04-Unknown
Status: {"lastSuccessReportTabletsTime":"2022-01-27 09:50:40","lastStreamLoadTime":-1}
2 rows in set (0.01 sec)
建庫建表例子:
建庫:
create database test;
切換庫:
use test;
建表:
CREATE TABLE table_range
(
k1 DATE,
k2 INT,
k3 SMALLINT,
v1 VARCHAR(2048),
v2 DATETIME DEFAULT "2014-02-04 15:36:00"
)
ENGINE=olap
DUPLICATE KEY(k1, k2, k3)
PARTITION BY RANGE (k1)
(
PARTITION p1 VALUES LESS THAN ("2014-01-01"),
PARTITION p2 VALUES LESS THAN ("2014-06-01"),
PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH(k2) BUCKETS 32;
建立複合分割槽表
# 動態分割槽
use test
CREATE TABLE personclusterdata
(
userid VARCHAR(1024),
time DATE,
type VARCHAR(20),
pclusterid VARCHAR(200)
)
PARTITION BY RANGE(time)()
DISTRIBUTED BY HASH(userid,type)
PROPERTIES
(
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.start" = "-360",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_num" = "1",
"dynamic_partition.buckets" = "32"
);
#非動態分割槽
CREATE TABLE personclusterdata_1
(
userid VARCHAR(1024),
time DATE,
type VARCHAR(20),
pclusterid VARCHAR(200)
)
PARTITION BY RANGE(time)
(
PARTITION p20201128 VALUES LESS THAN ('20201128'),
PARTITION p20201129 VALUES LESS THAN ('20201129')
)
DISTRIBUTED BY HASH(userid,type) BUCKETS 32
PROPERTIES("replication_num" = "2");
# 查詢建立情況
SHOW DYNAMIC PARTITION TABLES;
show partitions from personclusterdata;
use test
建立單分割槽表
CREATE TABLE student
(
id INT,
name VARCHAR(50),
age INT,
count BIGINT SUM DEFAULT '0'
)
AGGREGATE KEY (id,name,age)
DISTRIBUTED BY HASH(id) buckets 10
PROPERTIES("replication_num" = "1");
建立一張student表。分桶列為id,桶數為10,副本數為1。
建立複合分割槽表:
CREATE TABLE student2
(
dt DATE,
id INT,
name VARCHAR(50),
age INT,
count BIGINT SUM DEFAULT '0'
)
AGGREGATE KEY (dt,id,name,age)
PARTITION BY RANGE(dt)
(
PARTITION p202007 VALUES LESS THAN ('2020-08-01'),
PARTITION p202008 VALUES LESS THAN ('2020-09-01'),
PARTITION p202009 VALUES LESS THAN ('2020-10-01')
)
DISTRIBUTED BY HASH(id) buckets 10
PROPERTIES("replication_num" = "1");
建立student2表,使用dt欄位作為分割槽列,並且建立3個分割槽發,分別是:
P202007 範圍值是是小於2020-08-01的資料
P202008 範圍值是2020-08-01到2020-08-31的資料
P202009 範圍值是2020-09-01到2020-09-30的資料
查詢分割槽表資訊:
mysql> show partitions from student;
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| 11958 | student | 1 | 2022-01-27 11:16:50 | 0 | NORMAL | | | id | 10 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+-------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
1 row in set (0.01 sec)
mysql> show partitions from student2;
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| 11984 | p202007 | 1 | 2022-01-27 11:16:59 | 0 | NORMAL | dt | [types: [DATE]; keys: [0000-01-01]; ..types: [DATE]; keys: [2020-08-01]; ) | id | 10 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
| 11985 | p202008 | 1 | 2022-01-27 11:16:59 | 0 | NORMAL | dt | [types: [DATE]; keys: [2020-08-01]; ..types: [DATE]; keys: [2020-09-01]; ) | id | 10 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
| 11986 | p202009 | 1 | 2022-01-27 11:16:59 | 0 | NORMAL | dt | [types: [DATE]; keys: [2020-09-01]; ..types: [DATE]; keys: [2020-10-01]; ) | id | 10 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
3 rows in set (0.01 sec)
查動態分割槽表:
mysql> SHOW DYNAMIC PARTITION TABLES;
+-------------------+--------+----------+-------+------+--------+---------+----------------+-------------------------+---------+---------------------+---------------------+--------+------------------------+----------------------+------------------------+
| TableName | Enable | TimeUnit | Start | End | Prefix | Buckets | ReplicationNum | ReplicaAllocation | StartOf | LastUpdateTime | LastSchedulerTime | State | LastCreatePartitionMsg | LastDropPartitionMsg | ReservedHistoryPeriods |
+-------------------+--------+----------+-------+------+--------+---------+----------------+-------------------------+---------+---------------------+---------------------+--------+------------------------+----------------------+------------------------+
| personclusterdata | true | DAY | -360 | 3 | p | 32 | 1 | tag.location.default: 1 | NULL | 2022-01-27 11:19:45 | 2022-01-27 11:19:45 | NORMAL | NULL | NULL | NULL |
+-------------------+--------+----------+-------+------+--------+---------+----------------+-------------------------+---------+---------------------+---------------------+--------+------------------------+----------------------+------------------------+
1 row in set (0.00 sec)
查動態分割槽表分割槽情況:
mysql> show partitions from personclusterdata;
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| PartitionId | PartitionName | VisibleVersion | VisibleVersionTime | VisibleVersionHash | State | PartitionKey | Range | DistributionKey | Buckets | ReplicationNum | StorageMedium | CooldownTime | LastConsistencyCheckTime | DataSize | IsInMemory | ReplicaAllocation |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
| 12062 | p20220127 | 1 | 2022-01-27 11:19:45 | 0 | NORMAL | time | [types: [DATE]; keys: [2022-01-27]; ..types: [DATE]; keys: [2022-01-28]; ) | userid, type | 32 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
| 12127 | p20220128 | 1 | 2022-01-27 11:19:45 | 0 | NORMAL | time | [types: [DATE]; keys: [2022-01-28]; ..types: [DATE]; keys: [2022-01-29]; ) | userid, type | 32 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
| 12192 | p20220129 | 1 | 2022-01-27 11:19:45 | 0 | NORMAL | time | [types: [DATE]; keys: [2022-01-29]; ..types: [DATE]; keys: [2022-01-30]; ) | userid, type | 32 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
| 12257 | p20220130 | 1 | 2022-01-27 11:19:45 | 0 | NORMAL | time | [types: [DATE]; keys: [2022-01-30]; ..types: [DATE]; keys: [2022-01-31]; ) | userid, type | 32 | 1 | HDD | 9999-12-31 23:59:59 | NULL | 0.000 | false | tag.location.default: 1 |
+-------------+---------------+----------------+---------------------+--------------------+--------+--------------+----------------------------------------------------------------------------+-----------------+---------+----------------+---------------+---------------------+--------------------------+----------+------------+-------------------------+
4 rows in set (0.00 sec)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2854840/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL 5.6.19編譯安裝詳細步驟MySql編譯
- docker安裝portainer詳細步驟DockerAI
- MySQL的安裝步驟(詳細)MySql
- CentOS7.2編譯安裝PHP7.2.3之史上最詳細步驟。CentOS編譯PHP
- LAMP 編譯安裝基本步驟LAMP編譯
- MHA安裝和部署步驟
- Mac安裝Redis,詳細redis安裝步驟MacRedis
- CentOS 7 安裝MongoDB詳細步驟CentOSMongoDB
- 安裝fbprophet模組詳細步驟
- Linux安裝JDK詳細步驟LinuxJDK
- CentOS 7上安裝WordPress詳細步驟CentOS
- Linux安裝jdk的詳細步驟。LinuxJDK
- CentOS 7.4安裝redis 4.0詳細步驟CentOSRedis
- CentOS 6.5下Redis安裝詳細步驟CentOSRedis
- Linux安裝jdk的詳細步驟LinuxJDK
- arcgis安裝教程10.2 arcgis詳細安裝步驟
- zookeeper安裝部署步驟
- vnc安裝步驟,vnc安裝步驟詳解VNC
- Doris安裝部署
- linux安裝mysql的步驟和方法詳細說明LinuxMySql
- UBUNTU手動安裝JDK的詳細步驟UbuntuJDK
- Git學習2 --- Git安裝詳細步驟Git
- ubuntu 18.04安裝kalibr(詳細步驟)Ubuntu
- 安裝Linux14.04詳細步驟Linux
- CentOS 7.4下安裝nginx的詳細步驟CentOSNginx
- MySQL 5.7.17 原始碼方式安裝詳細步驟MySql原始碼
- CentOS7上安裝WordPress詳細步驟CentOS
- CDH impala for Apache HADOOP 安裝編譯步驟.ApacheHadoop編譯
- centos7安裝教程詳解 centos7安裝詳細步驟CentOS
- SAP2000 22安裝教程(詳細安裝步驟)
- 交叉編譯PHP5、Nginx、Squid的詳細步驟編譯PHPNginxUI
- KeyShot9.3安裝教程(附詳細步驟)
- Win7系統安裝詳細教程步驟Win7
- centos下svn的安裝及配置詳細步驟CentOS
- db29.7 for linux 5.4 安裝詳細步驟DB2Linux
- Virtualbox7安裝及使用詳細步驟
- 一步一步編譯最新版Apache Doris 0.15版本的詳細過程編譯Apache
- 超詳細oracle 11g安裝步驟 win版本Oracle