Glusterfs初试

 Gluster的模式及介绍在此不表,这里只记录安装及配置过程。

 

1.整体环境

server1 : gfs1.cluster.com 

server2 : gfs2.cluster.com 

 Client: 

2.安装Gluster

  • 下载软件

https://access.redhat.com/downloads/content/186/ver=3/rhel---7/3.4/x86_64/product-software

下载 Red Hat Gluster Storage Server 3.4 on RHEL 7 Installation DVD

 

安装RHEL 7.6的最小软件安装,将iso文件mount成cdrom, 然后修改yum源

mkdir -p /repo/base
mount /dev/cdrom /repo/base
vi /etc/yum.repos.d/base.repo

 

[rhel7.6]
name=rhel7.6
baseurl=file:///repo/base/
enabled=1
gpgcheck=0

 

  • 安装
yum install -y redhat-storage-server
systemctl start glusterd
systemctl enable glusterd

systemctl status glusterd验证一下

[root@gfs1 mnt]# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system serverLoaded: loaded (/usr/lib/systemd/system/glusterd.service; enabled; vendor preset: disabled)Active: active (running) since Fri 2019-02-08 16:06:17 CST; 6min agoProcess: 3145 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)Main PID: 3166 (glusterd)Tasks: 36CGroup: /system.slice/glusterd.service├─3166 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO├─3640 /usr/sbin/glusterfs -s localhost --volfile-id gluster/glustershd -p /var/run/gluster/glustershd/glustershd.pid -l /var/lo...└─3899 /usr/sbin/glusterfsd -s gfs1.cluster.com --volfile-id gv0.gfs1.cluster.com.data-gluster-gv0 -p /var/run/gluster/vols/gv0/...Feb 08 16:06:06 gfs1.cluster.com systemd[1]: Starting GlusterFS, a clustered file-system server...
Feb 08 16:06:17 gfs1.cluster.com systemd[1]: Started GlusterFS, a clustered file-system server.

 

  • 配置防火墙

简单起见直接关闭了,以后补充开放具体网段

systemctl stop firewalld
systemctl disable firewalld

 

  • 修改主机名以及/etc/hosts

每台机器执行,并修改/etc/hosts

hostnamectl set-hostname gfs1.cluster.com

 

  • 添加存储

在每台glusterfs的server上加入一块存储盘,并进行初始化

fdisk /dev/sdb

 

 

mkfs.ext4 /dev/sdb1

 

在每个节点上运行以下命令挂载

mkdir -p /data/gluster
mount /dev/sdb1 /data/gluster
echo "/dev/sdb1 /data/gluster ext4 defaults 0 0" | tee --append /etc/fstab

 

3.配置Glusterfs

在节点1上运行

gluster peer probe gfs2.cluster.com

验证

[root@gfs1 mnt]# gluster peer status
Number of Peers: 1Hostname: gfs2.cluster.com
Uuid: 818cc628-85a7-4f5e-bd4e-34932c05de97
State: Peer in Cluster (Connected)[root@gfs1 mnt]# gluster pool list
UUID                    Hostname            State
818cc628-85a7-4f5e-bd4e-34932c05de97    gfs2.cluster.com    Connected 
dbcc01fc-3d2c-466f-9283-57c46a9974be    localhost           Connected 

volume和brick的概念

 

 

 

 

3.1 复制卷

 

创建GFS卷gv0并配置复制模式

 

mkdir -p /data/gluster/gv0(在gfs1和gfs2上都建立brick)
gluster volume create gv0 replica 2 gfs1.cluster.local:/data/gluster/gv0 gfs2.cluster.local:/data/gluster/gv0

 

启动gv0卷

gluster volume start gv0
gluster volume info gv0
[root@gfs1 mnt]# gluster volume info gv0Volume Name: gv0
Type: Replicate
Volume ID: 26d05ac6-0415-4041-ada4-5a423793fa20
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: gfs1.cluster.com:/data/gluster/gv0
Brick2: gfs2.cluster.com:/data/gluster/gv0
Options Reconfigured:
performance.client-io-threads: off
nfs.disable: on
transport.address-family: inet

 

3.2 分布式卷(Distributed volume)

 

mkdir -p /data/gluster/brickgluster volume create gv1 gfs1.cluster.com:/data/gluster/brick gfs2.cluster.com:/data/gluster/brickgluster volume start gv1

 

[root@gfs1 mnt]# mkdir -p /data/gluster/brick
[root@gfs1 mnt]# gluster volume create gv1 gfs1.cluster.com:/data/gluster/brick gfs2.cluster.com:/data/gluster/brick
volume create: gv1: success: please start the volume to access data
[root@gfs1 mnt]# gluster volume start gv1
volume start: gv1: success
[root@gfs1 mnt]# gluster volume info gv1Volume Name: gv1
Type: Distribute
Volume ID: 4782dd87-a411-44b3-8621-70dfb072b5d0
Status: Started
Snapshot Count: 0
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: gfs1.cluster.com:/data/gluster/brick
Brick2: gfs2.cluster.com:/data/gluster/brick
Options Reconfigured:
transport.address-family: inet
nfs.disable: on

 

3.3 条带化卷(Stripe Volume)

 

mkdir -p /data/gluster/stripebrickgluster volume create gv3 stripe 2 transport tcp gfs1.cluster.com:/data/gluster/stripebrick  gfs2.cluster.com:/data/gluster/stripebrickgluster volume start gv3

 

[root@gfs1 mnt]# mkdir -p /data/gluster/stripebrick
[root@gfs1 mnt]# gluster volume create gv3 stripe 2 transport tcp gfs1.cluster.com:/data/gluster/stripebrick  gfs2.cluster.com:/data/gluster/stripebrick
volume create: gv3: success: please start the volume to access data
[root@gfs1 mnt]# gluster volume start gv3
volume start: gv3: success
[root@gfs1 mnt]# gluster volume info gv3Volume Name: gv3
Type: Stripe
Volume ID: c25a10b8-a943-4c40-93be-088b972cbbaa
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: gfs1.cluster.com:/data/gluster/stripebrick
Brick2: gfs2.cluster.com:/data/gluster/stripebrick
Options Reconfigured:
transport.address-family: inet
nfs.disable: on

 

3.4 分布式复制卷

 

 

更详细拓扑结构和管理说明参考官方文档,值得你阅读

https://access.redhat.com/documentation/en-us/red_hat_gluster_storage/3/html/administration_guide/

 

4.客户端配置

支持的客户端协议

 

yum install -y glusterfs-client
mkdir -p /mnt/glusterfs
mount -t glusterfs gfs1.cluster.com:/gv0 /mnt/glusterfs

验证挂载

[root@master ~]# df -hP /mnt/glusterfs
Filesystem             Size  Used Avail Use% Mounted on
gfs1.cluster.com:/gv0  9.8G  136M  9.2G   2% /mnt/glusterfs

在node1和node2上也mount上glusterfs gv0,便于查看里面内容

[root@gfs1 ~]# mount -t glusterfs gfs2.cluster.com:/gv0 /mnt
[root@gfs2 ~]# mount -t glusterfs gfs1.cluster.com:/gv0 /mnt

然后基于客户端进行文件创建删除,同时将node1进行停机的高可用测试。

 

转载于:https://www.cnblogs.com/ericnie/p/10356319.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/264843.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何查看光驱硬盘托架的尺寸_如何确定光驱位的硬盘托架的大小尺寸和接口

如果你想在电脑光驱位安装固态硬盘,前提必须要确定光驱位硬盘托架的类型,如大小尺寸和接口参数。下面将介绍大家如何确定相关参数,其适合于联想,华硕,惠普等电脑品牌。1,最合理的确定方法是到Windows 设备管…

[Android Pro] ant 编译android工程

参考文章: http://blog.csdn.net/xyz_lmn/article/details/7268582?reload http://hubingforever.blog.163.com/blog/static/1710405792013220840347/ http://www.cnblogs.com/tankaixiong/archive/2010/11/24/1887156.html 一,准备ant ant 官网可下载h…

堆栈认知——堆简介

参考:Linux笔记–堆简介 地址:https://qingmu.blog.csdn.net/article/details/119510863 目录1、前言2、堆的由来3、Linux中堆简介4、堆分类4.1、请求堆4.2、释放堆5、内存分配背后的系统调用6、堆相关数据结构7、堆的申请8、调试验证1、前言 当前针对各…

(0.2.6)Mysql安装——编译安装

参考我的另一篇文章:https://www.cnblogs.com/gered/p/9539333.html转载于:https://www.cnblogs.com/gered/p/10359289.html

ubuntu查看gpu使用率_如何监控GPU卡的使用率(Linux)

Linux系统,在程序运行的时候,如何实时监控GPU卡的使用率呢?首先,你需要安装好CUDA。然后,你需要将CUDA的bin目录加入到PATH中。方法是在终端窗口输入如下命令:# vi ~/.bashrc将 /usr/local/cuda/bin 加入到…

sqlserver2000 mdf 文件导入

在Enterprise Manager中菜单\工具\sql analyze 把数据库的数据文件(*.mdf)和日志文件(*.ldf)都拷贝到目的服务器,在SQL sp_attach_db dbname test, filename1 d:\mssql7\data\test_data.mdf, …

如何为 Horizon View 配置 VMware VSAN?

原文:http://myvirtualcloud.net/?p5440注明:本文内容基于 VMwareVSAN beta 版本撰写,请访问http://www.vmware.com/products/virtual-san/获得有关正式版本的更新信息。我已经在前面的文章中讨论了VSAN 给 Horizon View 带来的益处&#xf…

配置vscode远程免密登入Linux服务器

视频教程:https://www.bilibili.com/video/BV1s64y167cM?vd_sourcecc0e43b449de7e8663ca1f89dd5fea7d 参考:配置vscode远程免密登入Linux服务器 地址:https://blog.csdn.net/weixin_54178481/article/details/123977675?spm1001.2014.3001.…

P1552 [APIO2012]派遣

链接 https://www.luogu.org/problemnew/show/P1552 思路 忍者数量肯定越多越好 那就从下到上的合并它的孩子 左偏树的话 顺便维护一个tot,大头堆,如果tot大于了m,把大的删掉 如果左偏树忘干净了或者没学的话 线段树合并也是个不错的选择 直接…

Wss 3.0安装指南(一)

Wss 3.0安装指南(一) "基本" 模式 WSS3.0的安装可分为独立服务器安装和服务器场安装,前者是将所有的服务和应用安装在一台Server 上,后者则是…

java web 程序---javabean实例--登陆界面并显示用户名和密码

重点:注意大小写,不注意细节,这点小事,还需要请教 发现一个问题,也是老师当时写的时候,发现代码没错,但是就是运行问题。 大家看,那个java类,我们要求是所有属性均为私有…

智能五子棋基本思路

前些天闲时写的,在学数据结构的时拿来练手的.没技术含量,最有技术含量的AI部分,我是看别人(园子里叫二十四生的)的算法改的.刚弄了一下午小程序弄不过去,头疼,现无聊的紧,闲着发着玩.当消遣主要发下AI核心算法.有兴趣的同学用VB,VC.VC#都可以一起做着玩.保持对编程的兴趣.其它没…

webpack 4.0 配置文件 webpack.config.js文件的放置位置

一般webpack.config.js是默认放在根目录的,不在根目录的时候需要在package.json中制定位置,我的配置文件目录是config/webpack.config.js,在package.json文件中的配置为: "scripts": { "build": "webpack --mode p…

Python-memcached的基本使用 - Flynewton成长点滴 - 开源中国社区

Python-memcached的基本使用 - Flynewton成长点滴 - 开源中国社区Python-memcached的基本使用 发表于3年前(2010-12-04 00:02) 阅读(9601) | 评论(3) 12人收藏此文章, 我要收藏 赞1 python memcached 想学Python,又想…

快速构建ceph可视化监控系统

https://my.oschina.net/colben/blog/1844602 https://my.oschina.net/u/3626804/blog/1859613转载于:https://www.cnblogs.com/diyunpeng/p/10363183.html

阳奉阴违(转载)

这个词不是好词,大家都这么看,但现在生活里却经常要照它做,表面上应付一下,表示一下,然后再怎么做就随便;如果你不表示这一下,那就怎么也不行。 MSN和Yahoo就已经理解了这个问题,并且…

PowerShell远程管理Windows Server(2):公网访问【web形式】

*此文章只适合于windows server 2012版本以上;Powershell Web Access需要两个步骤才能使用:一、安装powershell web access功能;二、配置powershell web access;只要在服务器上启用powershell web access功能,即可通过…

POJ 3090 Visible Lattice Points 【欧拉函数】

<题目链接> 题目大意&#xff1a; 给出范围为(0, 0)到(n, n)的整点&#xff0c;你站在(0,0)处&#xff0c;问能够看见几个点。 解题分析&#xff1a;很明显&#xff0c;因为 N (1 ≤ N ≤ 1000) &#xff0c;所以无论 N 为多大&#xff0c;(0,1),(1,1),(1,0)这三个点一定…

2005的行列转换

2005的行列转换: create table ta(编号 int,人员 varchar(5), 年份 int,月份 int ,[1号] varchar(5), [2号] varchar(5),[3号] varchar(5),[4号] varchar(5))insert ta select 1, 张三,2006, 1, 正常, 迟到, 迟到, 事假union all select 2, 张三, 2006, 2, 迟到, 事假, 正常, 正…

精选 5 个漂亮的 CSS3 图片滑过特效

这篇文章将为大家分享5款漂亮的CSS3图片滑过特效&#xff0c;比如滑过后显示图片的详细文字介绍&#xff0c;又比如滑过后对图片进行淡入淡出的效果等等。让我们一起来看看&#xff0c;喜欢的朋友赶紧收藏。 1、非常酷的CSS3图片说明效果 在线演示 / 源码下载 2、纯CSS3图片相…