zoukankan      html  css  js  c++  java
  • GFS 安装使用

    准备环境:

      1、OS:

        Centos:7.2x86_64

      2、主机

       server1: 192.168.30.41 wohaoshuai1
       server2: 192.168.30.42 wohaoshuai2
       server3: 192.168.30.43 wohaoshuai3

       client1:   192.168.30.43 wohaoshuai3

    一、修改每台主机的host文件,在/etc/hosts下添加内容:

        192.168.30.41 wohaoshuai1
        192.168.30.42 wohaoshuai2
        192.168.30.43 wohaoshuai3

    二、在wohaoshuai1、wohaoshuai2、wohaoshuai3分别安装gfs server端(用yum安装即可)

      1、安装

        yum install centos-release-gluster -y

        yum install -y glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma

      2、启动gfsserver端并设置开机启动    

        systemctl start glusterd.service

        systemctl enable glusterd.service

      3、添加wohaoshuai1,2,3到gfs集群(若为测试环境要关闭防火墙,否则会添加失败,若需要开启防火墙的情况下开放端口即可,默认端口为24007,在wohaoshuai1本机上不用添加)

        

        添加后查看集群状态:

        

    三、创建数据目录

      1、在wohaoshuai1,2,3上都要创建 目录为 /application/gluster/data

        mkdir -p /application/gluster/data

      2、创建卷(因为用的root用户,所以后面需要加上force参数,Replica 3 表示的是3个备份,后面的是指定的存储的目录)

        gluster volume create wohaoshuai-gluster replica 3 transport tcp wohaoshuai1:/application/gluster/data wohaoshuai2:/application/gluster/data wohaoshuai3:/application/gluster/data force

        

      3、查看卷信息

        gluster volume info

        

      4、启动创建的卷wohaoshuai-gluster

        gluster volume start wohaoshuai-gluster

        

        

    四、客户端挂载使用

      1、wohaoshuai3安装client端

        yum install -y glusterfs glusterfs-fuse

      2、创建挂载路径

        mkdir -p /application/gfsmount/

        mount -t glusterfs wohaoshuai1:wohaoshuai-gluster /application/gfsmount/

        查看挂载情况:

        

      3、此时就可对挂载的gfs盘进行读写。

    五、关于gfs命令总结:

      Gluster peer status 查看所有的节点信息

      Gluster peer probe name添加节点

      Gluster peer detachname 删除节点

      /etc/init.d/glusterstart 启动gluster

      /etc/init.d/glusterstop 停止gluster

      /etc/init.d/glusterrestart 重启gluster

      创建卷

        Gluster volume createxxx

        Gluster volume info 查看卷信息
        Gluster volume status 查看卷状态

      

  • 相关阅读:
    my first android test
    VVVVVVVVVV
    my first android test
    my first android test
    my first android test
    ini文件
    ZZZZ
    Standard Exception Classes in Python 1.5
    Python Module of the Week Python Module of the Week
    my first android test
  • 原文地址:https://www.cnblogs.com/Presley-lpc/p/9936472.html
Copyright © 2011-2022 走看看