GlusterFS常用设置命令
可信存储池(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常用设置命令的更多相关文章
- 转Linux 下用alias 设置命令别名快速切换常用命令
https://blog.csdn.net/u012830148/article/details/80618616 在linux下开发,经常需要切换目录,如果目录很长则切换起来非常的麻烦,针对一些常用 ...
- GlusterFS常用维护操作命令
GlusterFS常用维护操作命令 1.启动/关闭/查看glusterd服务 # /etc/init.d/glusterd start # /etc/init.d/glusterd stop # /e ...
- 常用 Git 命令清单
我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下 ...
- 分享一个常用Adb命令
分享一个常用Adb命令 首先 首先感谢@xuxu的常用adb命令,收益良多,但是已经不能满足于我,所以补充了下. 再者 好久没发帖了,最近论坛老司机们都在讨论/总结,我就用这个干货回报吧. 最后 基于 ...
- liunx常用的命令
计算机网络的主要优点是能够实现资源和信息的共享,并且用户可以远程访问信息.Linux提供了一组强有力的网络命令来为用户服务,这些工具能够帮助用户登录到远程计算机上.传输文件和执行远程命令等. 本章介绍 ...
- 上网八个常用cmd命令你掌握了几个?
上网八个常用cmd命令你掌握了几个? 一.ping 它是用来检查网络是否通畅或者网络连接速度的命令.作为一个生活在网络上的管理员或者黑客来说,ping命令是第一个必须掌握 ...
- 常用 Git 命令清单 转
我每天使用 Git ,但是很多命令记不住. 一般来说,日常使用只要记住下图6个命令,就可以了.但是熟练使用,恐怕要记住60-100个命令. 下面是我整理的常用 Git 命令清单.几个专用名词的译名如下 ...
- Linux文件/目录权限设置命令:chmod
文件/目录权限设置命令:chmod 这是Linux系统管理员最常用到的命令之一,它用于改变文件或目录的访问权限.该命令有两种用法: 用包含字母和操作符表达式的文字设定法 其语法格式为:chmod [w ...
- Oracle SQL*plus常用的命令和函数
常用命令: 连接sqlplus命令行下运行cmd进入,如以sys模式登陆,命令如下:(1).sqlplus "sys/zhb126 as sysdba" (2).sqlplus/n ...
随机推荐
- Nginx中的break和last
rewrite中的break和last 两个指令用法相同,但含义不同,需要放到rewrite规则的末尾,用来控制重写后的链接是否继续被nginx配置执行(主要是rewrite.return指令). 示 ...
- Ext.bind函数说明
bind( fn, [scope], [args], [appendArgs] ) : FunctionCreate a new function from the provided fn, chan ...
- 编写可维护的JavaScript-随笔(六)
避免空比较 If(item !== null){ item.sort(); Item.forEach(function(item){ //执行代码 } } } 以上判断中item期待的是数组类型的,但 ...
- 剑指前端(前端入门笔记系列)——Math对象
Math对象 ECMAScript将一些常用的数学公式和信息封装到了一个对象中——Math对象,为我们实现数学方面的计算功能提供了便捷,而且该对象还提供了辅助完成这些计算的属性和方法 属性 con ...
- 49.react中使用less
1.安装less:npm install less less-loader --save 2.webpack.config.js中配置: oneOf: [ { test: /\.less$/, ...
- ES6的新特性
ECMAScript 6(简称ES6)是JavaScript语言的下一代标准.因为当前版本的ES6是在2015年发布的,又称ECMAScript 2015.ES6就是ES2015. 虽然目前并不是所有 ...
- APS系统的现状以及与MES系统的关联
MES是智能工厂的核心,将前端产品设计.工艺定义阶段的产品数据管理与后端制造阶段的生产数据管理融合,实现产品设计.生产过程.维修服务闭环协同全生命周期管理. APS就是高级计划排程 应该说APS本来是 ...
- 英特尔加速 Android 应用
下载地址 https://software.intel.com/zh-cn/android https://github.com/intel/haxm 解压目录 双击.exe,安装即可 检查SDK M ...
- Weshop基于Spring Cloud开发的小程序商城系统
WESHOP | 基于微服务的小程序商城系统 Weshop是基于Spring Cloud(Greenwich)开发的小程序商城系统,提供整套公共微服务服务模块,包含用户中心.商品中心.订单中心.营销中 ...
- linux防火墙和xshell的链接
centos7用的firewalld 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: ...