可信存储池(Trusted Storage Pool)
创建存储池
例如要创建一个包含3个服务器的存储池,则需要从第一个服务器server1中把另外两个服务器加入存储池中:
# gluster peer probe server2
Probe successful

# gluster pool peer server3
Probe successful

查看存储池状态:
# gluster peer status
Number of Peers: 2

Hostname: server2.quenywell.com
Uuid: 86bd7b96-1320-4cd5-b3e1-e537d06dd5f7
State: Peer in Cluster (Connected)

Hostname: server3.quenywell.com
Uuid: c191b17b-ab9d-4b15-a70d-dcc92be067c9
State: Peer in Cluster (Connected)

从存储池移除服务器
假设要把server3从存储池里删除,可以使用以下命令:
# gluster peer detach server3
Detach successful
GlusterFS逻辑卷(Volume)
逻辑卷由一个或多个存储块(Brick)组成,每个存储块对应存储池中的一个目录。
GlusterFS的基本类型有三个,分别是分散存储(Distributed,将不同的文件放在不同的存储块)、镜像存储(Replicated,同一个文件存放在两个以上的存储块,相当于RAID1) 和分片存储(Striped,将一个文件分划分为多个固定长度的数据,分散存放在所有存储块,相当于RAID0)。另外Distributed也可以跟Replicated和Striped组合形成新的类型。
建立GlusterFS逻辑卷的基本语法:
# gluster volume create [stripe ] [replica ] [device vg] [transport ] ...
创建Distributed逻辑卷
创建一个名字为dis-volume、包含两个存储块、使用TCP协议的Distributed逻辑卷:
# gluster volume create dis-volume server1:/data server2:/data
Creation of dis-volume has been successful
Please start the volume to access data.
查看逻辑卷状态:
# gluster volume info

Volume Name: dis-volume
Type: Distribute
Volume ID: 5429d6c1-44e5-43ad-a495-0a1f5b6d774b
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: server1.quenywell.com:/data
Brick2: server2.quenywell.com:/data

创建Replicated逻辑卷
创建一个名字为rep-volume,包含两个存储块,使用TCP协议的Replicated逻辑卷:
# gluster volume create rep-volume replica 2 transport tcp server1:/data server2:/data
Creation of rep-volume has been successful
Please start the volume to access data.
创建Striped逻辑卷
创建一个名字为strip-volume,包含两个存储块,使用TCP协议的Striped逻辑卷:
# gluster volume create strip-volume stripe 2 transport tcp server1:/data server2:/data
Creation of strip-volume has been successful
Please start the volume to access data.
GlusterFS逻辑卷权限控制(可选,非必须)
可以给Gluster逻辑卷设置访问权限以增加安全性。可使用auth.allow和auth.reject允许或禁止特定IP地址访问逻辑卷,支持*通配符。例如:192.168.0.*、192.168.*、192.*都是符合规则的。
例如允许192.168.0.*网段的主机访问rep-volume:
# gluster volume set rep-volume auth.allow 192.168.0.*
启动GlusterFS逻辑卷
注意:逻辑卷在使用前必须先启动!
基本语法:
# gluster volume start
例如要启动rep-volume:
# gluster start rep-volume
Starting rep-volume has been successful
查看GlusterFS逻辑卷状态
基本语法:
# gluster volume info
例如要查看rep-volume状态:
# gluster volume info rep-volume

Volume Name: rep-volume
Type: Replicate
Volume ID: 5429d6c1-44e5-43ad-a495-0a1f5b6d774b
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: server1.quenywell.com:/data
Brick2: server2.quenywell.com:/data

停止GlusterFS逻辑卷
# gluster volume stop rep-volume
Stopping volume will make its data inaccessible. Do you want to continue? (y/n)
输入y然后按回车键(Enter),将会出现如下信息:
Stopping volume rep-volume has been successful
删除GlusterFS逻辑卷
# gluster volume delete rep-volume
Deleting volume will erase all information about the volume. Do you want to continue? (y/n)
输入y然后按回车键(Enter),将会出现如下信息:
Deleting volume test-volume has been successful
存储块Brick操作命令
增加Brick
在rep-volume卷中增加一个存储块server3:/data:
# gluster volume add-brick rep-volume server3:/data
Add Brick successful
重要:每次操作存储块之后都必须执行一次rebalance命令!
# gluster volume rebalance rep-volume start
Starting rebalancing on volume rep-volume has been successful
删除Brick
在rep-volume卷中删除存储块server3:/data:
# gluster volume remove-brick rep-volume server3:/data
Removing brick(s) can result in data loss. Do you want to Continue? (y/n)
输入y然后按回车键(Enter),将会出现如下信息:
Remove Brick successful
执行rebalance命令:
# gluster volume rebalance rep-volume start
Starting rebalancing on volume rep-volume has been successful

GlusterFS常用设置命令的更多相关文章

  1. 转Linux 下用alias 设置命令别名快速切换常用命令

    https://blog.csdn.net/u012830148/article/details/80618616 在linux下开发,经常需要切换目录,如果目录很长则切换起来非常的麻烦,针对一些常用 ...

  2. GlusterFS常用维护操作命令

    GlusterFS常用维护操作命令 1.启动/关闭/查看glusterd服务 # /etc/init.d/glusterd start # /etc/init.d/glusterd stop # /e ...

  3. 常用 Git 命令清单

    我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下 ...

  4. 分享一个常用Adb命令

    分享一个常用Adb命令 首先 首先感谢@xuxu的常用adb命令,收益良多,但是已经不能满足于我,所以补充了下. 再者 好久没发帖了,最近论坛老司机们都在讨论/总结,我就用这个干货回报吧. 最后 基于 ...

  5. liunx常用的命令

    计算机网络的主要优点是能够实现资源和信息的共享,并且用户可以远程访问信息.Linux提供了一组强有力的网络命令来为用户服务,这些工具能够帮助用户登录到远程计算机上.传输文件和执行远程命令等. 本章介绍 ...

  6. 上网八个常用cmd命令你掌握了几个?

                   上网八个常用cmd命令你掌握了几个? 一.ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握 ...

  7. 常用 Git 命令清单 转

    我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下 ...

  8. Linux文件/目录权限设置命令:chmod

    文件/目录权限设置命令:chmod 这是Linux系统管理员最常用到的命令之一,它用于改变文件或目录的访问权限.该命令有两种用法: 用包含字母和操作符表达式的文字设定法 其语法格式为:chmod [w ...

  9. Oracle SQL*plus常用的命令和函数

    常用命令: 连接sqlplus命令行下运行cmd进入,如以sys模式登陆,命令如下:(1).sqlplus "sys/zhb126 as sysdba" (2).sqlplus/n ...

随机推荐

  1. IntelliJ IDEA重命名变量的问题

    当我尝试使用Shift+ F6或简单地使用Refactor => Rename重命名变量时,有时intellij不仅重命名我想要的那个,而且还重命名具有相同名称的所有其他变量(在其他文件中)以及 ...

  2. Eureka设计原理

    1. Eureka设计原理 1.1. 前言 目前我越来越关注技术原理层面的东西,开始考虑中间件设计背后,要考虑哪些因素,为什么要这样设计,有什么优化的地方,这次来讨论Eureka 1.2. 设计问题 ...

  3. js学习之堆栈内存

    **栈内存** >基本数据类型值是直接存放在栈内存中的 栈内存中的变量一般都是已知大小或者有范围上限的,算作一种简单存储.而堆内存存储的对象类型数据对于大小这方面,一般都是未知的.个人认为,这也 ...

  4. 47、安装node-sass后运行报错

    vue安装node-sass编译报错安装node-scss报错安装node-scss报错在搭建vue脚手架 或者是在vue项目中,想使用sass的功能, npm install node-sass - ...

  5. JAVA - Eclipse不能打断点的解决方法

    今天调试eclipse程序,莫名的就遇到这种问题. 解决: 在run菜单里面,把 “skip all breakpoints”  选项勾去即可. 如下图:

  6. Spring MVC 上传、下载、显示图片

    目录 1. 准备工作 1.1 数据库表准备 1.2 实体类 User 和 Mapper(DAO) 1.3 pom.xml 依赖包 1.4 SSM 框架的整合配置 2. 控制器 UserControll ...

  7. oracle 排序后分页查询

    demo: select * from ( select * from DEV_REG_CFG_CAMERA where 1 = 1 order by unid asc) where rownum & ...

  8. NumPy 之 案例(随机漫步)

    import numpy as np The numpy.random module supplements(补充) the built-in Python random with functions ...

  9. go build -tags 的使用

    go build 使用tag来实现编译不同的文件 go-tooling-workshop 中关于go build的讲解可以了解到go bulid的一些用法,这篇文章最后要求实现一个根据go bulid ...

  10. Hadoop-HA集群搭建-rehl7.4

    Hadoop-HA集群搭建-rehl7.4 hadoop 无说明需要登录其它机器操作,都是在集群的HD-2-101上执行的命令. 所有安装包地址:百度网盘,提取码:24oy 1. 基础环境配置 1.1 ...