zoukankan      html  css  js  c++  java
  • glusterfs安装和初始化

    系统环境:centos 6 x86_64  

    集群环境:server1 server2

    1,添加glusterfs源到centos

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

    安装glusterfs-server

    yum install glusterfs-server

    这时,如果提示缺少pyxattr和liburcu两个包,可以这样下载和安装

    wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/visionsoftware/CentOS_CentOS-6/x86_64/pyxattr-0.5.0-4.2.x86_64.rpm
    rpm -ivh
    pyxattr-0.5.0-4.2.x86_64.rpm
    
    
    wget ftp://ftp.muug.mb.ca/mirror/fedora/epel/6/x86_64/userspace-rcu-0.7.7-1.el6.x86_64.rpm
    rpm -ivh userspace-rcu-0.7.7-1.el6.x86_64.rpm

    2,启动glusterfs服务

    service glusterd start

    查看glusterfs服务运行状态

     service glusterd status

    3,在server1中执行

    gluster peer probe server2

    在server2中执行

    gluster peer probe server1

    当这两个节点之间建立互信生成一个pool之后,再添加其它节点,只能从这两个节点执行

    gluster peer probe hostname

    来添加新的节点,不能从新节点或其它pool中,添加当前pool中的节点。

    4,在server1和server2中分别执行

    mkdir /data/brick1/gv0

    5,在server1或server2任一一台机器上执行

    gluster volume create gv0 replica 2 server1:/data/brick1/gv0 server2:/data/brick1/gv0
    
    gluster volume start gv0

    6,测试glusterfs安装结果

    mount -t glusterfs server1:/gv0 /mnt
    
    for i in `seq -w 1 100`; do cp -rp /var/log/messages /mnt/copy-test-$i; done
    
    ls -lA /mnt | wc -l
    
    ls -lA /data/brick1/gv0

    随笔内容主要摘抄自glusterfs官方文档

  • 相关阅读:
    ASP.NET学习笔记(1)
    vs2005新建项目中没有ASP.NET WEB应用程序
    IE无法安装Activex控件
    【Android】SDK工具学习
    【英语】Bingo口语笔记(22)
    【Python】实践笔记
    【学习】纪录片笔记
    【英语】Bingo口语笔记(20)
    【英文】20141027 生词
    【英文】Bingo口语笔记(18)
  • 原文地址:https://www.cnblogs.com/unsea/p/4694973.html
Copyright © 2011-2022 走看看