• 微课视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 程序设计
  • 信息安全
微课江湖
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 微课视频
  • bios
  • 系统安装
  • 系统进程
  • Windows
  • LINUX
  • RedHat/Centos
  • Ubuntu/Debian
  • Fedora
  • Solaris
  • 麒麟系统
  • 红旗Linux
  • 苹果MAC
  • 注册表
  • 其它系统
您的位置:首页 > 操作系统 >RedHat/Centos > CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题

CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题

作者:佚名 字体:[增加 减小] 来源:互联网 时间:2017-05-12

佚名 通过本文向大家介绍了glusterfs,glusterfs官网,glusterfs安装,glusterfs调优,glusterfs windows等相关知识,希望对您有所帮助,也希望大家多多支持微课江湖

  GlusterFS因有很好的扩展性,使用的用户很多,使用GlusterFS能够解决网络存储、冗余备份等问题,那么在Linux下要如何安装GlusterFS呢?今天小编以CentOS6.4为例,给大家介绍下CentOS6.4安装配置GlusterFS的方法。

CentOS 6.4如何安装及设置GlusterFS

  环境介绍:

  OS: CentOS 6.4 x86_64 Minimal

  Servers: sc2-log1,sc2-log2,sc2-log3,sc2-log4

  Client: sc2-ads15

  具体步骤:

  1. 在sc2-log{1-4}上安装GlusterFS软件包:

  代码如下

  # wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo

  # yum install -y glusterfs-3.4.2-1.el6 glusterfs-server-3.4.2-1.el6 glusterfs-fuse-3.4.2-1.el6

  # /etc/init.d/glusterd start

  # chkconfig glusterfsd on

  2. 在sc2-log1上配置整个GlusterFS集群:

  代码如下

  [root@sc2-log1 ~]# gluster peer probe sc2-log1

  1 peer probe: success: on localhost not needed

  [root@sc2-log1 ~]# gluster peer probe sc2-log2

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer probe sc2-log3

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer probe sc2-log4

  1 peer probe: success

  [root@sc2-log1 ~]# gluster peer status

  01 Number of Peers: 3

  02

  03 Hostname: sc2-log2

  04 Port: 24007

  05 Uuid: 399973af-bae9-4326-9cbd-b5b05e5d2927

  06 State: Peer in Cluster (Connected)

  07

  08 Hostname: sc2-log3

  09 Port: 24007

  10 Uuid: 833a7b8d-e3b3-4099-baf9-416ee7213337

  11 State: Peer in Cluster (Connected)

  12

  13 Hostname: sc2-log4

  14 Port: 24007

  15 Uuid: 54bf115a-0119-4021-af80-7a6bca137fd9

  16 State: Peer in Cluster (Connected)

  3. 在sc2-log{1-4}上创建数据存放目录:

  代码如下

  # mkdir -p /usr/local/share/{models,geoip,wurfl}

  # ls -l /usr/local/share/

  1 total 24

  2 drwxr-xr-x 2 root root 4096 Apr 1 12:19 geoip

  3 drwxr-xr-x 2 root root 4096 Apr 1 12:19 models

  4 drwxr-xr-x 2 root root 4096 Apr 1 12:19 wurfl 

  4. 在sc2-log1上创建GlusterFS磁盘:

  代码如下

  [root@sc2-log1 ~]# gluster volume create models replica 4 sc2-log1:/usr/local/share/models sc2-log2:/usr/local/share/models sc2-log3:/usr/local/share/models sc2-log4:/usr/local/share/models force

  1 volume create: models: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume create geoip replica 4 sc2-log1:/usr/local/share/geoip sc2-log2:/usr/local/share/geoip sc2-log3:/usr/local/share/geoip sc2-log4:/usr/local/share/geoip force

  1 volume create: geoip: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume create wurfl replica 4 sc2-log1:/usr/local/share/wurfl sc2-log2:/usr/local/share/wurfl sc2-log3:/usr/local/share/wurfl sc2-log4:/usr/local/share/wurfl force

  1 volume create: wurfl: success: please start the volume to access data

  [root@sc2-log1 ~]# gluster volume start models

  1 volume start: models: success

  [root@sc2-log1 ~]# gluster volume start geoip

  1 volume start: geoip: success

  [root@sc2-log1 ~]# gluster volume start wurfl

  1 volume start: wurfl: success

  [root@sc2-log1 ~]# gluster volume info

  01 Volume Name: models

  02 Type: Replicate

  03 Volume ID: b29b22bd-6d8c-45c0-b199-91fa5a76801f

  04 Status: Started

  05 Number of Bricks: 1 x 4 = 4

  06 Transport-type: tcp

  07 Bricks:

  08 Brick1: sc2-log1:/usr/local/share/models

  09 Brick2: sc2-log2:/usr/local/share/models

  10 Brick3: sc2-log3:/usr/local/share/models

  11 Brick4: sc2-log4:/usr/local/share/models

  12

  13 Volume Name: geoip

  14 Type: Replicate

  15 Volume ID: 69b0caa8-7c23-4712-beae-6f536b1cffa3

  16 Status: Started

  17 Number of Bricks: 1 x 4 = 4

  18 Transport-type: tcp

  19 Bricks:

  20 Brick1: sc2-log1:/usr/local/share/geoip

  21 Brick2: sc2-log2:/usr/local/share/geoip

  22 Brick3: sc2-log3:/usr/local/share/geoip

  23 Brick4: sc2-log4:/usr/local/share/geoip

  24

  25 Volume Name: wurfl

  26 Type: Replicate

  27 Volume ID: c723a99d-eeab-4865-819a-c0926cf7b88a

  28 Status: Started

  29 Number of Bricks: 1 x 4 = 4

  30 Transport-type: tcp

  31 Bricks:

  32 Brick1: sc2-log1:/usr/local/share/wurfl

  33 Brick2: sc2-log2:/usr/local/share/wurfl

  34 Brick3: sc2-log3:/usr/local/share/wurfl

  35 Brick4: sc2-log4:/usr/local/share/wurfl

  5. 在sc2-ads15上部署客户端并mount GlusterFS文件系统:

  [sc2-ads15][root@sc2-ads15 ~]# wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-epel.repo

  [sc2-ads15][root@sc2-ads15 ~]# yum install -y glusterfs-3.4.2-1.el6 glusterfs-fuse-3.4.2-1.el6

  [sc2-ads15][root@sc2-ads15 ~]# mkdir -p /mnt/{models,geoip,wurfl}

  [sc2-ads15][root@sc2-ads15 ~]# mount -t glusterfs -o ro sc2-log3:models /mnt/models/

  [sc2-ads15][root@sc2-ads15 ~]# mount -t glusterfs -o ro sc2-log3:geoip /mnt/geoip/

  [sc2-ads15][root@sc2-ads15 ~]# mount -t glusterfs -o ro sc2-log3:wurfl /mnt/wurfl/

  [sc2-ads15][root@sc2-ads15 ~]# df -h

  1 Filesystem Size Used Avail Use% Mounted on

  2 /dev/mapper/vg_t-lv_root

  3 59G 7.7G 48G 14% /

  4 tmpfs 3.9G 0 3.9G 0% /dev/shm

  5 /dev/xvda1 485M 33M 428M 8% /boot

  6 sc2-log3:models 98G 8.6G 85G 10% /mnt/models

  7 sc2-log3:geoip 98G 8.6G 85G 10% /mnt/geoip

  8 sc2-log3:wurfl 98G 8.6G 85G 10% /mnt/wurfl 

  6. 相关数据读写可用性测试:

  在sc2-ads15挂载点上写入数据:

  代码如下

  [sc2-ads15][root@sc2-ads15 ~]# umount /mnt/models

  [sc2-ads15][root@sc2-ads15 ~]# mount -t glusterfs sc2-log3:models /mnt/models/

  [sc2-ads15][root@sc2-ads15 ~]# echo “This is sc2-ads15” 》 /mnt/models/hello.txt

  [sc2-ads15][root@sc2-ads15 ~]# mkdir /mnt/testdir

  在sc2-log1数据目录中进行查看:

  [root@sc2-log1 ~]# ls /usr/local/share/models/

  1 hello.txt testdir

  结果: 数据写入成功

  在sc2-log1数据目录中直接写入数据:

  代码如下

  [root@sc2-log1 ~]# echo “This is sc2-log1” 》 /usr/local/share/models/hello.2.txt

  [root@sc2-log1 ~]# mkdir /usr/local/share/models/test2

  在sc2-ads15挂载点上进行查看:

  [sc2-ads15][root@sc2-ads15 ~]# ls /mnt/models

  [sc2-ads15][root@sc2-ads15 ~]# ls -l /mnt/models

  1 hello.txt testdir

  结果: 数据写入失败

  在sc2-log1挂载点上写入数据:

  代码如下

  [root@sc2-log1 ~]# mount -t glusterfs sc2-log1:models /mnt/models/

  [root@sc2-log1 ~]# echo “This is sc2-log1” 》 /mnt/models/hello.3.txt

  [root@sc2-log1 ~]# mkdir /mnt/model

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • CentOS 6.4如何安装及设置GlusterFS以解决网络存储的问题
  • CentOS无法挂载Glusterfs的解决方法

相关文章

  • 2017-05-12CentOS 6.6 正式发布提供下载
  • 2017-05-12pptp及l2tp安装教程篇一安装pptp方法
  • 2017-05-12在CentOS系统上简单安装配置XRDP服务器
  • 2017-05-12CentOS6.6禁用Ctrl+Alt+Del重启功能介绍
  • 2017-05-12CentOS 7.1 中文正式版怎么样?CentOS 7.1功能介绍及下载安装
  • 2017-05-12CentOS7 增加tomcat 启动、停止(使用systemctl进行配置)
  • 2017-05-12CentOS6.8下编译安装GCC详解
  • 2017-05-12Centos系统桌面版获取临时root权限方法图文教程
  • 2017-05-12yum错误:Cannot retrieve repository metadata (repomd.xml) for repository解决方法
  • 2017-05-12CentOS下Pureftp的配置文件常用配置项整理

文章分类

  • bios
  • 系统安装
  • 系统进程
  • Windows
  • LINUX
  • RedHat/Centos
  • Ubuntu/Debian
  • Fedora
  • Solaris
  • 麒麟系统
  • 红旗Linux
  • 苹果MAC
  • 注册表
  • 其它系统

最近更新的内容

    • centos系统密码忘了怎么破解密码?
    • centos系统中VPS忘记密码该如何解决?
    • CentOS基础网络配置路由和默认网关介绍
    • CentOS如何更换网卡设置?CentOS更换网卡设置的方法
    • Red Hat Enterprise Linux 4+Nginx 0.7.47+PHP5.2+MYSQL5.0+Memcache+eAccelerator收
    • CentOS系统中rpm包管理器的使用技巧
    • Centos 7上面安装Powershell的方法
    • CentOS下CronTab任务周期计划详解
    • linux RPM包安装、更新、删除等操作命令简明总结
    • CentOS小心被suid shell与inetd后门利用的详细讲解

关于我们 - 联系我们 - 免责声明 - 网站地图 - 投诉建议

©CopyRight 2015-2017 www.weikejianghu.com Inc All Rights Reserved. 微课江湖 版权所有