Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glusterfs Not Replicating data

I have a glusterfs setup with two nodes (Node1 and Node2). I see connection has made between two connection. Problem is when I create some folders on Node1 it does not replicate it on Node2. Please suggest me to overcome if any one had fixed it?

If I mount it on some other server as glusterfs client and create files and folders then its replicating to glusterfs nodes. Is this behavior normal?

Volume Name: testvol
Type: Replicate
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: gluster1.example.com:/var/www/drupal7/sites/default/files
Brick2: gluster2.example.com:/var/www/drupal7/sites/default/files
like image 477
Swaroop Kundeti Avatar asked Jun 19 '14 11:06

Swaroop Kundeti


2 Answers

Gluster volumes are supposed to access and update only via the clients. I saw a similar post by you on the same. Below links are suggested if you don't want to install the client in another node and install in the same server itself.

http://gopukrish.wordpress.com/glusterfs/
http://gopukrish.wordpress.com/high-availability-load-balanced-wordpress-site/
like image 165
Gopu Avatar answered Oct 20 '22 08:10

Gopu


I am not certain what you mean when you use the word 'node'. Gluster is generally made up of bricks, volumes, and hosts.

volumes are generally made up of bricks hosted on hosts. In your example you created a replicated volume named testvol made up of two bricks. One brick is on gluster1.example.com and the other is on gluster2.example.com.

bricks are just places that gluster stores things. They are not themselves replicated or distributed and you are not meant to access them.

volumes are replicated and/or distributed. volumes do not appear in your filesystem until you mount them somewhere.

It is my experience that "gluster" people frown upon having gluster running along with other applications in the same server, but setting that aside and continuing with your example, what you are trying to achieve can be accomplished by re-arranging your thinking a little.

  • Create a folder named /brick on gluster1.example.com
  • Create a folder named /brick on gluster2.example.com
  • Now create your gluster volume named testvol using gluster1.example.com:/brick and gluster2.example.com/brick
  • you will need to start the volume too.
  • next you need to mount your new testvol in your filesystem on gluster1.example.com and gluster2.example.com. Execute something like:

mkdir /mytestvol mount -t glusterfs gluster1.example.org:testvol /mytestvol

on each host. It is /mytestvol which is the replicated gluster filesystem. The bricks are used by gluster for its own purposes. /mytestvol is your view into the replicated gluster volume.

Assuming you mounted testvol on /mytestvol in both systems you can create files in /mytestvol on one of the systems and it will automatically appear on the other.

Now as to your example, you will probably want to move your files folder into /mytestvol and then soft-link back into your web server hierarchy. Something like:

mv /var/www/drupal7/sites/default/files /mytestvol ln -s /mytestvol/files /var/www/drupal7/sites/default/

like image 39
user3718260 Avatar answered Oct 20 '22 08:10

user3718260