Giter VIP home page Giter VIP logo

puppet-glusterfs's Introduction

puppet-glusterfs

Overview

Install, enable and configure GlusterFS.

  • glusterfs::server : Class to install and enable the server.
  • glusterfs::peer : Definition to add a server peer. Used by the server class' $peer parameter.
  • glusterfs::volume : Definition to create server volumes.
  • glusterfs::client : Class to install and enable the client. Included from the mount definition.
  • glusterfs::mount : Definition to create client mounts.

You will need to open TCP ports 24007:24009 and 38465:38466 on the servers.

Examples

Complete server with two redundant nodes, on top of existing kickstart created vg0 LVM VGs. Note that the first runs will fail since the volume creation won't work until the peers know each other, and that requires the service to be running :

file { [ '/export', '/export/gv0' ]:
  seltype => 'usr_t',
  ensure  => directory,
}
package { 'xfsprogs': ensure => installed }
exec { 'lvcreate /dev/vg0/gv0':
  command => '/sbin/lvcreate -L 256G -n gv0 vg0',
  creates => '/dev/vg0/gv0',
  notify  => Exec['mkfs /dev/vg0/gv0'],
}
exec { 'mkfs /dev/vg0/gv0':
  command     => '/sbin/mkfs.xfs -i size=512 /dev/vg0/gv0',
  require     => [ Package['xfsprogs'], Exec['lvcreate /dev/vg0/gv0'] ],
  refreshonly => true,
}
mount { '/export/gv0':
  device  => '/dev/vg0/gv0',
  fstype  => 'xfs',
  options => 'defaults',
  ensure  => mounted,
  require => [ Exec['mkfs /dev/vg0/gv0'], File['/export/gv0'] ],
}
class { 'glusterfs::server':
  peers => $::hostname ? {
    'server1' => '192.168.0.2',
    'server2' => '192.168.0.1',
  },
}
glusterfs::volume { 'gv0':
  create_options => 'replica 2 192.168.0.1:/export/gv0 192.168.0.2:/export/gv0',
  require        => Mount['/export/gv0'],
}

Client mount (the client class is included automatically). Note that clients are virtual machines on the servers above, so make each of them use the replica on the same hardware for optimal performance and optimal fail-over :

file { '/var/www': ensure => directory }
glusterfs::mount { '/var/www':
  device => $::hostname ? {
    'client1' => '192.168.0.1:/gv0',
    'client2' => '192.168.0.2:/gv0',
  }
}

puppet-glusterfs's People

Contributors

glennaaldering avatar roidelapluie avatar thias avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-glusterfs's Issues

Debian/Ubuntu Compatibility

The packages and service mentioned in the code are for Redhat/CentOS. This are the following to make it work on Debian/Ubuntu.

glusted -> glusterfs-server in peer.pp and server.pp
glusterfs-fuse -> glusterfs-client in client.pp

After this it works perfect.

Puppet agent fails with 'volume start: gv0: failed: Volume gv0 already started'

Once the glusterfs volume is created and started, each run of puppet agent after that fails with:

Notice: /Stage[main]/mymodule/Glusterfs::Volume[gv0]/Exec[/usr/sbin/gluster volume start gv0]/returns: volume start: gv0: failed: Volume gv0 already started

Error: /usr/sbin/gluster volume start gv0 returned 1 instead of one of [0]
Error: /Stage[main]/mymodule/Glusterfs::Volume[gv0]/Exec[/usr/sbin/gluster volume start gv0]/returns: change from notrun to 0 failed: /usr/sbin/gluster volume start gv0 returned 1 instead of one of [0]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.