voxpupuli / puppet-gluster

Create and manage Gluster pools, volumes, and mounts
https://forge.puppet.com/puppet/gluster
MIT License
16 stars 74 forks source link

GlusterFS peers are not defined as prerequisite for a GlusterFS volume #182

Open humboldt63 opened 6 years ago

humboldt63 commented 6 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

  $glusterversion = '3.7.9-10.el7rhgs'
  $poolname = 'production'
  $dirname = 'share'
  $replica_no = 3
  $bricks = ['gluster01:/srv/glfs/share', 'gluster02:/srv/glfs/share', 'gluster03:/srv/glfs/share']

  class { ::gluster:
    repo    => false,
    version => $glusterversion,
    server  => true,
    client  => false,
    pool    => $poolname,
    volumes => {
      $dirname => {
        replica   => $replica_no,
        bricks    => $bricks,
        transport => 'tcp',
        options   => ['nfs.disable: true'],
      }
    }
  }

What are you seeing

The Gluster module for puppet 4.1.0 with Puppet Enterprise 2018.4.1 for RHEL 7.5 does not define GlusterFS peers as prerequisite for the GlusterFS volume.

What behaviour did you expect instead

The Gluster module for puppet should define all peers and the volume in only one puppet run.

Output log

Puppet Agent Run 1 (Peer nodes are ready)

puppet agent log:

Notice: /Stage[main]/Gluster/Gluster::Volume[share]/Exec[gluster create volume share]/returns: volume create: share: failed: Host gluster02 is not in ' Peer in Cluster' state
Error: '/sbin/gluster volume create share replica 3 transport tcp gluster01:/srv/glfs/share gluster02:/srv/glfs/share gluster03:/srv/glfs/share' returned 1 instead of one of [0]
Error: /Stage[main]/Gluster/Gluster::Volume[share]/Exec[gluster create volume share]/returns: change from 'notrun' to ['0'] failed: '/sbin/gluster volume create share replica 3 transport tcp gluster01:/srv/glfs/share gluster02:/srv/glfs/share gluster03:/srv/glfs/share' returned 1 instead of one of [0]
Notice: /Stage[main]/Gluster/Gluster::Volume[share]/Gluster::Volume::Option[share:nfs.disable]/Exec[gluster option share nfs.disable true]: Dependency Exec[gluster create volume share] has failures: true

check peers manually afterwards:

# gluster peer status
Number of Peers: 0

Puppet Agent Run 2 (Peer nodes are ready)

puppet agent log:

Notice: /Stage[main]/Gluster/Gluster::Volume[share]/Exec[gluster create volume share]/returns: volume create: share: failed: /srv/glfs/share is already part of a volume
Error: '/sbin/gluster volume create share replica 3 transport tcp gluster01:/srv/glfs/share gluster02:/srv/glfs/share gluster03:/srv/glfs/share' returned 1 instead of one of [0]
Error: /Stage[main]/Gluster/Gluster::Volume[share]/Exec[gluster create volume share]/returns: change from 'notrun' to ['0'] failed: '/sbin/gluster volume create share replica 3 transport tcp gluster01:/srv/glfs/share gluster02:/srv/glfs/share gluster03:/srv/glfs/share' returned 1 instead of one of [0]
Notice: /Stage[main]/Gluster/Gluster::Volume[share]/Gluster::Volume::Option[share:nfs.disable]/Exec[gluster option share nfs.disable true]: Dependency Exec[gluster create volume share] has failures: true

check peers and facts (set by the gluster module) manually afterwards:

# gluster peer status
Number of Peers: 0

# puppet facts | grep gluster_
    "gluster_binary": "/sbin/gluster",
    "gluster_peer_count": 0,
    "gluster_peer_list": "",

manual peer probes after the two puppet runs are successful:

# gluster peer probe gluster02
peer probe: success. 

# gluster peer probe gluster03
peer probe: success. 

# gluster peer status
Number of Peers: 2

Hostname: gluster02
Uuid: ********-****-****-****-************
State: Peer in Cluster (Connected)

Hostname: gluster03
Uuid: ********-****-****-****-************
State: Peer in Cluster (Connected)

Any additional information you'd like to impart

I think the problem is that the peers are not defined. Tests with the gluster::peer class also did not define peers although the GlusterFS software is installed successfully and glusterd is started successfully on all peers.

The installed GlusterFS software and Daemon works fine because defining peers and the volume with this installed software can be done manually without any problems.

tsmgeek commented 5 years ago

I have the same issue where its not setting up the peers.

skyfox14 commented 3 years ago

The define gluster::peer is using a legacy fact that is hidden per default: https://puppet.com/docs/puppet/6.21/core_facts.html#fqdn

You've to use $facts['networking']['fqdn'] instead:

gluster::peer { [ 'srv1.local', 'srv2.local' ]: 
  fqdn => $facts['networking']['fqdn'],
}