Installing GlusterFS - a Quick Start Guide

Purpose of this document

This document is intended to give you a step by step guide to setting up GlusterFS for the first time. For this tutorial, we will assume you are using Fedora 21 (or later) virtual machines (other distributions and methods can be found in the new user guide, below. We also do not explain the steps in detail here, this guide is just to help you get it up and running as soon as possible. After you deploy GlusterFS by following these steps, we recommend that you read the GlusterFS Admin Guide to learn how to administer GlusterFS and how to select a volume type that fits your needs. Read the GlusterFS New User Guide for a more detailed explanation of the steps we took here. We want you to be successful in as short a time as possible.

If you would like a more detailed walk through with instructions for installing using different methods (in local virtual machines, EC2 and baremetal) and different distributions, then have a look at the Install guide.

Automatically deploying GlusterFS with Puppet-Gluster+Vagrant

If you'd like to deploy GlusterFS automatically using Puppet-Gluster+Vagrant, have a look at this article.

Step 1 – Have at least two nodes

  • Fedora 20 on two nodes named "server1" and "server2"
  • A working network connection
  • At least two virtual disks, one for the OS installation, and one to be used to serve GlusterFS storage (sdb). This will emulate a real world deployment, where you would want to separate GlusterFS storage from the OS install.
  • Note: GlusterFS stores its dynamically generated configuration files at /var/lib/glusterd. If at any point in time GlusterFS is unable to write to these files (for example, when the backing filesystem is full), it will at minimum cause erratic behavior for your system; or worse, take your system offline completely. It is advisable to create separate partitions for directories such as /var/log to ensure this does not happen.

Step 2 - Format and mount the bricks

(on both nodes): Note: These examples are going to assume the brick is going to reside on /dev/sdb1.

  1. mkfs.xfs -i size=512 /dev/sdb1
  2. mkdir -/data/brick1
  3. echo '/dev/sdb1 /data/brick1 xfs defaults 1 2' >> /etc/fstab
  4. mount -&& mount

You should now see sdb1 mounted at /data/brick1

Step 3 - Installing GlusterFS

(on both servers) Install the software

  1. yum install glusterfs-server

Start the GlusterFS management daemon:

  1. service glusterd start
  2. service glusterd status
  3. glusterd.service - LSB: glusterfs server
  4.        Loaded: loaded (/etc/rc.d/init.d/glusterd)
  5.    Active: active (running) since Mon, 13 Aug 2012 13:02:11 -0700; 2s ago
  6.   Process: 19254 ExecStart=/etc/rc.d/init.d/glusterd start (code=exited, status=0/SUCCESS)
  7.    CGroup: name=systemd:/system/glusterd.service
  8.         19260 /usr/sbin/glusterd -/run/glusterd.pid
  9.         19304 /usr/sbin/glusterfsd --xlator-option georep-server.listen-port=24009 -s localhost...
  10.         19309 /usr/sbin/glusterfs -/var/lib/glusterd/nfs/nfs-server.vol -/var/lib/glusterd/...

Step 4 - Configure the trusted pool

From "server1"

  1. gluster peer probe server2

Note: When using hostnames, the first server needs to be probed from one other server to set its hostname.

From "server2"

  1. gluster peer probe server1

Note: Once this pool has been established, only trusted members may probe new servers into the pool. A new server cannot probe the pool, it must be probed from the pool.

Step 5 - Set up a GlusterFS volume

On both server1 and server2:

  1. mkdir /data/brick1/gv0

From any single server:

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

Confirm that the volume shows "Started":

  1. gluster volume info

Note: If the volume is not started, clues as to what went wrong will be in log files under /var/log/glusterfs on one or both of the servers - usually in etc-glusterfs-glusterd.vol.log

Step 6 - Testing the GlusterFS volume

For this step, we will use one of the servers to mount the volume. Typically, you would do this from an external machine, known as a "client". Since using this method would require additional packages to be installed on the client machine, we will use one of the servers as a simple place to test first, as if it were that "client".

  1. mount -t glusterfs server1:/gv0 /mnt
  2.   for i in `seq -w 1 100`; do cp -rp /var/log/messages /mnt/copy-test-$i; done

First, check the mount point:

  1. ls -lA /mnt | wc -l

You should see 100 files returned. Next, check the GlusterFS mount points on each server:

  1. ls -lA /data/brick1/gv0

You should see 100 files on each server using the method we listed here. Without replication, in a distribute only volume (not detailed here), you should see about 50 files on each one.

Terminologies you should be familiar with.

guslterFS的更多相关文章

随机推荐

  1. shell 流程控制

    for循环: #!/bin/bash for file in $(ls /ect) do echo $file done

  2. JavaScript中的Function类型浅析

    1. Function类型是js中引用类型之一,每个函数实际上都是Function类型的实例对象,具有自己的属性和方法.正因为函数式对象,所以函数名实际上也是一个指向函数对象的指针. 2. 常用的函数 ...

  3. Hadoop集群(第5期)_Hadoop安装配置

    1.1 Hadoop简介 Hadoop是Apache软件基金会旗下的一个开源分布式计算平台.以Hadoop分布式文件系统(HDFS,Hadoop Distributed Filesystem)和Map ...

  4. loadrunner 一个诡异问题

    最近使用loadrunner压测一个项目的时候,发现TPS波动巨大.且平均值较低.使用jmeter压测则没有这个问题.经过多方排查发现一个让人极度费解的原因: 原脚本: //脚本其他代码...... ...

  5. cat命令常用的13个技巧

    在Linux系统中,大多数配置文件.日志文件,甚至shell脚本都使用文本文件格式,因此,Linux系统存在着多种文本编辑器,但当你仅仅想要查看一下这些文件的内容时,可使用一个简单的命令-cat. c ...

  6. 捉虫记:SHGetSpecialFolderPath返回错误码为2

    通常我们想获得系统的一些路径时,都会使用一些Shell函数.比如SHGetSpecialFolderPath,SHGetFolderPath,SHGetKnownFolderPath等,传入我们想要的 ...

  7. 《深入理解linux内核》第三章 进程

    进程的七种状态 在内核源码的 include/linux/sched.h文件中: task_struct的status可表示 #define TASK_RUNNING 0 #define TASK_I ...

  8. ORACLE RAC NTP 时间服务器配置

    Linux 时间同步配置 . 一. 使用ntpdate 命令 1.1 服务器可链接外网时 # crontab -e 加入一行: */1 * * * * ntpdate 210.72.145.44 21 ...

  9. 关于Sublime Text2 GBK编码的问题

    很多文章都说需要"ConvertToUTF8"和"GBK Encoding Support"连个插件. 其实GBK Encoding Support完全不需要, ...

  10. (转载)CentOS: 开放80、22、3306端口操作

    (转载)http://blog.sina.com.cn/s/blog_3eba8f1c0100tsox.html #/sbin/iptables -I INPUT -p tcp --dport 80 ...