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 ...
随机推荐
- js学习之存储
一.Cookie和Session的区别 1.cookie数据存放在客户的浏览器上,session数据放在服务器上(一般以内存.数据库.文件形式). 2.session会在一定时间内保存在服务器上.当访 ...
- Java 控制流程 之 循环语句
循环:循环语句可以在满足循环条件的情况下,反复执行某一段代码,这段被重复执行的代码被称为循环体语句,当反复 执行这个循环体时,需要在合适的时候把循环判断条件修改为false,从而结束循环,否则循环将一 ...
- Kafka Streams开发入门(4)
背景 上一篇演示了filter操作算子的用法.今天展示一下如何根据不同的条件谓词(Predicate)将一个消息流实时地进行分流,划分成多个新的消息流,即所谓的流split.有的时候我们想要对消息流中 ...
- CDA数据分析【第二章:数据收集与导入】
一.概述 数据是对我们所研究现象的属性和特征的具体描述,在分析数据前必须要做的工作就是收集数据.按照存储形式可以将数据划分为结构化数据.非结构化数据和半结构化数据. 1.结构化数据 能够用数据或统一的 ...
- The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone 。
The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. 今天有Mys ...
- Docker 安装环境(redis、mongodb、mysql等)
Docker下载地址 [ https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe ] 一.创建/启动 redis ...
- Odoo CRM模块
转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10825983.html 一:理解CRM CRM:客户关系管理,是指企业用CRM技术来管理与客户之间的关系. ...
- Linux系统的时间比北京时间慢12个小时的处理方案(将EDT时区改为CST)
今天查看Linux操作系统的时间,发现比正常时间慢12个小时整,感觉很奇怪,后来使用ntp服务器校对时间发现也是不管用的,还是慢12个小时.之前遇到过是慢8个小时,但是我知道是因为使用的是UTC时间, ...
- Istio技术与实践06:史上最全!Istio安装参数介绍
一. CertManage Istio-1.0版本新加入的组件,利用ACME为Istio签发证书 Key Default Value Description certmanager.enabled T ...
- 在linux系统中如何通过shell脚本批量设置redis键值对
业务逻辑:批量设置redis中手机号的验证码为888888: 准备shell脚本如下:将18888888100~18888888110的手机号验证码设置为888888: #!/bin/bash ;i& ...