zoukankan      html  css  js  c++  java
  • CentOS7安装GlusterFS

    GlusterFS简介

    参考:https://blog.51cto.com/13447608/2386830?source=dra

    GlusterFS安装

    如下所示三台机器,hostname分别是node-1/node-2/node-3,在/etc/hosts添加3台机器的主机名解析,关闭selinux、防火墙、NetworkManager等。

    node-1 10.0.0.1
    node-2 10.0.0.2
    node-3 10.0.0.3

    安装glusterfs(三台都要执行)

    #安装glusterfs
    yum install centos-release-gluster
    yum install -y glusterfs glusterfs-server glusterfs-fuse glusterfs-rdma
    
    #启动gluster服务
    systemctl start glusterd.service
    systemctl enable glusterd.service

    在node-1上执行,将node-2、node-3加入集群

    gluster peer probe node-2
    gluster peer probe node-3

    在node-1上看集群状态

    [root@node-1 db]# gluster peer status
    Number of Peers: 2
    
    Hostname: node-2
    Uuid: d8d232f-e5fb-4752-b40d-b0103afrf8ea
    State: Peer in Cluster (Connected)
    
    Hostname: node-3
    Uuid: ff3gg732-ae12-4b6c-4rfb-65fd7886588c
    State: Peer in Cluster (Connected)

    在node-1上执行,创建3副本的复制卷。glusterfs使用现有Linux文件系统创建glusterfs文件系统。

    #创建卷
    [root@node-1 ~]# gluster volume create app-data replica 3 transport tcp node-1:/gfs-data/ node-2:/gfs-data/ node-3:/gfs-data/ force volume create: app-data: success: please start the volume to access data
    # 列出卷
    [root@k8sm0 ~]# gluster volume list
    app-data

    # 查看卷信息
    [root@node-1 ~]# gluster volume info
    Volume Name: app-data
    Type: Replicate
    Volume ID: rr2068b2-0da6-431f-8f93-3d7b2f331gde
    Status: Created
    Snapshot Count: 0
    Number of Bricks: 1 x 3 = 3
    Transport-type: tcp
    Bricks:
    Brick1: node-1:/gfs-data
    Brick2: node-2:/gfs-data
    Brick3: node-3:/gfs-data
    Options Reconfigured:
    transport.address-family: inet
    nfs.disable: on
    performance.client-io-threads: off

    # 启动卷
    [root@node-1 ~]# gluster volume start app-data
    volume start: app-data: success
    [root@node-1 ~]# gluster volume quota app-data enable
    volume quota : success
    [root@node-1 ~]# gluster volume quota app-data limit-usage / 10GB
    volume quota : success

    # 查看卷状态
    [root@node-1 app]# gluster volume status
    Status of volume: app-data
    Gluster process TCP Port RDMA Port Online Pid
    ------------------------------------------------------------------------------
    Brick node-1:/gfs-data 49152 0 Y 6283
    Brick node-2:/gfs-data 49152 0 Y 6216
    Brick node-3:/gfs-data 49152 0 Y 6232

    #挂载
    [root@node-1 ~]# mkdir /gfs-share && mount -t glusterfs localhost:k8s-data /gfs-share
    [root@node-1 ~]# echo "localhost:app-data  /gfs-share/         glusterfs defaults        0 0" >> /etc/fstab
  • 相关阅读:
    面向对象编程
    多任务-线程
    浅析IoC框架
    Android:关于声明文件中android:process属性说明
    Android闹钟设置的解决方案
    【转】RelativeLayout和LinearLayout及FrameLayout性能分析
    SurfaceView浅析
    SQLite Vacuum
    SQLiteStatement优化SQLite操作
    基于Android SQLite的升级详解
  • 原文地址:https://www.cnblogs.com/lingfenglian/p/11731849.html
Copyright © 2011-2022 走看看