Home > bash, CentOS, GlusterFS, Linux, Puppet > Add a new GlusterFS volume to be used by puppet master on CentOS based HA cluster

Add a new GlusterFS volume to be used by puppet master on CentOS based HA cluster

I have puppet master running at CentOS based HA cluster of two nodes.
The install is done on two real machines connected by local direct link (crossover).
Its done using Corosync, Pacemaker, GlusterFS and MySQL

I could write the full install procedure later, now I will just add the after install creation of an additional GluasterFS volume.

the internal IPs of the two nodes are 10.0.0.4 (currently active) and 10.0.0.5m and we work at the active one :

Create the the new volume named puppe-core data directory at the bigger partition /home on both the nodes 10.0.0.{4,5}

root@puppetmaster4:[Fri Dec 21 09:32:08]:[~]$ mkdir /home/gluster-puppet-core
root@puppetmaster4:[Fri Dec 21 09:33:21]:[~]$ ssh 10.0.0.5 mkdir /home/gluster-puppet-core

Create the puppet-core glusterfs volume ONLY at ONE of the nodes, like at 10.0.0.4 :

root@puppetmaster4:[Fri Dec 21 09:33:35]:[~]$ gluster volume create puppet-core replica 2 transport tcp 10.0.0.4:/home/gluster-puppet-core 10.0.0.5:/home/gluster-puppet-core
Creation of volume puppet-core has been successful. Please start the volume to access data.

Set the allowed hosts list for that volume

root@puppetmaster4:[Fri Dec 21 09:34:16]:[~]$ gluster volume set puppet-core auth.allow  10.0.0.4,10.0.0.5
Set volume successful

Start the GlusterFS volume

root@puppetmaster4:[Fri Dec 21 09:35:03]:[~]$ gluster volume start puppet-core
Starting volume puppet-core has been successful

Check the status:

root@puppetmaster4:[Fri Dec 21 09:35:25]:[~]$ gluster volume info
 
Volume Name: puppet-mysql
Type: Replicate
Volume ID: af4b5a20-22ac-4b7d-a2b3-bda47d90ba92
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.0.0.4:/home/puppet-mysql
Brick2: 10.0.0.5:/home/puppet-mysql
Options Reconfigured:
auth.allow: 10.0.0.5,10.0.0.4
 
Volume Name: puppet
Type: Replicate
Volume ID: 41136ba2-9063-4b6e-bd86-5f6a01ae12b4
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.0.0.4:/home/gluster-puppet
Brick2: 10.0.0.5:/home/gluster-puppet
Options Reconfigured:
auth.allow: 10.0.0.4,10.0.0.5
 
Volume Name: puppet-files
Type: Replicate
Volume ID: 59b4c6c7-aa7e-440f-8372-2b4e141da703
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.0.0.4:/home/puppet-files
Brick2: 10.0.0.5:/home/puppet-files
Options Reconfigured:
auth.allow: 10.0.0.5,10.0.0.4
 
Volume Name: puppet-config
Type: Replicate
Volume ID: 9200a32a-d4ef-46ce-a64e-b58c2ccbe49d
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.0.0.4:/home/puppet-config
Brick2: 10.0.0.5:/home/puppet-config
Options Reconfigured:
auth.allow: 10.0.0.5,10.0.0.4
 
Volume Name: puppet-core
Type: Replicate
Volume ID: fc2cdbd6-3b94-4adc-b499-f3fdb452976b
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: 10.0.0.4:/home/gluster-puppet-core
Brick2: 10.0.0.5:/home/gluster-puppet-core
Options Reconfigured:
auth.allow: 10.0.0.4,10.0.0.5

Make the mount point

root@puppetmaster4:[Fri Dec 21 09:44:16]:[/]$ mkdir /puppet-core
root@puppetmaster4:[Fri Dec 21 09:44:37]:[/]$ ssh 10.0.0.5 mkdir /puppet-core

Create the fstab records on both the nodes as local mounts:

root@puppetmaster4:[Fri Dec 21 09:44:42]:[/]$ echo "10.0.0.4:/puppet-core  /puppet-core   glusterfs  defaults  0  0" >> /etc/fstab
root@puppetmaster4:[Fri Dec 21 09:44:45]:[/]$ ssh 10.0.0.5 echo "10.0.0.5:/puppet-core  /puppet-core   glusterfs  defaults  0  0" >> /etc/fstab

Mount the volumes:

root@puppetmaster4:[Fri Dec 21 09:44:58]:[/]$  mount /puppet-core
root@puppetmaster4:[Fri Dec 21 09:44:58]:[/]$  ssh 10.0.0.5 mount /puppet-core

set the proper ownership

root@puppetmaster4:[Fri Dec 21 09:48:53]:[/]$ ssh 10.0.0.5 chown -R puppet:puppet /puppet-core/
root@puppetmaster4:[Fri Dec 21 09:49:04]:[/]$ chown -R puppet:puppet /puppet-core

Now you may start using it, its replicated between the two nodes.

Advertisements
  1. December 21, 2012 at 1:05 pm

    Nice tutorial buddy…

    • dragkh
      December 21, 2012 at 1:27 pm

      thank you master 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: