zpool use vdevs distribute

简介:
zpool并不限制根vdev的数量, 并且也不限制他们的属性(如mirror or raidz), 但是属性不同会有提示.
例如
[root@db-172-16-3-150 ~]# zpool create zpp mirror /ssd1/zfs.1 /ssd1/zfs.2
[root@db-172-16-3-150 ~]# zpool status zpp
  pool: zpp
 state: ONLINE
  scan: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        zpp              ONLINE       0     0     0
          mirror-0       ONLINE       0     0     0
            /ssd1/zfs.1  ONLINE       0     0     0
            /ssd1/zfs.2  ONLINE       0     0     0

继续添加同属性的vdev很顺利.
[root@db-172-16-3-150 ~]# zpool add zpp mirror /ssd1/zfs.3 /ssd1/zfs.4
[root@db-172-16-3-150 ~]# zpool status zpp
  pool: zpp
 state: ONLINE
  scan: none requested
config:

        NAME             STATE     READ WRITE CKSUM
        zpp              ONLINE       0     0     0
          mirror-0       ONLINE       0     0     0
            /ssd1/zfs.1  ONLINE       0     0     0
            /ssd1/zfs.2  ONLINE       0     0     0
          mirror-1       ONLINE       0     0     0
            /ssd1/zfs.3  ONLINE       0     0     0
            /ssd1/zfs.4  ONLINE       0     0     0

这两个vdev mirror-0和mirror-1对这个zpool来说, 是分布使用的.
[root@db-172-16-3-150 ~]# zfs create zpp/test
[root@db-172-16-3-150 ~]# cd /zpp/test
[root@db-172-16-3-150 test]# dd if=/dev/zero of=./test bs=1k count=10230
10230+0 records in
10230+0 records out
10475520 bytes (10 MB) copied, 0.233064 s, 44.9 MB/s
[root@db-172-16-3-150 test]# ll
total 7812
-rw-r--r-- 1 root root 10475520 May 27 15:15 test
[root@db-172-16-3-150 test]# zpool list -v zpp
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
zpp   191M  10.4M   181M     5%  1.00x  ONLINE  -
  mirror  95.5M  5.41M  90.1M         -
    /ssd1/zfs.1      -      -      -         -
    /ssd1/zfs.2      -      -      -         -
  mirror  95.5M  4.98M  90.5M         -
    /ssd1/zfs.3      -      -      -         -
    /ssd1/zfs.4      -      -      -         -

如果添加的vdev和原来的vdev属性不一致, 那么会提示有问题, 现实中当然也是不建议这么来使用的.
使用-f强制添加.
[root@db-172-16-3-150 test]# zpool add zpp raidz1 /ssd1/zfs.5 /ssd1/zfs.6 /ssd1/zfs.7
invalid vdev specification
use '-f' to override the following errors:
mismatched replication level: pool uses mirror and new vdev is raidz
[root@db-172-16-3-150 test]# zpool add -f zpp raidz1 /ssd1/zfs.5 /ssd1/zfs.6 /ssd1/zfs.7

已经存在的数据不会重分布, 但是新增的数据会重分布到新的vdev上面
[root@db-172-16-3-150 test]# cp test ./test.1
[root@db-172-16-3-150 test]# zpool list -v zpp
NAME   SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
zpp   477M  22.0M   455M     4%  1.00x  ONLINE  -
  mirror  95.5M  8.66M  86.8M         -
    /ssd1/zfs.1      -      -      -         -
    /ssd1/zfs.2      -      -      -         -
  mirror  95.5M  8.24M  87.3M         -
    /ssd1/zfs.3      -      -      -         -
    /ssd1/zfs.4      -      -      -         -
  raidz1   286M  5.15M   281M         -
    /ssd1/zfs.5      -      -      -         -
    /ssd1/zfs.6      -      -      -         -
    /ssd1/zfs.7      -      -      -         -

相关文章
|
6月前
|
SQL 运维 分布式计算
一篇文章彻底掌握 hive 中的 ORDER/SORT/CLUSTER/DISTRIBUTE BY 和 BUCKET 桶表
一篇文章彻底掌握 hive 中的 ORDER/SORT/CLUSTER/DISTRIBUTE BY 和 BUCKET 桶表
|
9月前
|
SQL 关系型数据库 BI
PG:什么是grouping sets
PG:什么是grouping sets
97 0
|
10月前
|
SQL 算法 关系型数据库
Hive中order by,sort by,distribute by和cluster by详解
Hive中order by,sort by,distribute by和cluster by详解
274 0
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause
172 0
1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GROUP BY clause
|
算法 搜索推荐 数据库
一个有点咬文嚼字的 sorting 和 ordering
为什么排序算法的英文是 sorting 而不是 ordering。
91 0
SAP RETAIL 维护Plant Profile 报错 - No customer account group assigned to business partner grouping ZNM2
SAP RETAIL 维护Plant Profile 报错 - No customer account group assigned to business partner grouping ZNM2
SAP RETAIL 维护Plant Profile 报错 - No customer account group assigned to business partner grouping ZNM2
how is sales pipeline retrieved from backend
how is sales pipeline retrieved from backend
81 0
how is sales pipeline retrieved from backend
|
SQL 关系型数据库 MySQL
Accelerating Queries with Group-By and Join By Groupjoin
这篇paper介绍了HyPer中引入的groupjoin算子,针对 join + group by这种query,可以在某些前提条件下,在join的过程中同时完成grouping+agg的计算。 比如用hash table来实现hash join和group by,就可以避免再创建一个hash table,尤其当join的数据量很大,产生的group结果又较少时,可以很好的提升执行效率。
318 0
Accelerating Queries with Group-By and Join By Groupjoin
|
算法 关系型数据库 MySQL
Fundamental Techniques for Order Optimization
这是一篇1996年的老paper了,主要讲解了IBM DB2如何针对query当中的有序性进行优化。但对于后续physical property的优化有较为深远的影响,由于DB2的优化器起源于System-R以及其后续演进的starburst,因此延续了system-R中的interesting order和order property的概念。关于system-R的介绍请看之前的文章。 order这种physical property并不只限于order by算子,基于有序的group by/distinct等,都会利用到数据的排序操作,而排序本身就是比较昂贵的计算,因此应该对其做尽可能的优化
189 0
Fundamental Techniques for Order Optimization