GlusterFS常用维护操作命令
GlusterFS常用维护操作命令
1.启动/关闭/查看glusterd服务
# /etc/init.d/glusterd start
# /etc/init.d/glusterd stop
# /etc/init.d/glusterd status
2. 开机自动启动glusterd服务
# chkconfig glusterd on # Red Hat
# update-rc.d glusterd defaults # Debian
# echo "glusterd" >>/etc/rc.local # Others
3. 查看卷信息
gluster volume info
4.为存储池添加/移除服务器节点
在其中一个节点上操作即可:
# gluster peer probe <SERVER>
# gluster peer detach <SERVER>
注意,移除节点时,需要提前将该节点上的Brick移除。
查看所有节点的基本状态(显示的时候不包括本节点):
# gluster peer status
5. 挂载分区
# mount -t ext4 /dev/sdd1 /mnt/brick1
6. 创建/启动/停止/删除卷
# gluster volume create <NEW-VOLNAME>[stripe <COUNT> | replica <COUNT>] [transport [tcp | rdma | tcp,rdma]] <NEW-BRICK1> <NEW-BRICK2> <NEW-BRICK3> <NEW-BRICK4>...
# gluster volume start <VOLNAME>
# gluster volume stop <VOLNAME>
# gluster volume delete <VOLNAME>
注意,删除卷的前提是先停止卷。
7. 客户端以glusterfs方式挂载
# mount -t glusterfs <SERVER>:/<VOLNAME><MOUNTDIR>
对于OpenStack,计算和控制节点都要挂载/var/lib/nova/instances,控制节点还要挂载/var/lib/glance/images。
8. 查看卷信息
列出集群中的所有卷:
# gluster volume list
查看集群中的卷信息:
# gluster volume info [all]
查看集群中的卷状态:
# gluster volume status [all]
# gluster volume status <VOLNAME> [detail| clients | mem | inode | fd]
查看本节点的文件系统信息:
# df -h [<MOUNT-PATH>]
查看本节点的磁盘信息:
# fdisk -l
9.配置卷
# gluster volume set <VOLNAME> <OPTION> <PARAMETER>
10. 扩展卷
# gluster volume add-brick <VOLNAME> <NEW-BRICK>
注意,如果是复制卷或者条带卷,则每次添加的Brick数必须是replica或者stripe的整数倍。
11. 收缩卷
先将数据迁移到其它可用的Brick,迁移结束后才将该Brick移除:
# gluster volume remove-brick <VOLNAME> <BRICK> start
在执行了start之后,可以使用status命令查看移除进度:
# gluster volume remove-brick <VOLNAME> <BRICK> status
不进行数据迁移,直接删除该Brick:
# gluster volume remove-brick <VOLNAME> <BRICK> commit
注意,如果是复制卷或者条带卷,则每次移除的Brick数必须是replica或者stripe的整数倍。
12.迁移卷
使用start命令开始进行迁移:
# gluster volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> start
在数据迁移过程中,可以使用pause命令暂停迁移:
# gluster volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> pause
在数据迁移过程中,可以使用abort命令终止迁移:
# gluster volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> abort
在数据迁移过程中,可以使用status命令查看迁移进度:
# gluster volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> status
在数据迁移结束后,执行commit命令来进行Brick替换:
# gluster volume replace-brick <VOLNAME> <BRICK> <NEW-BRICK> commit
13. 重新均衡卷
不迁移数据:
# gluster volume rebalance <VOLNAME> lay-outstart
# gluster volume rebalance <VOLNAME> start
# gluster volume rebalance <VOLNAME> startforce
# gluster volume rebalance <VOLNAME> status
# gluster volume rebalance <VOLNAME> stop
14.系统扩展维护
开启/关闭系统配额:
# gluster volume quota <VOLNAME> enable | disable
设置目录配额:
# gluster volume quota <VOLNAME> limit-usage <DIR> <VALUE>
查看配额:
# gluster volume quota <VOLNAME> list [<DIR>]
地域复制(geo-replication):
# gluster volume geo-replication <MASTER> <SLAVE> start | status | stop
IO信息查看:
# gluster volume profile <VOLNAME> start | info | stop
Top监控:
Top命令允许你查看Brick的性能,例如:read,write, file open calls, file read calls, file write calls, directory opencalls, and directory real calls。所有的查看都可以设置 top数,默认100。
查看打开的 fd:
# gluster volume top <VOLNAME> open[brick <BRICK>] [list-cnt <COUNT>]
其中,open可以替换为read, write, opendir, readdir等。
查看每个 Brick 的读性能:
# gluster volume top <VOLNAME> read-perf [bs <BLOCK-SIZE> count <COUNT>] [brick <BRICK>] [list-cnt <COUNT>]
其中,read-perf可以替换为write-perf等。
15.GlusterFS优化
# 设置 cache 大小, 默认32MB
gluster volume set senyintvolume performance.cache-size 4GB
# 设置 io 线程, 太大会导致进程崩溃
gluster volume set senyintvolume performance.io-thread-count 16
# 设置 网络检测时间, 默认42s
gluster volume set senyintvolume network.ping-timeout 10
# 设置 写缓冲区的大小, 默认1M
gluster volume set senyintvolume performance.write-behind-window-size 1024MB
# 开启 指定 volume 的配额,不使用
gluster volume quota k8s-volume enable
# 限制 指定 volume 的配额,不使用
gluster volume quota k8s-volume limit-usage / 1TB
16.操作示例
- 强制创建卷
gluster volume create testvol ip:/date/brick1 ip:/date/brick2 force
- 磁盘限额
to quota glusterfs
主要是对挂载点下的某个目录进行空间限额(对客户端下某个目录限制,而不是对组成的空间进行的限制 如:server1目录、server2目录)
#gluster volume quota test-volume enable 激活quota功能
#gluster volume quota test-volume disable 关闭quota功能
#gluster volume quota test-volume limit-usage /data 10GB ---/exp2/data 目录限制
#gluster volume quota test-volume list ---quota信息列表
#gluster volume set test-volume features.quota-timeout 5 设置信息的超时时间
#gluster volume quota test-volume remove /data 删除某个目录的quota设置
- 添加存储节点
#gluster peer probe server4 向turst pool 添加新server4
#gluster volume add-brick test-volume server4:/server4 卷组添加新空间
gluster volume info 查看当前所有volume状态
#gluster volume rebalance test-volume start 对扩容后的卷组进行rebalance
#gluster volume rebalance test-volume status
#gluster volume rebalance test-volume stop
- glusterfs的参数进行设置优化
#gluserfs volume set test-volume performance.cache-size 256M
- 删除GlusterFS磁盘:
# gluster volume stop datavolume1
# gluster volume delete datavolume1
- 卸载GlusterFS磁盘:
# gluster peer detach idc1-server4
- ACL访问控制:
# gluster volume set datavolume1 auth.allow 10.100.1.*,10.200.1.*
- 添加GlusterFS节点:
# gluster peer probe idc1-server5
# gluster peer probe idc1-server6
# gluster volume add-brick datavolume1 idc1-server5:/usr/local/share/datavolume1 idc1-server6:/usr/local/share/datavolume1
- 迁移GlusterFS磁盘数据:
# gluster volume remove-brick datavolume1 idc1-server1:/usr/local/share/datavolume1 idc1-server5:/usr/local/share/datavolume1 start
# gluster volume remove-brick datavolume1 idc1-server1:/usr/local/share/datavolume1 idc1-server5:/usr/local/share/datavolume1 status
# gluster volume remove-brick datavolume1 idc1-server1:/usr/local/share/datavolume1 idc1-server5:/usr/local/share/datavolume1 commit
- 数据重新分配:
# gluster volume rebalance datavolume1 start
# gluster volume rebalance datavolume1 status
# gluster volume rebalance datavolume1 stop
- 修复GlusterFS磁盘数据(例如在idc1-server1宕机的情况下):
# gluster volume replace-brick datavolume1 idc1-server1:/usr/local/share/datavolume1 idc1-server5:/usr/local/share/datavolume1 commit -force
# gluster volume heal datavolume1 full
GlusterFS常用维护操作命令的更多相关文章
- 记录 git 常用的操作命令总结
记录 git 常用的操作命令总结 2016-12-15 16:44:04 作为一名开发者,熟悉使用 git 代码管理工具是一项必备的基本技能.git 相较 SVN 而言,其优点不言而喻.git 的功能 ...
- Oracle RAC 常用维护工具和命令
Oracle RAC 常用维护工具和命令 分类: Oracle Basic Knowledge Oracle RAC2010-03-09 01:02 13987人阅读 评论(6) 收藏 举报 orac ...
- dos常用文件操作命令
1.DIR 含义: 显示指定目录下的文件和子目录列表 类型: 内部命令 格式: DIR[drive:][path][filename][/p][/w][/A[[:]attributes]][/O[[: ...
- RAC 常用维护工具和命令(oracle 10g)
Oracle 的管理可以通过OEM或者命令行接口. Oracle Clusterware的命令集可以分为以下4种: 节点层:osnodes 网络层:oifcfg 集群层:crsctl, ocrchec ...
- CentOS运维常用管理操作命令
自己整理的整理Linux常用运维和linux常用管理操作命令,当然不是非常详细和丰富,但是也基本上够用了吧.欢迎留言补充更多的Linux常用运维和linux常用管理操作命令.不断完善中.... 备份m ...
- git基础常用维护命令
开发模式介绍 master为生产环境分支 trunk为测试环境分支 开发分支由程序员自己取名 比如来一个新项目之后,下面步骤都是在本地操作 1.从本地获取远程master最新代码,保证本地master ...
- svn常用维护命令
公司版本管理同时用的svn和gitlab,有互补作用 这边写一写慢慢积累自己用过的svn常用维护 查看版本范围之间的变化: [root@192-168-2-82 mnt]# svn log -r 45 ...
- git中常用的操作命令有哪些?常用操作命令归纳
git中常用的操作命令有哪些?本篇文章就给到大家归纳了一些git中常用操作命令.有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. git开始 全局配置:配置用户名和e-mail地址 1 ...
- MySQL常用维护命令和操作
MySQL数据库安装后,除了包括MySQL服务器进程管理外,还提供了大量工具用于管理和维护MySQL服务器的其它工作.下面PHP程序员雷雪松介绍的这些命令都是在MySQL交互界面以外的命令行中执行的. ...
随机推荐
- Git 06 分支
参考源 https://www.bilibili.com/video/BV1FE411P7B3?spm_id_from=333.999.0.0 版本 本文章基于 Git 2.35.1.2 概述 分支用 ...
- 项目一共30个模块,你叫我maven版本一个个手动改?
大家好呀,我是铂赛东,一个乱入公众号博主的开源作者.今天分享一个maven小技巧,希望帮助到大家. 之前有个群友私聊问我,如何快速统一去更改项目中所有的maven版本号,他说之前都是手动一个个去修改, ...
- 聊一款可以自动跳过手机APP广告的神器!
平时使用手机,很多APP都有开屏广告,有些短的一两秒,长的三五秒,用起来浪费时间不说,有时候想点击跳过,一不小心还可以点进广告,进行跳转,让人很不舒服. 今天我给小伙伴们推荐一个可以跳过APP开屏广告 ...
- python中的画图神器——turtle模块
turtle库的基础命令介绍(1)画布画布cancas是绘图区域,可以设置它的大小和初始位置 turtle.screensize(1000,600,'red') 大小的设置 turtle.setup( ...
- C#基础_类与对象的关系
类不占内存,对象占内存
- 【java】基础1-字符串、堆、栈、静态与引用类型
/*结论:1,一般变量(int,float,boolean..)使用==比较,引用类型(String,int[],对象)使用equals比较.2,一般的变量存放在栈中,new出来的对象都存放在堆中,字 ...
- c# 异步进阶————channel [一]
前言 该系列为异步编程的进阶篇,其实也不能这么讲.世界上本没有进阶篇,只能说是高级篇(高级篇不能说多高级,是对底层的封装的意思),只要是加深理解都是进阶. 本章先介绍一下channel. 正文 下面没 ...
- HC32L110(四) HC32L110的startup启动文件和ld连接脚本
目录 HC32L110(一) HC32L110芯片介绍和Win10下的烧录 HC32L110(二) HC32L110在Ubuntu下的烧录 HC32L110(三) HC32L110的GCC工具链和VS ...
- 手写tomcat——概述
1. 使用java 编写一个echo http服务器 使用java 编写一个echo http服务器 https://github.com/ZhongJinHacker/diy-tomcat/tree ...
- bean的作用域解析
说明 意义 1.在Spring中,Bean的作用域可以通过scope属性来指定. 2.指定作用域的目的是 存储在此类单例bean的高速缓存中,并且对该命名bean的所有后续请求和引用都返回该高速 ...