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.

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

You should now see sdb1 mounted at /data/brick1

Step 3 - Installing GlusterFS

(on both servers) Install the software

    yum install glusterfs-server

Start the GlusterFS management daemon:

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

Step 4 - Configure the trusted pool

From "server1"

    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"

    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:

    mkdir /data/brick1/gv0

From any single server:

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

Confirm that the volume shows "Started":

    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".

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

First, check the mount point:

    ls -lA /mnt | wc -l

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

    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. 2.MVC框架开发(视图开发----基础语法)

    1.区别普通的html,在普通的html中不能将控制器里面的数据展示在html中. 在MVC框架中,它提供了一种视图模板(就是结合普通的html标签并能将控制器里传出来的数据进行显示) 视图模板特性: ...

  2. Spring核心框架 - AOP之动态代理机制

    动态代理类的字节码在程序运行时由Java反射机制动态生成,无需程序员手工编写它的源代码.动态代理类不仅简化了编程工作,而且提高了软件系统的可扩展性,因为Java 反射机制可以生成任意类型的动态代理类. ...

  3. UI表单

    Monk.UI表单美化插件诞生记!   阅读目录 背景 预览效果 表单组件 普通文本框 多行文本框 复选框 切换滑块 单选框 下拉选择框 数字输入框 时间选择 文件选择 显示文本 按钮 开源地址 背景 ...

  4. no identities are available for signing

    原地址:http://www.cnblogs.com/imzzk/p/3501868.html 今天将做好的app提交到app store,结果就出现标题上的错误.“No identities are ...

  5. loadrunner_analysis技巧_average 和 90% percent

    “90% Percent Time” 表示90%的事务response time 都维持在某个值附近,不是 average response time * 90%;  “Average Time” 平 ...

  6. 汇编语言第二版 程序在dos中执行情况.P86-87

    假设程序要被dos系统加载到sa:0000的内存中,在这个地址的内存开始会有256个字节的PSP程序,用于加载程序和dos系统的通信.ds中的地址为sa. 真正的程序会在这256个字节之后.所以真正程 ...

  7. 使用Sqoop从mysql向hdfs或者hive导入数据时出现的一些错误

    1.原表没有设置主键,出现错误提示: ERROR tool.ImportTool: Error during import: No primary key could be found for tab ...

  8. HTML颜色编码

    Web安全色 #000000 #000033 #000066 #000099 #0000CC #0000FF #003300 #003333 #003366 #003399 #0033CC #0033 ...

  9. hdu4662MU Puzzle

    http://acm.hdu.edu.cn/showproblem.php?pid=4662 I+3*U模6为2或4的都可以 一个U相当于3个I  而I只能1->2->4->8..如 ...

  10. 利用if,else判断输入的是不是一个正整数

    static void Main(string[] args)        {            while (true)                      { Console.Writ ...